10

Using Ubuntu 16.04 and installing VirtualBox 5 according to the prescribed method here for "Debian-based Linux distributions":

https://www.virtualbox.org/wiki/Linux_Downloads

This faces a problem with the kernel in this version that is solved as such:

https://askubuntu.com/a/768310/254069

Attempting to create a host-only adapter like so fails:

$ VBoxManage hostonlyif create
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 71 of file VBoxManageHostonly.cpp
  • what does lsof | grep vbox show? – Stefan Schmiedl Jun 15 '16 at 19:16
6

It turns out that the solution to the networking problem is a separate module that must be signed to allow this specific function. As stated in the signing solution here: https://askubuntu.com/a/768310/254069

VBoxManage hostonlyif create needs the following modules to also be accessible (modprobe):

openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=MOK Signing/"

sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxdrv)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxnetflt)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxnetadp)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vboxpci)

sudo mokutil --import MOK.der

Restart and "Enroll MOK"

$ VBoxManage hostonlyif create
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Interface 'vboxnet1' was successfully created
  • I get 'EFI variables are not supported on this system' when i run the 'sudo mokutil --import MOK.der' command. any idea? – emeraldjava Oct 4 '16 at 20:15
  • I got this too. Pls help us. – Rubinum May 3 '17 at 17:41
  • This no longer happens for me with the latest version of VirtualBox installed through aptitude on 16.04 – TomSchober May 7 '17 at 18:15
0

In Ubuntu 17 zesty, fresh install, fresh VirtualBox, host-only network don't work.

# ip a
4: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
5: vboxnet1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:01 brd ff:ff:ff:ff:ff:ff

the solution was:

# ip link set vboxnet0 up
# ip link set vboxnet1 up

and works !!!

  • 1
    I don't understand. Please clarify where to put/enter or what to do with these Strings. Console Command? Configuration? Host or Guest? – mondjunge May 18 '17 at 14:40
0

I found another simpler solution to solve this problem but it relates to VirtualBox 6.0+ . . . it might also work with 5.x but I didn't test it for that version.

The issue is because the kernel modules are not signed by default so in order to do that you need to add the public keys from Oracle.

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add -

Once you add these keys, you can install VirtualBox in the normal way and it will work fine with most features (except for those that require the proprietary extension, would still need to install that for those features)

-1

Run VirtualBox in Sandbox using Firejail as below:

firejail --noprofile virtualbox

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.