Vagrant Sync Folder Using Incorrect NFS Permissions

Trying to use the NFS plugin with a synchronized folder in Vagrant also works, except that in the guest (VM) permissions are incorrect:

 -rw-r--r-- 1 501 dialout 0 Jan 20 00:51 a -rw-r--r-- 1 501 dialout 0 Jan 20 00:51 foo 

I tried to configure uid and gid according to Vagrant documentation in Vagrantfile :

 config.nfs.map_uid = 1001 config.nfs.map_gid = 1001 

I was hoping to use the correct user / group in the guest system, but it still uses 501 and dialout .

Any ideas?

+6
source share
1 answer

I had the same problem. It started after I upgraded my MacOS to mcOS Sierra 10.12.1. The trick that worked for me was to set / force the owner and group to the β€œroaming” user in the Vagrantfile as follows:

  config.vm.synced_folder "/users/myuser/src/", "/home/vagrant/src/", owner: "vagrant", group: "vagrant" 

I also had to remove the "nfs: true" parameter that was previously in the Vagrantfile.

-3
source

All Articles