Getting host interface networking to work again in VirtualBox

After installing a new version of openSUSE I had some issues with VirtualBox. Before the install I exported my virtual machines (VM) as appliances. This makes it easy to re-use VMs without having to install an OS from scratch. Exporting and importing is literally as easy as clicking a button.

Unfortunately after importing my VMs, I got the following error message:

Failed to open a session for the virtual machine Windows.

Failed to open/create the internal network 'HostInterfaceNetworking-eth0' (VERR_SUPDRV_COMPONENT_NOT_FOUND).

One of the kernel modules was not successfully loaded. Make sure that no kernel modules from an older version of VirtualBox exist. Then try to recompile and reload the kernel modules by executing '/etc/init.d/vboxdrv setup' as root (VERR_SUPDRV_COMPONENT_NOT_FOUND)

Running /etc/init.d/vboxdrv setup actually did not help. I was told the kernel module was already installed. Running the network in NAT mode worked. Only the bridged adapter option caused this error and I really needed that option to communicate between VMs over ssh.

After some searching, it turned out that openSUSE had installed the VirtualBox guest kernel module. That is apparently useful if you run openSUSE inside VirtualBox. But I was running VirtualBox inside openSUSE.

So in Yast I added the virtualbox-host-kmp-desktop package and removed all virtualbox-guest-* packages. Rebooted and problem solved!