Fixing VMWare Fusion permissions for shares under Ubuntu guest

I’ve been running into weird issues with running Symfony on an Ubuntu VM Guest, with the files shared via hgfs (VMWare file sharing), where I’d get PHP Errors like: “Unexpected $end” in the generated cache files.  After much googling, I came across this blog post – I’m re-blogging it here in the off-chance this blog goes down.  I take no credit for this, and it is all the work of Aussie Bloke.

aussie bloke: Fixing VMWare Fusion permissions for shares under Ubuntu guest.

To resolve the issue, you need to fix the VMWare Tools script which mounts the shares.  Follow these steps:

  1. sudo vim /etc/vmware-tools/
  2. locate the vmware_mount_vmhgfs function
  3. Set the appropriate uid and gid.
    Note here, the author uses uid / gid of 1000 (default user account) – in my case this did not work, and I had to use the uid / gid of the www-data user (33).

    vmware_exec_selinux “mount -t vmhgfs .host:/ $vmhgfs_mnt -o uid=33,gid=33″

  4. Save the file and reboot your VM

2 Comments Add Yours ↓

  1. 1

    How’s this been working for you? I just changed the uid/gid to 33 and I am crossing fingers.

  2. 2

    It worked for me for a while, but I ended up running into other problems. I eventually gave up on trying to get it working in a VM, and ended up just installing MAMP and doing everything local to OS X. This has posed its own set of challenges, but at least I’ve been able to figure them out for the most part.

Your Comment