In a number of blueprints, it would be very cool to mount local directories read-write, so that you could have:

  • /var/aegir/platforms & /var/aegir/backups persist in Aegir-up;
  • /var/aegir mounted in Aegir-up Dev to make development of Aegir easier;
  • /var/www/drupal in Drupal-up to make development of Drupal core and contrib easier.

I'm sure there are other use-cases, but these are all blocked by our current inability to chown files from within the VM. This would require the 'no_root_squash' setting in NFS, which isn't supported in Vagrant (yet).

CommentFileSizeAuthor
#3 issue-1754384_3.patch1.02 KBfranskuipers

Comments

ergonlogic’s picture

Status: Active » Postponed

This pull request would add the ability to specify arbitrary NFS options: https://github.com/mitchellh/vagrant/pull/1029

ergonlogic’s picture

Note that NFS is unnecessary on Windows, so we can do this in our Vagrantfile: https://github.com/myplanetdigital/ariadne/blob/master/Vagrantfile#L54

franskuipers’s picture

StatusFileSize
new1.02 KB

We are already supporting NFS. I have tried it, and it works fine on a linux host. I am not sure if the nfs-options are working, don't know the different NFS options and their effects.

To prevent NFS mounting on windows, we could add the patch to our Vagrant file.

ergonlogic’s picture

Status: Postponed » Needs work

Right, NFS works, but is limited. Try changing ownership of a file in an NFS-mounted dir, and it'll fail, for example.

There is progress in https://github.com/mitchellh/vagrant/pull/1029#issuecomment-9057074, however, as mitchellh likes the idea, and will likely merge it in the coming weeks. So, it should work its way into released versions of Vagrant by EOY, hopefully.

Anyway, we can support such arbitrary NFS options by pushing that into settings.rb, as I've done here: http://drupalcode.org/project/drush-vagrant.git/blobdiff/e00f87db39139ef...

Basically, we're deprecating NFS_shares, and adding Dir_shares to support arbitrary directory shares, and supports NFS.

I'd prefer to special-case Windows, rather than the reverse. So we could make the flag generic, e.g. 'on_windows' or something, and move it up to the top scope. Then we could just unset the 'share["nfs"]' if we're 'on_windows', or something.

franskuipers’s picture

NFS is working for me on Ubuntu. I share www/ on the guest with /var/www/ on the VM. On the guest I can't chown the files, I have the feeling that is never possible.

I (the vagrant user) and, more importantly, the www-data user can both write to this shared directory. I can develop on the guest and it is reflected on my VM server.

PS: I can't get the /vagrant/ directory on the VM configured so that www-data can write to this directory. User vagrant has write access here.

rerooting’s picture

FYI I found this while looking around, I'll let you know how it works (on Mint, but I had these same problems on OSX before)

https://github.com/gael-ian/vagrant-bindfs

niccolox’s picture

Issue summary: View changes

on Ubuntu 12 host/Ubuntu 12 guest the following worked for me with discourse

    nfs_setting = RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
    config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", type: "nfs", nfs_udp: "true", nfs_version: "4", :nfs => nfs_setting

note; I also had to add host IP determined by vagrant and guest IP determined by Vagrant to firewall exceptions