22

I just installed Ubuntu 13.04 inside of VMware Fusion Pro 5. I have the virtual machine configured for read-only sharing of my home directory, but there's no /mnt/hgfs directory and there's no /etc/fstab line.

What can I do to mount my Mac home directory inside of the Ubuntu VM?

7 Answers7

27

For some reason, the auto-installed VMWare tools didn't do the job, but Ubuntu has a tool called vmware-hgfsmounter, if I installed it then I could do this:

sudo apt-get install open-vm-tools
sudo mkdir /mnt/hgfs
sudo mount -t vmhgfs .host:/ /mnt/hgfs

After running these commands, /mnt/hgfs should now contain your shares.

24
sudo mkdir /mnt/hgfs

Use the above command first, followed by the following:

sudo /usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other

I am using macOS and VMware Fusion with Ubuntu 18.x.

13

For Ubuntu 16.04 I had to use vmhgfs-fuse, see https://github.com/vmware/open-vm-tools/issues/199#issuecomment-335525133:

This impacts the Shared Folders client as we have switched from a kernel mode component to a FUSE file system component to provide the Shared Folders file system.

This results in a new mount command to be used for creating the shared file system. For Linux kernel versions we use the FUSE file system which will now mean you should be using the following command:

sudo /usr/bin/vmhgfs-fuse .host:/ /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other
laktak
  • 2,635
3

I was having the same problem, not being able to mount hgfs at all. I tried re-installing vmware-tools, then I tried installing vm-open-vm-tools and still no joy. I did notice that when I tried install open-vm-tools and reinstalling vm-ware-tools via vmware-install.pl, I got a failure notice for invalid gcc headers path. You can try this by installing vmware-tools without the -d switch for defaults. You will see the notice for the invalid path. I install headers with apt-get, you may or may not need to create a link to version.h. If version.h exists in /usr/src/linux-headers-$(uname -r)/include/linux/, skip that step.

sudo apt-get install gcc make linux-headers-$(uname -r)

sudo ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/

Installed the headers, I uninstalled open-vm-tools and reinstalled vmware tools using vmware-install.pl. This time hgfs was mounted correctly and my shared folder is there as well. Re-booted and it is still there.

2

I came across this question without realising that vmwaretools was actually failing to compile properly when I installed it. It seems to finish normally but actually has error messages, part of which look a little like this:

make[2]: *** [/tmp/modconfig-TRYAHr/vmhgfs-only/inode.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/tmp/modconfig-TRYAHr/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.16.0-38-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/modconfig-TRYAHr/vmhgfs-only'

The solution I discovered is that vmware tools needs to be patched before it will compile successfully. This amazing repo has the answers:

https://github.com/rasa/vmware-tools-patches

Devin
  • 216
1

After upgrading a VM from Kubuntu 12.10 to 13.04 I hit the same problem using VMware Fusion 5.0.3 on OS X 10.8.3. Reinstalling VMware tools rebooting did not help. Some issue between the VMware drivers and the new kernel I guess (my new kernel version is Linux ubuntu 3.8.0-19-generic). I was able to access the shares using open-vm-tools as described in an answer by the OP but his last line has a typo and should read

sudo mount -t vmhgfs .host:/ /mnt/hgfs
0

You can also edit the files directly to fix this issue. This is a bit of a pain, but the commands follow.

vmhgfs

cd /vmware-tools-distrib/lib/modules/source
tar xf vmhgfs.tar
cd vmhgfs-only/

Open and edit inode.c. Edit line 888, change

result = compat_vmtruncate(inode, newSize);

to

result = 0;

Then save the file and exit the editor. Finally, tar it back up:

cd ..
rm -rf vmhgfs.tar
tar cf vmhgfs.tar vmhgfs-only/
rm -rf vmhgfs-only/

vmci

cd ./lib/modules/source
tar -xvf vmci.tar.

Open and edit ./vmci-only/linux/driver.c.

Edit line 127, change

.remove = __devexit_p(vmci_remove_device),

to

.remove = vmci_remove_device,

Edit line 1753, change

static init __devinit vmci_probe_device(struct pci_dev *pdev, const struct pci_device_id *id) 

to

static int vmci_probe_device(struct pci_dev *pdev, const struct pci_device_id *id)

Edit line 1981, change

static void __devexit vmci_remove_device(struct pci_dev* pdev)

to

static void vmci_remove_device(struct pci_dev* pdev)

Close and save ./vmci-only/linux/driver.c. Then tar the files back up.

tar -cf vmci.tar vmci-only

Now you can run ./vmware-install.pl and it should successfully install HGFS.

I needed to fix both of these broken modules to get HGFS working. Other sites report just needing to fix the vmhgfs module.

Sources:

HGFS: https://answers.launchpad.net/ubuntu/+question/227866

VMCI: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2050666