Last week I blogged some Vagrant tips and pretty much jinxed the run I had in the past months.

Here’s how:

  • I decided to upgrade to Vagrant 1.1, which broke bento: the current bento master is incompatible with Vagrant 1.1. But selecting the right rbenv env and installing the latest available Vagrant gem (inside the rbenv environment) fixed it.

  • My base box build, but for some reason, the guest addition setup broke and while it worked on Mac OSX, it broke the image completely on Ubuntu. Don’t ask me why.

Especially the last bit reminded me to share another small tip, or work-around.

Fixing up base boxes

So every once in a while something doesn’t work as expected. In my case, the guest additions were installed but not loaded and also failed to load when I started a VM. This in itself wasn’t so bad, but it broke the vboxfs shares and while there may be cases where you don’t need that (e.g. for a database VM), a VM without your code mounted into it is pretty useless.

The fix wasn’t too hard:

  • I created a blank Vagrantfile (no recipes, just a simple box definition).
  • vagrant up and wait for the box to fail.
  • vagrant ssh to enter the box, or start with the GUI option and login through it.
  • execute sudo /etc/init.d/vboxadd setup

Then, exit the VM and execute the following: vagrant package vm_name --output box_name.box.

Import the box again with vagrant box add etc., update your Vagrantfile and test — then distribute.

Thoughs

Let me use this to reiterate on how critical a fixed set of versions are.

VirtualBox 4.2.x and bento (or veewee) seem to be incompatible somewhere and even though an error doesn’t surface while the box is build or validated, it’s still happening. It’s paramount that there’s always a rollback of some kind before you end up breaking too many things and stall your team for long.

Fin

That would be all for today.