2

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.

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,170
  • 11
  • 17
  • 24
Infinite Learner
  • 21
  • 1
  • 1
  • 2

1 Answers1

1

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.