I use VMWare Fusion a lot, simply because I like to replicate the server configurations on my local development machine and it’s easier to have multiple instances of servers readily available with it. I also like to have my code available at all times with whichever VM I am using, so the code is shared. One thing I notice is that the VMTools defaults to using Mac’s UID/GID information, rather than the equivalent on the VM. So using these comments, I found a way to make the changes.
First, I double checked /etc/mtab to find out how it’s mounted.
$ vim /etc/mtab
and it looks like this in that file on my machine:
.host:/ /mnt/hgfs vmhgfs rw,ttl=1 0 0
I copied that and edited the /etc/fstab file and added the UID/GID for my user or whatever existing user or group. I also got from the comments that it fails mounting automatically, and that I should also add nobootwait to the parameters and manually perform unmount and mount. It really sucks but that’s what you got to deal with for the flexibility of multiple development OSes.
$ vim /etc/fstab
In the file, I added:
.host:/ /mnt/hgfs vmhgfs rw,ttl=1,uid=1000,gid=1000,nobootwait 0 0
When you restart the VM, you’ll get some errors (if you’re using the GUI, you probably won’t see it), but login and then do the following:
# umount /mnt/hgfs # mount /mnt/hgfs
Create a script per the comments if you want. It saved me a lot of time.