Closed arh1 closed 8 years ago
Oops, meant to ping you on this @TrevorScheitrum per our chat yesterday.
I admit I'm unclear on the desired changes here... What should the final uid:gid look like inside the VM? And is it possible to have that be different than what's seen in the host machine? (Limitations of my understanding of NFS.)
The ultimate goals are ensuring we can manipulate the file system inside the webroot as needed during the course of normal site operations, and executing files / manipulating the file system as needed during setup/provisioning tasks.
The Vagrant NFS docs have left me a little more confused on this...
map_uid and map_gid (int) - The UID/GID, respectively, to map all read/write requests too. This will not affect the owner/group within the guest machine itself, but any writes will behave as if they were written as this UID/GID on the host. This defaults to the current user running Vagrant.
map_uid
andmap_gid
(int) - The UID/GID, respectively, to map all read/write requests too. This will not affect the owner/group within the guest machine itself, but any writes will behave as if they were written as this UID/GID on the host. This defaults to the current user running Vagrant. (emphasis mine)
I think the easiest intuition would be that NFS lets you "impersonate" a specific user/group when making requests, and Vagrant's defaults make it so that regardless of the user inside the VM, all file actions seen by the host are made by the user who typed vagrant up
.
I wonder if we should be attempting to resolve our NFS drama by removing some of our own configuration (trying to set things like map_root and whatever) and seeing what Vagrant's defaults get us.
@arh1 we just merged #210, which may address this. Do you mind kicking the tires on the latest 1.1.x?
Per our chat just now, looks good from my end!
After a vagrant reload --provision
, I'm able to:
[vagrant@localhost ~]$ touch /vagrant/foo
[vagrant@localhost ~]$
The user and group aren't set correctly within the VM, which causes problems. Here's what I see inside the VM after provision:
1000 is the uid and gid of my user on the host machine.
This has been the case for me for a long time, but I got used to working around it. (Thought it was Linux-specific.) However today I realized that it's effecting at least some folks on Macs, too.
Symptoms of the problem include:
Presumably this has to do with these lines, but not sure of the fix yet: https://github.com/forumone/web-starter/blob/1.1.x/Vagrantfile#L51-L52