mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 574 forks source link

The synced folder type 'nfs' is reporting as unusable when using config.vm.synced_folder #469

Open kenorb opened 8 years ago

kenorb commented 8 years ago

This is follow-up from mitchellh/vagrant/issues/7430

When running Vagrantfile without config.vm.synced_folder, somehow my /vagrant folder is synced with my local folder by default as shown below:

==> mt-aws-foo: Rsyncing folder: /Users/x/y/z/_VM/ => /vagrant

but the folder is not synchronized and the changes on one of the site aren't transferred back (the dir doesn't show in mount, so probably it was just one time transfer). I'm not sure by which option this is enabled.

However I would like to have two-way synchronization, so when I'm activating:

config.vm.synced_folder ".", "/vagrant", id: "core", nfs: true

with:

override.nfs.functional = false

I've got the following error:

INFO warden: Calling OUT action: #<VagrantPlugins::Triggers::Action::Trigger:0x000001028e4178>
ERROR vagrant: Vagrant experienced an error! Details:
ERROR vagrant: #<Vagrant::Errors::SyncedFolderUnusable: The synced folder type 'nfs' is reporting as unusable for
your current setup. Please verify you have all the proper
prerequisites for using this shared folder type and try again.>
ERROR vagrant: The synced folder type 'nfs' is reporting as unusable for
your current setup. Please verify you have all the proper
prerequisites for using this shared folder type and try again.
ERROR vagrant: /opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/mixin_synced_folders.rb:144:in `block in synced_folders'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/mixin_synced_folders.rb:125:in `each'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/mixin_synced_folders.rb:125:in `synced_folders'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/synced_folders.rb:27:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/Users/kenorb/.vagrant.d/gems/gems/vagrant-bindfs-0.4.7/lib/vagrant-bindfs/bind.rb:14:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/Users/kenorb/.vagrant.d/gems/gems/vagrant-proxyconf-1.5.2/lib/vagrant-proxyconf/action/only_once.rb:21:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/Users/kenorb/.vagrant.d/gems/gems/vagrant-cachier-1.2.1/lib/vagrant-cachier/action/install_buckets.rb:14:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builtin/provision.rb:80:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/Users/kenorb/.vagrant.d/gems/gems/vagrant-bindfs-0.4.7/lib/vagrant-bindfs/bind.rb:14:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/Users/kenorb/.vagrant.d/gems/gems/vagrant-cachier-1.2.1/lib/vagrant-cachier/action/configure_bucket_root.rb:20:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/warden.rb:34:in `call'
/opt/vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/builder.rb:116:in `call'
...

My security group allows port 2049 (TCP&UDP) which I hope it's enough. Running debug log as above, doesn't help much.

I'm using Ubuntu 14.04.3 LTS (Trusty Tahr) instance which doesn't have nfsd installed.

Note: I'll install sudo apt-get -y install nfs-kernel-server and I'll update the info.

akamensky commented 8 years ago

@kenorb Could you make it work at the end?

kenorb commented 8 years ago

I guess, I had to remove synced_folder line at all, because it seems that /vagrant folder is synced automatically for aws provider. So I'm using synced_folder only for virtualbox provider, but not aws. My Vagrantfile.

This sounds like workaround, until somebody explain what's happening.

akamensky commented 8 years ago

Got it. As I thought there will be no straight forward option on making this working. NFS and rsync are only out-of-box options that should work with AWS provider and NFS won't work there. With virtualbox you get vboxfs which is N/A anywhere else.

FYI this issue is a dupe of another much earlier ticket here started by the repo owner as a bounty hunt for making bi-directional sync.

Suggest closing as repo owner is aware already :)

akamensky commented 8 years ago

https://github.com/mitchellh/vagrant-aws/issues/450