VMWare Workstation Shared Folders between Windows and Ubuntu (debian) "Error Mounting"
While attempting to setup a shared folder through VMware Workstation 9.0.2 running on Windows 8 host, with a Linux Mint (Ubuntu/Debian) guest, and kept running into one problem after another. I spent probably an hour or more just trying to figure out the problem and get it to work correctly, and finally was able to get something to work, here’s how…
Before I get into how I got it to work, I want to point out the two errors I was running into. The first error I came across was during the configuration using the vmware-config-tools.pl file. I made sure I had shared folders set to yes, and kept getting an error saying I needed to run the vmware-config-tools.pl once I made sure that gcc, buildutils, and kernel headers were installed. I knew for a fact they were but couldn’t get past this error.
The other error I kept getting was when I would edit the settings of the VM while it was running, and enable the shared folder. The error would say “Unable to update run-time folder sharing status: There was an error mounting Shared Folders file system inside the guest operating system.”
Setting it all up
First, completely remove VMWare tools, by running the vmware-uninstall-tools.pl which is located under the bin directory from the tar file you used to install VMWare tools. Once you have completely removed VMWare tools, reboot the VM. Once the VM comes back up, run the following command:
1 |
apt-get install linux-headers-virtual linux-image-virtual build-essential binutils cpp gcc make psmisc linux-headers-$(uname -r) |
This will install the linux kernel image and headers for VMs, some build packages, gcc, etc, which is probably already installed. The last item that has the $(uname -r) is the linux kernel headers for the current kernel you are running, just run
1 |
uname -a |
To determine what kernel you are currently running.
Once you have installed all the images, headers, build packages, you can run this command:
1 |
apt-get install open-vm-toolbox |
After that finishes installing, reboot the VM, and check under /mnt/hgfs to see if your shared folders appear. One weird thing I did notice was after doing this they did not appear right away. I actually went into the shared folders, and added another folder under my current user account (on the host), and voila for some reason they both showed up! This was tricky to say the least, and I did try a lot of things to get this working, so play around and i’m sure you can get it to work.
Add Entry to /etc/fstab
Open up /etc/fstab and add the line below in quotes after echo, or run the entire command, if you want all shared folders to be mounted to /mnt/hgfs at boot (do not change .host, it should say exactly that)
1 |
echo ".host:/ /mnt/hgfs vmhgfs defaults 0 0" >> /etc/fstab |
So if I wanted to mount the shared folder Cloud to /home/myles/cloud I would use this
1 |
echo ".host:/Cloud/ /home/myles/cloud vmhgfs defaults 0 0" >> /etc/fstab |
Troubleshooting
Here’s some useful commands for troubleshooting:
1 |
vmware-hgfsmounter |
1 |
vmware-hgfs |
1 |
vmware-hgfsclient |
1 |
lsmod |grep vmhgfs |
1 |
modprobe vmhgfs |
Mounting Examples
Mount all shares to /home/user1/shares
1 |
mount -t vmhgfs .host:/ /home/user1/shares |
Mount the share named foo to /tmp/foo
1 |
mount -t vmhgfs .host:/foo /tmp/foo |
Mount the subdirectory bar within the share foo to /var/lib/bar
1 |
mount -t vmhgfs .host:/foo/bar /var/lib/bar |
-
iamdanger