Start vboxnet0 at Boot

I did some work with VirtualBox 4.1.6. on Fedora 15, and I noticed that my host-only network interface vboxnet0 was not created automatically by VirtualBox’s init scripts.  That became a problem because I wanted to configure all interfaces before starting any virtual machines.

It turns out the solution is quite simple. When a command like VBoxManage or VBoxHeadless is run, all network interfaces are set up. So just adding VBoxManage with a harmless option to the init script will ensure the virtual network interfaces are created at boot time. For example, in /etc/rc.d/rc.local I added

VBoxManage list vms > /dev/null 2>&1

Now everything works swimmingly.