On Fedora 19 vagrant is unable to mount NSF shares by default #2447

Closed
mareg opened this Issue Nov 1, 2013 · 6 comments

Comments

Projects
None yet
6 participants

mareg commented Nov 1, 2013

Vagrant 1.3.5 x86_64 installed from the rpm.

When I try to boot a vagrant box, I get the following error:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* It appears your machine doesn't support NFS, or there is not an
adapter to enable NFS on this machine for Vagrant. Please verify
that `nfsd` is installed on your machine, and try again. If you're
on Windows, NFS isn't supported. If the problem persists, please
contact Vagrant support.

Simple solution is to run the following two options:

$ sudo systemctl restart nfs-server
$ sudo systemctl stop firewalld

Then it works just fine.

I guess, vagrant should work out of the box without having to restart nfs-server and disable firewall on every login.

jephir commented Nov 1, 2013

I was having this same issue. Thanks for the solution! If you only restart nfs, but not stop firewalld, Vagrant will hang at Mounting NFS shared folders... without any error message.

gregelin referenced this issue in GitMachines/statedecoded-gm-centos6 Nov 1, 2013

Open

On Fedora 19 vagrant is unable to mount NSF shares by default #24

mareg commented Nov 4, 2013

@jephir it's not a solution, it's a dirty workaround - it's bad that firewall has to be disabled in order to make the vagrant work. while it's ok at work place, it's not if you work at the cafe or connected to the public wifi network.

nexusVI commented Nov 5, 2013

Example for easily configuring firewalld using the "firewall-config" GUI:

  • choose "Configuration: Permanent" from the drop down menu
  • select the zone you want to modify (i chose "internal").
  • go to the "Interfaces" tab, assign vboxnet0 (or other host-only adapter) to the zone.
  • go to the "Services" tab, check "mountd", "nfs" and "rpc-bind"
  • go to the global "Services" tab (next to "Zones"), select NFS and add Port 2049 UDP (only TCP is predefined).
  • Finally choose "Options/Reload Firewalld".

NFS mounts now work correctly from within the VM and you can leave firewalld enabled.

dheche commented Nov 16, 2013

or if you want using cli, you can use firewall-cmd like this (example below using "public" zone)

firewall-cmd --permanent --zone public --add-service mountd
firewall-cmd --permanent --zone public --add-service rpc-bind
firewall-cmd --permanent --zone public --add-service nfs
firewall-cmd --reload
Contributor

purpleidea commented Dec 10, 2013

After running firewall-cmd alone, this wouldn't work for me. From looking at the rules, this only opens the TCP ports. In any case, what I had to do to get this to work was:

config.vm.synced_folder "some/folder/", "/tmp/nfs", :nfs => true, :mount_options => ['rw', 'vers=3', 'tcp']

I had to specify all the options that get used because if you add even one option to mount_options, it erases the defaults. By default it uses UDP. I wanted to use TCP. It might make sense to have a merge option.

I'm running Vagrant 1.3.5 on Fedora 19 using vagrant-libvirt
https://ttboj.wordpress.com/2013/12/09/vagrant-on-fedora-with-libvirt/

Looking forward to getting all the missing pieces fixed. Cheers

Owner

mitchellh commented Apr 9, 2014

This should be fixed now

mitchellh closed this Apr 9, 2014

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