how to remount shared folder in vmware windows host ubuntu guest after guest paused and unpaused
Assistant
If you have a shared folder set up between a Windows host and an Ubuntu guest in VMware, and you find that after pausing and unpausing the guest the shared folder is no longer accessible, you may need to remount it. Here is a step-by-step guide on how to do this:
Ensure VMware Tools is Installed:
Make sure that VMware Tools is installed on your Ubuntu guest. This is required to ensure that shared folders work correctly.
To check if VMware Tools is installed, you can typically see the status in the VMware Workstation GUI under "VM" > "Reinstall VMware Tools" (if it only shows "Reinstall," VMware Tools is already installed). You can also confirm this from the terminal in Ubuntu by running:
bash
vmware-toolbox-cmd -v
If it is not installed, select "Install VMware Tools" from the VMware menu, which will mount the VMware Tools virtual CD image. You can then follow the installation instructions.
Remount Shared Folder:
If the shared folder needs to be remounted, follow these steps:
a. Find Your Shared Folder Name:
In VMware Workstation, navigate to "VM" > "Settings" > "Options" > "Shared Folders" to find the configured shared folder name.
b. Mount the Folder:
Open a terminal in Ubuntu and use the mount command to manually remount the shared folder. Here’s the general syntax:
bash
sudo mount -t vmhgfs .host:/<SharedFolderName> /mnt/hgfs/<SharedFolderName>
Replace <SharedFolderName> with the actual name of your shared folder, and ensure that the mount point /mnt/hgfs/<SharedFolderName> exists. You can create it if necessary:
bash
sudo mkdir -p /mnt/hgfs/<SharedFolderName>
Automate Remount with a Script (Optional):
If you frequently face this issue, you can create a simple script to remount the folder:
Create a script file remount_shared_folder.sh:
bash
#!/bin/bash
sudo mount -t vmhgfs .host:/<SharedFolderName> /mnt/hgfs/<SharedFolderName>
Give it executable permissions:
bash
chmod +x remount_shared_folder.sh
User
mount: /mnt/hgfs/fiji: unknown filesystem type 'vmhgfs'.
Assistant
The error message you're encountering indicates that the system doesn't recognize the vmhgfs filesystem type, which is used for VMware shared folders. This can happen for several reasons, often related to VMware Tools not being properly installed or an issue with the specific tools package for your kernel version. Here are the steps to address this:
Now you can simply run this script whenever you need to remount the shared folder after pausing/unpausing.
By following these steps, your shared folder should be accessible again after the guest is paused and then unpaused. If you experience persistent issues, consider restarting VMware Tools or checking VMware’s documentation for updates or patches concerning shared folder issues.
1. Update and Install Required Packages
Make sure your system is up-to-date and that necessary packages are installed. Open a terminal and run the following commands:
With more recent versions of VMware and open-vm-tools, VMware has moved to using FUSE for shared folders. You'd then use vmhgfs-fuse to mount the shared directories instead of the traditional vmhgfs.
Unmount any previous mounts:
If there's an existing problematic mount, unmount it first:
bash
sudo umount /mnt/hgfs/<SharedFolderName>
Create the mount point directory:
If it doesn't exist, create the directory where you plan to mount the shared folder:
bash
sudo mkdir -p /mnt/hgfs/<SharedFolderName>
Mount the shared folder:
Use vmhgfs-fuse to mount the shared folder. Replace <SharedFolderName> with the name of your shared folder as configured in VMware:
If you're still having trouble, double-check that VMware Tools is properly installed. Ensure you are running the version provided by your distribution (like open-vm-tools and open-vm-tools-desktop) rather than the one bundled with older versions of VMware, which might not include vmhgfs support.
4. Reinstall VMware Tools (As a Last Resort)
Consider reinstalling VMware Tools if the above steps do not work. Follow the steps specific to your VMware product to reinstall VMware Tools, then retry the process using vmhgfs-fuse.
If you continue experiencing issues with vmhgfs, consulting the VMware forums or checking for specific issues related to your VMware version can be helpful. It's also worth verifying that both your VMware product and Ubuntu system are up-to-date, as updates can sometimes include necessary patches for compatibility issues.