Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
Have you tried running sudo vmware-config-tools? Have you tried to reinstall the guest additions? – Bob Apr 27 '13 at 3:25
up vote 22 down vote accepted

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.

share|improve this answer
6  
It gives me error: cannot mount filesystem: No such device – codeomnitrix Aug 30 '14 at 8:03
1  
Note: I only had to do the first line, accept all the defaults and reboot. Then it worked. (I already had vmware tools installed and shared folders was working until I updated 12.04 LTS yesterday). – Larry Kyrala Nov 19 '14 at 17:52

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.

share|improve this answer

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
share|improve this answer
1  
Thanks, I edited my last line to fix the typo. Note that Stack Overflow allows you to edit people's answers to fix these types of problems. – Lorin Hochstein May 8 '13 at 16:47

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

share|improve this answer
    
As an FYI, this worked to get the /mnt/hgfs folder mounted, reading and writing. However I am getting segfaults when running commands like python setup.py develop (as an example,) so this is not a working solution. Note that I get the segfaults with open-vm-tools answer as well as the modified files per my answer. So something else is broken. I am going to open a new question on this topic soon. – Craig Wright May 10 '13 at 22:41

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

share|improve this answer
    
The git-repo is really amazing, thanks for the hint! – Danny Lo Jun 18 '15 at 18:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .