what we blog

Vagrant on Mavericks

Update

Since this post got a lot of attention last night (hey all of you upgraders!) I'll add a couple of things that I figured out since writing the post.

  • Please note that this post refers to VirtualBox 4.2. In the meantime 4.3 has been released and offers limited support for Mavericks. There seem to be some problems related to signed kernel extensions. There's more information in this HN comment, including some possible workarounds. I'm still using 4.2 so I haven't tried any of those. YMMV.
  • The underlying issue is that VirtualBox 4.2 relies on StartupItems, a feature deprecated 8 years ago and finally removed in Mavericks. See the Issue on the Virtualbox Issue Tracker for details.

Original Post

When switching from my old and trusted Air to a newer version last week I decided to update my OS from a tried and proven Snow Leopard to the lastest OS X Mavericks developer preview. There's a couple of minor nuissances, for example the Time Machine icon stopped spinning when doing a backup, but otherwise, the change was pretty painless. The only thing bothering me is Vagrant, or rather the underlying VirtualBox.

At the beginning, everything seemed fine: VirtualBox and Vagrant both installed fine, I tried a machine that I had around and it booted perfectly. The problems started after I restarted the host OS. Suddenly, any host-only network defined in the vagrantfile would crash the bootup process with:

Command: ["hostonlyif", "create"]

Failed to create the host-only network interface.
VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory

Digging for the error message there's a similar bug on the Vagrant Bugtracker and some complaints about this problem on the Virtualbox Forum here and here. Further digging indicates that the error might be that the VirtualBox kernel extensions can't be loaded which leads us to this fine article, where we learn that the kernel extensions get loaded by a startup item. And, alas, manually calling the startup item after a reboot with

sudo /Library/StartupItems/VirtualBox/VirtualBox restart

fixes the problem. I haven't investigated why the startup item does not execute properly on reboot - I shut down my mac so rarely that I can run the command manually, but if you figure that out ping me and I'll update the article.

Happy hacking.