Vagrant error: NFS is reporting that your exports file is invalid
The same thing happened to me. I copied over my Vagrantfile from another project and forgot to change the NFS settings. This caused the current VM to mount the parent folder of the VM that I copied the original Vagrantfile from. So I did this:
vagrant halt
vagrant up
Still got the same error. So I tracked down my exports file located at /etc/exports which looks like this:
# VAGRANT-BEGIN: 501 64e10d4d-342e-4f55-b69a-97edda35742f
"/Users/[username]/vagrant" 192.168.11.12 -alldirs -mapall=501:20
# VAGRANT-END: 501 64e10d4d-342e-4f55-b69a-97edda35742f
# VAGRANT-BEGIN: 501 b3c6e7fe-95d4-48db-8876-c89d3e07af8d
"/Users/[username]/Sites/molitech-oms" 192.168.11.124 -alldirs -mapall=501:20
# VAGRANT-END: 501 b3c6e7fe-95d4-48db-8876-c89d3e07af8d
# VAGRANT-BEGIN: 501 3e2aabfd-ce63-441b-85a2-1b51e8beb863
"/Users/[username]/Sites/app" 192.168.11.125 -alldirs -mapall=501:20
# VAGRANT-END: 501 3e2aabfd-ce63-441b-85a2-1b51e8beb863
# VAGRANT-BEGIN: 501 ff92e353-9f6d-48ee-9d76-e29b33f1dd60
"/Users/[username]/Sites" 192.168.11.126 -alldirs -mapall=501:20
# VAGRANT-END: 501 ff92e353-9f6d-48ee-9d76-e29b33f1dd60
The last two paths are the same. So I deleted the last three lines and ran:
vagrant halt && vagrant up
Now everything seems to be working fine.
OSX 10.11.1 Vagrant 1.7.4
I ran into this issue with Vagrant 1.4.1 and VirtualBox 4.3.6 on OS X 10.9 Mavericks (13A603). I was able to fix it with a simple command to create the missing /etc/exports file. Run this on OS X, not guest, as pointed out in comments below.
$ sudo touch /etc/exports
I was then able to successfully run vagrant up
. I did run into another error where the Guest Additions weren't up to date, but I fixed that issue by installing the vagrant-vbguest plugin.
$ vagrant plugin install vagrant-vbguest
and then a quick vagrant reload
and I was up and running!
I had some previous images/boxes installed in my VirtualBox installation, so there were a few invalid entries in /etc/exports
already. So I had to clean up that file and restart my Vagrant box.
NFS is reporting that your exports file is invalid. Vagrant does
this check before making any changes to the file. Please correct
the issues below and execute "vagrant reload":
Here's what I did on my host machine:
sudo rm /etc/exports
sudo touch /etc/exports
vagrant halt
vagrant up --provision
For me, this error started appearing for a working Vagrant environment.
I had renamed the directory Vagrant was running from. To fix it, I ran 'sudo vi /etc/exports' and fixed the pathname so it pointed to my current directory.