I'm facing an odd problem with (re)packaging a Vagrant box and hope that maybe someone can tell me in what direction to look. This is the story
- I installed Vagrant and have successfully created some puppet manifests and it all works fine, vagrant up … provisioning, …
- Then I needed to switch to NFS which failed because nfs was not installed on my Guest OS (Ubuntu 11.04-amd64)
- I installed nfs-common on the guest OS (
sudo apt-get install nfs-common
) vagrant halt
vagrant up
- And the NFS mount works flawlessly, even after several halt/up commands, I'm happy!
The next logical step would be packaging the box so I do not need to reinstall nfs-common each time the VM is destroyed.
- In the same directory as above :
vagrant package
vagrant box add ubuntuvm2 package.box
rm package.box
- change the line
config.vm.box
in Vagrantfile to ubuntuvm2 vagrant destroy
vagrant up
- and all of a sudden the nfs mount fails, when sshing into the VM i can confirm that nfs-common is indeed installed but the NFS mount just fails: https://img.skitch.com/20120302-kwix296t44y31rxkd52pwm72f4.jpg
Anyone has an idea in what direction to start looking for a solution?
I'm using Virtualbox 4.1.8 and Vagrant 1.0.0 on OS-X Lion
Best Answer
I had the very same problem, but I have figured it out. At least it works for me now. :)
TL;DR:
Long form:
When reloading or recreating the box it would die on NFS mount with the typical message.
Inspecting the /etc/exports file with NFS Manager it tells me my /etc/exports contain syntax errors.
I clean out /etc/exports and test nfs client and server with this entry:
When running vagrant up NFS mounting is working again.
When repackaging box after apt-get dist-upgrade I noticed the NFS folders would not mount again.
This time there were no errors in the /etc/exports file. I discovered Vagrant had not initialized the host local interface.
/etc/network/interfaces contained this:
ifconfig -a returned this:
The interface was not defined correctly. After updating the /etc/network/intefaces stanza to use eth2 NFS mounting is working again.