7

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

12
  • You have tried to install virtualbox-dkms?
    – Ramhound
    Commented Jul 9, 2021 at 13:06
  • Have you for certain ensured that host BIOS is set for (that is, enabled) hardware virtualization and VT-d?
    – anon
    Commented Jul 9, 2021 at 13:11
  • @John I did enabled intel virtualization Commented Jul 10, 2021 at 20:07
  • @Ramhound Yes I did, sorry that I forgot to mention it Commented Jul 10, 2021 at 20:08
  • VT-d is virtualization technology. It was probably enabled with Hardware Virtualization, but if still not working then that is not the reason.
    – anon
    Commented Jul 10, 2021 at 20:09

7 Answers 7

9

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.

1
  • Installed VirtualBox via .deb, and install virtualbox-ext-pack (apt-get install virtualbox-ext-pack) solved the problem for me (Ubuntu 22.04.4 LTS) Commented Apr 29 at 0:33
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

1
  • The error I got in the log was warning: the compiler differs from the one used to build the kernel The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0. You solution worked. Downloading and installing VirtualBox 7.0.18 Oracle VM VirtualBox Extension Pack via GUI first, then installing GCC12, then sudo /sbin/vboxconfig, then modinfo -n vboxdrv worked for me.
    – igor
    Commented May 9 at 10:00
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.

1
  • MacOS users running macOS 10.11 or later may encounter this same error if SIP was disabled prior to installation of VirtualBox and was subsequently re-enabled due to a security update or migration to a new drive or computer. Disabling SIP from a recovery or install environment restores normal operation, as will a reinstallation of the installer .PKG with SIP enabled. Commented May 1 at 12:19
0

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
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

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Nov 10, 2023 at 11:35
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.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Apr 6 at 10:33
0
  • Install Linux Kernel Headers: sudo apt-get install linux-headers-$(uname -r)
  • Reconfigure VirtualBox: sudo /sbin/vboxconfig
  • Start virtualbox again

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .