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
sudo apt-get install nfs-common
)vagrant halt
vagrant up
The next logical step would be packaging the box so I do not need to reinstall nfs-common each time the VM is destroyed.
vagrant package
vagrant box add ubuntuvm2 package.box
rm package.box
config.vm.box
in Vagrantfile to ubuntuvm2vagrant destroy
vagrant up
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
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.
[default] Mounting NFS shared folders...
Mounting NFS shared folders failed. This is most often caused by the NFS
client software not being installed on the guest machine. Please verify
that the NFS client software is properly installed, and consult any resources
specific to the linux distro you're using for more information on how to
do this.
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:
/Users/tm/git -alldirs localhost 33.33.33.10
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:
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
auto eth1
iface eth1 inet static
address 33.33.33.10
netmask 255.255.255.0
#VAGRANT-END
ifconfig -a returned this:
eth0 Link encap:Ethernet HWaddr 08:00:27:3a:47:72
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe3a:4772/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:971 errors:0 dropped:0 overruns:0 frame:0
TX packets:614 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:83951 (81.9 KiB) TX bytes:74872 (73.1 KiB)
eth2 Link encap:Ethernet HWaddr 08:00:27:89:f5:e3
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
The interface was not defined correctly. After updating the /etc/network/intefaces stanza to use eth2 NFS mounting is working again.