Skip to main content

Senior Web Engineer. Open web / music. Remote DJ. Tall Dutch guy. #3million

micro.blog/sander

svandragt

mixcloud.com/cloudseer

 

Fixing Virtualbox host network adapter cannot be created error

If when trying to start a vm, for example using vagrant, you get the error message that the host network adapter cannot be created:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg*)" at line 94 of file VBoxManageHostonly.cpp

Make sure to first start the virtualbox GUI application. It does some extra checks, and sometimes highlights the permission problem:

In my case (OpenSuse 15.1 Leap), my user was not added to the vboxusers group. Via Yast > Users and Security .... and editing my user account it was a simple checkbox away. Remember to relog.

If that doesn't work, reloading the kernel extensions could help:

$ sudo dpkg-reconfigure virtualbox-dkms
$ sudo dpkg-reconfigure virtualbox
$ sudo modprobe vboxdrv
$ sudo modprobe vboxnetadp