Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

4 Answers 4

up vote 17 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
    
It gives me error: cannot mount filesystem: No such device –  codeomnitrix Aug 30 at 8:03
    
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 at 17:52

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

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
    
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

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) ln -s /usr/src/linux-headers-$(uname-r)

sudo /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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.