Score:0

Problem getting the right linux headers to run VirtualBox/Vagrant

us flag

I am on Ubuntu:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal

Kernel version:

uname -r
5.13.0-23-generic

The issue is I am trying to run Vagrant (vagrant up) and get the following output:

The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The reason
is shown below:
 
 VirtualBox is complaining that the kernel module is not loaded. Please
run `VBoxManage --version` or open the VirtualBox GUI to see the error
message which should contain instructions on how to fix this error.

So, when I run VBoxManage --version I get:

WARNING: The vboxdrv kernel module is not loaded. Either there is no
 module
        available for the current kernel (5.13.0-23-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.
 6.0.24r139119

When I run sudo /sbin/vboxconfigre I get:

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

So basically, I end up with a suggestion of running the same command (/sbin/vboxconfig).

UPDATE: As requested, here is the output for command dpkg -l | grep virtualbox

ii  virtualbox-6.0                                  6.0.24-139119~Ubuntu~eoan                                                       amd64        Oracle VM VirtualBox

So since the Linux headers seem to be the issue, I tried to download the headers like so:

sudo apt install linux-headers-$(uname -r)

And I get this:

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.
 linux-headers-5.13.0-23-generic : Depends: libc6 (>= 2.34) but 2.31-0ubuntu9.2 is to be installed
E: Unable to correct problems, you have held broken packages.

So, I had a look, and it turns out that for my version Linux version, I should be running headers with version: 5.4.0.91.95 or so

but instead I am running linux-headers-5.13.0-23-generic which apparently are the headers for the Linux version 21.10 (Impish Indri) as it can be seen in this link:

https://pkgs.org/download/linux-headers-generic

So, somehow I am running headers for version 21.10 which is not compatible with libc6 of my actual Linux version 20.04.

I tried to update the libc6, but Ubuntu warned me that many things could go wrong by doing that so I did not proceed with that.

I am relatively new to Linux so apologies if am saying no sense stuff.

All I want to do is get Vagrant running, but it looks like to get that I first need to get a lot of other stuff sorted out. Thank you all!

nobody avatar
gh flag
It seems this kernel is from proposed repository. `dpkg -l | grep virtualbox` please [edit] your question to show us the result.
us flag
@nobody I have updated my question with the output of your command. Thanks
N0rbert avatar
zw flag
Does this answer your question? [How do I restore the default repositories?](https://askubuntu.com/questions/124017/how-do-i-restore-the-default-repositories)
Score:0
gh flag

I get a try. You have focal-proposed enabled. Bad Idea.

Please try this solution to revert packages to normal sources. Pay attention you have to change precise of curse to focal in the file for apt pinning.

us flag
Hi nobody, thanks for the help I have followed the steps in the link that you sent me. It all went good for that task. After I Completed that, rebooted, then tried to run vagrant again, it was still complaining with the same output, and it asked to to run VBoxManage --version to have more details. The output is the same So I attempted to download again the headers with commnad: sudo apt install linux-headers-$(uname -r) And now I get this:
us flag
Reading package lists... Done Building dependency tree Reading state information... Done Package linux-headers-5.13.0-23-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-23-generic' has no installation candidate Any ideas what to do next? Thanks
nobody avatar
gh flag
Oh do you have another kernel on your system? ( if not you can install it with `sudo apt install linux-generic`)Please boot up them up and remove this kernel tree I forgot it is only available in focal-proposed. But before you remove this kernel tree show `dkms status` please.
us flag
Hi @nobody I am sorry I did not get back to you earlier. I was on annual leave and can only access this system from my workplace. Please see below the output from `dkms status`
us flag
`nvidia, 460.91.03, 5.11.0-38-generic, x86_64: installed nvidia, 460.91.03, 5.4.0-26-generic, x86_64: installed nvidia, 460.91.03, 5.4.0-84-generic, x86_64: installed nvidia, 460.91.03, 5.4.0-86-generic, x86_64: installed nvidia, 460.91.03, 5.4.0-88-generic, x86_64: installed nvidia, 460.91.03, 5.4.0-89-generic, x86_64: installed nvidia, 460.91.03, 5.4.0-90-generic, x86_64: installed nvidia, 460.91.03, 5.4.0-91-generic, x86_64: installed nvidia, 460.91.03, 5.4.0-92-generic, x86_64: installed nvidia, 460.91.03, 5.4.0-94-generic, x86_64: installed` Thanks for your patience and help
nobody avatar
gh flag
filter installed kernel related packages with `dpkg -l | egrep linux-'[g|i|m|h]'` and remove any package wich points to kernel tree 5.13 or 5.11 . If apt is not working use `sudo dpkg -P packagename1 packagename2 a.s.o.` check with `dpkg -l | egrep -v ''^ii|rc''` if packages are in unclean state. `sudo dpkg --configure -a` Your virtualbox version is old. remove it and install afterwards with `sudo apt install virtualbox` focal version.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.