11

I am trying to setup a Windows 10 (guest) VM on Ubuntu 20.04 (host) and I am stuck with the following problem when trying to launch it.

The virtual machine 'Windows 10 Pro' has terminated unexpectedly during startup with exit code 1 (0x1).
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MachineWrap
Interface: IMachine {85632c68-b5bb-4316-a900-5eb28d3413df}

failed_to_open_session

Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing '/sbin/vboxconfig' as root.
If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.
where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.**

kernel_driver_not_installed

In the terminal :

$ virtualbox
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (5.13.0-051300-generic) or it failed to
         load. Please recompile the kernel module and install it by
       sudo /sbin/vboxconfig

     You will not be able to start VMs until this problem is fixed.</pre>

When I type the given command :

$ sudo /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-generic linux-headers-5.13.0-051300-generic
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    linux-headers-generic linux-headers-5.13.0-051300-generic

There were problems setting up VirtualBox. To re-start the set-up process, run /sbin/vboxconfig as root. If your system is using EFI Secure Boot you may need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.

The weird thing is that when I try to install the package, I have the following result :

$ sudo apt-get install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-headers-5.13.0-051300-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers-5.13.0-051300-generic' has no installation candidate

$ apt list | grep linux-headers-5.13

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

linux-headers-5.13.0-051300/now 5.13.0-051300.202106272333 all [installed,local]

I get that there are 2 problems there :

  1. Missing linux headers
  2. Kernel modules are no signed

Are these 2 problems linked ? Any idea why I can not found the required linux-headers and how to find them ?

What I tried :

  • Reinstall virtualbox using command line
$ sudo apt install virtualbox 
$ sudo apt install --reinstall virtualbox-dkms && sudo apt install libelf-dev

PS : I do not wish to deactivate Secure Boot

Thanks for your help

zx485
  • 2,337
Infinite Learner
  • 211
  • 1
  • 2
  • 3

9 Answers9

12

I encountered the exact same problem in my own setup today and got it fixed.

  • Host OS: Ubuntu 20.04 with Secure Boot
  • Kernel: 5.10.0-1034-oem
  • Virtualbox version: 6.1.22 r144080 (Qt5.12.8)

As it has been mentioned from this blog, the error is related to unsigned Virtualbox modules that do not work in Linux host with Secure Boot enabled.

After reading the blog, I found that it is basically creating RSA key pair and then signed the kernel. I believe I have done this after I installed my Ubuntu host system. So I skipped the steps and tried to verify if unsigned Virtualbox modules were the issue by using the below command under root privilege:

root@ubuntu:~# modinfo -n vboxdrv
modinfo: ERROR: Module vboxdrv not found.

After googled the error above, I found another helpful answer from StackExchange, which shows how to install the modules:

apt install virtualbox-ext-pack

Then I tried to re-configure the module but found that a few build utils were missing:

root@ubuntu:~# /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.
This system is currently not set up to build kernel modules.
Please install the gcc make perl packages from your distribution.

There were problems setting up VirtualBox. To re-start the set-up process, run /sbin/vboxconfig as root. If your system is using EFI Secure Boot you may need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.

Then I tried to install them and re-ran it:

root@ubuntu:~# apt install gcc make perl
root@ubuntu:~# /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
root@derrick-XPS:~# modinfo -n vboxdrv
/lib/modules/5.10.0-1034-oem/misc/vboxdrv.ko

Finally, I am able to install Windows 10 on the Ubuntu host with no issues.

Hope this helps. If not, please refer to this blog to create RSA key pair first.

dq482
  • 121
2

I use Ubuntu 22.

When I run sudo /sbin/vboxconfig, it give an error that .. vboxdrv.sh: failed: Look at /var/log/vbox-setup.log to find out what went wrong. ..

I examined log file with cat /var/log/vbox-setup.log. I saw the error /bin/sh: 1: gcc-12: not found ...

I installed gcc-12 with sudo apt install gcc-12

Then, I ran sudo /sbin/vboxconfig command again.

If your problem is still not resolved, Uninstall virtual box and reinstall it

Eyup
  • 31
1

i install virtualbox get same issues. But i will fixed this isssues

1.first remove virtualbox

sudo dpkg --purge --force-all virtualbox-(version)
  1. Then again Install virtualbox

    sudo apt install virtualbox

0

I ran into the exact same issue (2023) and found a solution that worked. It can be as simple as installing the proper VirtualBox version. If you did 'sudo install virtualbox' thinking that would (intuitively) be right, it can be wrong. Let me show you.

Check the kernel version:

uname -r

The output will display the kernel version with an 'extension'. Remember that extension. Eg.:

6.5.5-258.lts

or

6.5.5-258.current

Now look at what you can find in terms of 'virtualbox':

user@group ~ $ sudo [your package manager] search virtualbox

minikube-dbginfo - Debug symbols for minikube minikube - Kubernetes development environment virtualbox - VirtualBox host modules for the linux-lts kernel virtualbox-common - Common components for VirtualBox host packages virtualbox-guest-common - Common components for the VirtualBox guest packages virtualbox-guest - VirtualBox guest additions for the linux-lts kernel virtualbox-dbginfo - Debug symbols for virtualbox virtualbox-devel - Development components for VirtualBox virtualbox-current - VirtualBox host modules for the linux-current kernel

Since you want to install VirtualBox, you may jump ahead and choose to install 'virtualbox'; however, this will install the '.lts' version. Choose the virtualbox package that matches your kernel extension. Eg.: If the 'uname -r' command resulted in something 'x.x.x-xxx.current', then:

sudo [your package manager] install virtualbox-current

Fixed it for me.

0
lsb_release -a
Description:    Ubuntu 23.10

so

sudo dpkg --purge --force-all virtualbox-6.1
sudo apt install virtualbox

were installed:

dkms libgsoap-2.8.124 liblzf1 libvncserver1 virtualbox-dkms virtualbox-qt

Fixed it for me

0

I had the same problem with virtualbox, I managed to solve it by installing the kernel modules: apt install linux-headers-6.1.0-18-amd64

After they were installed, I configured virtualbox again: /sbin/vboxconfig If there was no error, it will work.

0
  • Install Linux Kernel Headers: sudo apt-get install linux-headers-$(uname -r)
  • Reconfigure VirtualBox: sudo /sbin/vboxconfig
  • Start virtualbox again
Toto
  • 19,304
0

In my case (Debian OS, with no need for "Secure Boot") with the very same error, I only had to go back to the BIOS configuration menu and both enable "virtualization technology" and disable "Secure Boot".

Bare in mind that the virtualbox-dkms package is only available in Debian sid nowadays.

Olivier
  • 125
0

Same error code here. When I started virtualbox from commandline I got this message:

WARNING: The character device /dev/vboxdrv does not exist. Please install the virtualbox-dkms package and the appropriate headers, most likely linux-headers-generic. You will not be able to start VMs until this problem is fixed.

To fix the error, simply:

sudo apt install --reinstall virtualbox-dkms
Oll
  • 103