Skip to content

Instantly share code, notes, and snippets.

@tsabat
Created January 5, 2012 19:35
Show Gist options
  • Select an option

  • Save tsabat/1566818 to your computer and use it in GitHub Desktop.

Select an option

Save tsabat/1566818 to your computer and use it in GitHub Desktop.
NFS and Vagrant

my vagrant settings

config.nfs.map_uid = 0
config.nfs.map_gid = 0

config.vm.share_folder "v-data", "/opt/webapp", "source"
config.vm.share_folder "v-data", "/home/vagrant/customization", "home"

my permissions on the host source dir defined above

➜  source git:(master) ✗ ls -al source
total 8
drwxr-xr-x   4 timsabat  staff  136 Jan  5 11:05 .
drwxr-xr-x  19 timsabat  staff  646 Jan  5 11:24 ..
-rw-r--r--   1 timsabat  staff    2 Jan  5 10:17 .gitignore
drwxr-xr-x   2 timsabat  staff   68 Jan  5 11:05 from_host

what i see on my guest at /opt/webapp

vagrant@lucid64:/opt/webapp$ ls -al
total 8
drwxr-xr-x 2 root root 4096 2012-01-05 11:23 .
drwxr-xr-x 5 root root 4096 2011-12-21 10:55 ..
-rw-r--r-- 1 root root    0 2012-01-05 11:23 me.txt

how do i get the permissions to match?

@sankroh
Copy link
Copy Markdown

sankroh commented Feb 26, 2012

You are going to have to fix those permissions when you provision the VM, using something like Chef and then doing a chown user:user folder/ to whatever folder and user you want. See Issue 758.

Also, you might want to reset your config.nfs.map_uid and config.nfs.map_gid settings. I would set them to :auto which is the default and that works for most of the use-cases.

hth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment