Roots Discourse

'Vagrant up' hangs at "Mounting NFS shared folders..."

Yesterday I did ‘vagrant up’ on an old project after having not run a vagrant VM for a month or so.

It hung at:

Mounting NFS shared folders…

After updating Virtualbox, Guest Additions, Vagrant, Vagrant plugins, and the ‘box’ the only way I could fix this was to modify the line below in the VagrantFile:

from:

config.vm.synced_folder local_site_path(site), nfs_path(name), type: ‘nfs’

to:

config.vm.synced_folder local_site_path(site), nfs_path(name), type: ‘nfs’, nfs_udp: false

The only thing that I think had changed since I last ran a vagrant VM is OS (Ubuntu) updates.

So without having investigated any further I am assuming that that is the cause for now.

However it would be good to know if anyone else had seen this issue? And maybe they had even investigated the exact cause.

Maybe this is even related to VirtualBox performance in windows however that thread is discussing Windows so it seems unlikely.

EDIT: Just to clarify, my control machine (host) is Ubuntu 14.04 LTS

2 Likes

My host machine is windows 8.1 64bit and I started experiencing the same problem yesterday. I cloned each repo and only changed one line in the Vagrantfile as per this post : Deploying from windows

The vagrant-winnfsd also stays running sometimes after a vagrant halt.

I’m not entirely sure what I did that fixed it. I destroyed the vagrant boxes, cleared them out using the virtualbox GUI, and rebooted. Then reinstalled and voila.

1 Like

I also have the same problem, same host (ubuntu 14.4) and I can confirm Craig’s solution works for me too.
Thanks.

1 Like

Thanks for the info it makes me think that this is guest side as the VM was unchanged. Looking at your link my guess is you are using UDP as I think that is the default NFS protocol and I don’t think that you have specified otherwise? So I think that these two issues may be unrelated based on the fact that the host side seems to have Ubuntu host using TCP while (I think), the Windows host is using UDP??

Have a look at the comments on here

2 Likes

I have only changed that single line in the Vagrantfile, so your guess would be correct. All other settings are default.

1 Like

I can confirm a dist-upgrade to kernel 3.16.0-52 fixed it for me.

2 Likes

Thanks for that, wish I found it myself it would have saved me a headache (obviously need to work on my Google skills :frowning: )

I forgot to post it originally however my output with VAGRANT_LOG set to ‘info’ was similar I believe.

1 Like

Also anyone else that still has this issue, running the following worked for me:

sudo ifconfig vboxnet1 down
sudo ifconfig vboxnet1 up

This essentially restarts the virtualbox network.

1 Like

If you are on a mac make sure your hard drive is not encrypted.

$ sudo fdesetup status

If enabled, it will read ‘FileVault is On’. To disable FileVault type in terminal.

$ sudo fdesetup disable

I am also getting this out of the blue, I just updated Mac OS to 10.13.6 not sure if this is the culprit. I did run the notes above but this did not change anything

$ sudo fdesetup status
$ sudo fdesetup disable

What’s your exact error? Did you encrypt your filesystem?

See https://www.vagrantup.com/docs/synced-folders/nfs.html#other-notes /via https://roots.io/trellis/docs/local-development-setup/

I restarted my computer and all is well again. When in doubt, restart!

If you are on MacOS, make sure your terminal app has full disk access. See comment here: https://github.com/hashicorp/vagrant/issues/10234#issuecomment-424305964