Amazium bvba, your online partner
VMWare Fusion & Linux: uid/gid
  • Share post with Twitter
  • Share post with StumbleUpon
  • Share post with Delicious
  • Share post with Digg
  • Share post with Technorati
  • Share post with Blinklist
2009-03-15 12:51

VMWare Fusion & Linux: uid/gid

debian, shared folders, vmware

Today I created a new Debian Virtual Machine. I like to use shared folders to have my code on my mac, but use the VM to create a production like environment. The shared folders are great, but they have one big drawback: the uid & gid are the ones inherited from your Mac.

I looked on the net how to change it to something usefull and I found a lot of articles about changing the uid/gid and then changing this on disk level. It was quite a lot of hastle and an attempt to do so didn't go very well.

There is however a very good and simple solution!

First of all, detect the uid and gid of the user/group you want to use for your shared folders. For instance if you want to use www-data, you issue following command:

debian:~# id www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data)

Remember the uid and gid and edit the file /etc/fstab. Look for following line:

.host:/ /mnt/hgfs vmhgfs defaults,ttl=5 0 0

Now, replace it by following line (enter your uid and gid of course):

.host:/ /mnt/hgfs vmhgfs defaults,ttl=5,uid=33,gid=33 0 0

Next time you mount your shared folder, it will use the new uid/gid.

Hope this saves you a lot of headaches!

Add a Comment

Your email is never published or shared. Required fields are marked*