0

i recently installed virtualbox (after fixing a dpkg error) and am now getting an error message every time i boot it;

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

and

~The virtual machine 'Kali-Linux-2020.1-vbox-amd64' 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}
~

i have tried everything here https://superuser.com/questions/1438279/how-to-sign-a-kernel-module-ubuntu-18-04 but it has no affect. when i run this command 

~apt install virtualbox-dkms~ i get ~Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 virtualbox-dkms : Depends: dkms (>= 2.1.0.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.~

ive tried manually installing dkms and it just leads down a rabbit hole. i am of course signed in as root here. im very new to this so im sorry if i dont quite understand things th first time around. your help is much appreciated!

6
  • You haven't given any OS/release details, however I see reference to kali which is neither Ubuntu, nor official flavor of Ubuntu thus off-topic. askubuntu.com/help/on-topic. In my experience just use default virtualbox (6.1.2 for my release) and you avoid all issues... (dkms in all supported releases matches the requirement in your message)
    – guiverc
    Feb 2, 2020 at 7:46
  • im on ubuntu 18.04 (i just edited it to specify) and am trying to run kali off of virtualbox however im getting virtualbox errors on ubuntu.
    – oregone1
    Feb 2, 2020 at 7:54
  • Disable Secure Boot in BIOS.
    – Pilot6
    Feb 2, 2020 at 7:56
  • The primary error I see is "you have held broken packages" which is usually referring to prior commands executed that had problems that you didn't then fix, and need to fix first (esp. if you use "-y" on installs). Have you tried sudo apt -f install, as that may fix it (a great chance), however even if it cannot; it'll provide clues on what the issue is and how to fix it in it's messages.
    – guiverc
    Feb 2, 2020 at 7:57
  • +guiverc it gives me this virtualbox-dkms : Depends: dkms (>= 2.1.0.0) but it is not going to be installed and also another 'you may have held broken packages' error
    – oregone1
    Feb 2, 2020 at 8:04

1 Answer 1

0

I had a similar issue and I'm guessing it is the same root cause for you since we are both on 18.04 Bionic; however I'm using mainline kernel 5.4.21, I don't believe you mentioned what kernel you're using.

My root cause was that 18.04 Bionic defaults gcc to gcc-7 and the latest VBox 6.1 when run with kernels 5.4.x and 5.5.x requires gcc-8 or higher. So when /sbin/vboxconfig is run (whether in a script or manually) it is using the default gcc-7 which fails to include a header in building some of the binaries.

I already had gcc-8 and actually thought I was already using it. However when I ran gcc --version it showed 7.4.0.

I forced gcc-8 as the default using sudo update-alternatives --config gccthen chose gcc-8. Then I ran sudo /sbin/vboxconfig. No errors Then ran VBox and voila! All working again!

So Steps [I don't know what you have so listing here assuming you haven't got most of it, but keeping it high level so you can have fun figuring out the syntax :) ]

  1. Shutdown vbox
  2. install update-alternatives
  3. install gcc-8
  4. setup gcc with update-alternatives and force gcc-8 as default
  5. run /sbin/vboxconfig
  6. run VBox 6.1

You must log in to answer this question.

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