Vagrant up fails to mount linked directory

There are times where a system update breaks your system. Perhaps some configuration gets overwritten or something that seems unrelated suddenly breaks. In this case my vagrant setup broke, the linked /vagrant directory couldn’t be mounted anymore. After some searching on Google I found this issue on GitHub. The comment from lenciel gave the solution.

This is usually a result of the guest’s package manager upgrading the kernel without rebuilding the VirtualBox Guest Additions. Ran sudo /etc/init.d/vboxadd setup on the guest solved this problem for me.

What this command does is first remove and then install the kernel modules of VirtualBox. First I ran the command and then I ran the mount -a command which fixed my problem. It turns out the virtual machine had some kernel updates, but the VirtualBox Guest Additions weren’t updated afterwards.

Remembering to run the command isn’t something I like doing, hence this blog post which will serve as an external memory. Luckily there is a vagrant plugin (vagrant-vbguest) that helps in making sure the guest additions are in sync with your host’s VirtualBox version. It can also be used to reinstall the guest additions to the virtual machine. Perhaps it’s still necessary to mount the linked directories again but vagrant vbguest and mount -a are certainly easier to remember.

How I decided to setup network interfaces on my virtualbox machines

Sometimes you want a throw away server or perhaps even a bunch of throw away servers. Instead of using an actual machine or spending money on machines at cloud providers, you will probably tinker with virtual machines. A perfectly free solution is VirtualBox, now an Oracle product. If I need to practice installs or even orchestrating an update of a full cluster, I will create new clones of my template Ubuntu 32-bit server and I’m ready to experiment.

My preference is not to bother others and avoid being bothered by them. Which is why I prefer to configure my boxes with two interfaces. One is only accessible from my laptop, the other uses NAT so I can update or download straight from LAN or the internet. The reason why I decided on two interfaces is that I can easily switch off the NAT one and have a static IP to communicate with the virtual machine. Continue reading