[SOLVED] Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Questions about virtualization software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Linuxbeliever
Level 1
Level 1
Posts: 32
Joined: Wed Jan 14, 2015 7:21 pm

[SOLVED] Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by Linuxbeliever »

Hi! Everybody.

I try to run my VM's on the newest oracle virtualbox 7.0 with kenel 5.19.0-28-generic x86_64, on linux mint 21.1. I successfully installed oracle's virtualbox 7.0, but when I try to run my VM's, I get the error "Kernel driver not installed (rc=-1908)". Now, I know that is because I have secure boot enable and need to signed the keys for UEFI secure boot to load the drivers. I have not found a clean and standard way to do the MOK (Machine Owners Key), procedure on linux that I seen on google's searches, and some are incomplete or do not work, when I try oracles's virtualbox 7 and run a VM. And, there is no way to know what latest kernel will work with the latest oracle virtualbox. I also found this https://forums.virtualbox.org/viewtopic ... 7&t=107289 post from agaskew, about a comflict of gcc compiler versions and location, if this helps. So, can some one, give a clear and simple english steps to do the MOK procedure, and help me understand the post I found, please? I not an expert but I know a little more than a novice. :) I'm including his posting here, see below.
Re: VM not starting when using Linux kernel 6.0
by agaskew » 16. Nov 2022, 22:43
This isn't pretty, but it worked for me.
I had this error with VirtualBox 7 and Kernel 6.0.8 on Linux Mint:
7/9The VirtualBox Linux kernel driver is either not loaded or not set up correctly....etc
I reran 'sudo /sbin/vboxconfig' manually and it failed to build the kernel module. Checked
the log file /var/log/vbox-setup.log. The log file indicated syntax errors with the gcc
command, and at the top was a warning that the 6.0.8 kernel had been built with gcc version
12 whereas the system was still using gcc version 11.
Installed gcc-12 via 'sudo apt get gcc-12'
Deleted /usr/bin/gcc as its just a symlink to /usr/bin/gcc-11 and recreated it via 'sudo ln -s
/usr/bin/gcc-12 /usr/bin/gcc'. Checked the version of gcc being called is correct via 'gcc --
version' - result shows 'gcc (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0'
After that I moved /var/log/vbox-setup.log out of the way, reran 'sudo /sbin/vboxconfig' and
this time no errors were generated.
Finally my Guest VMs would run.
Rudolf-CZ wrote:
God bless you! This was exactly my issues a Virtualbox works flawlessly since then (Kernel
5.19.17 & Virtualbox 6.1.40). Just to add existing symlink could be directly changed by using
"-f" so using "sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc -f" so deleting is not required.
Last edited by LockBot on Mon Jul 31, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
RIH
Level 9
Level 9
Posts: 2864
Joined: Sat Aug 22, 2015 3:47 am

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by RIH »

Any reason that you must have the 5.19 kernel?
It all works fine on the 5.15 range with VirtualBox 7 & Mint 21.1.
Image
ringshellfish
Level 2
Level 2
Posts: 83
Joined: Wed Jan 04, 2023 8:25 pm

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by ringshellfish »

I also had the problem that I couldn't build the kernel module for a custom 6.1.* kernel with Virtualbox 7. Here is how I fixed it.

1. Make a timeshift snapshot
Just in case if something gets messed up.

2. Purge Virtualbox
Open a terminal window and run the command

Code: Select all

sudo apt-get purge virtualbox*
3. Search for Virtualbox kernel modules and delete them

Code: Select all

sudo updatedb
locate vboxdrv.ko
This will give you a list of paths where the vboxdrv.ko module is stored. Ignore the files found in /timeshift/ !
Now delete the virtualbox kernel modules, insert your paths you found with locate.

Code: Select all

sudo rm /usr/lib/modules/6.1.8/updates/dkms/vbox*.ko
The command should look like this, note that vbox*.ko is deleted!

4. Download and install Virtualbox 7
The last step, reinstall Virtualbox. Now it should install without problems.
Linuxbeliever
Level 1
Level 1
Posts: 32
Joined: Wed Jan 14, 2015 7:21 pm

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by Linuxbeliever »

RIH wrote: Tue Jan 31, 2023 12:39 am Any reason that you must have the 5.19 kernel?
It all works fine on the 5.15 range with VirtualBox 7 & Mint 21.1.
Hi! RIH, Thanks for the reply. My answer to you is, some people like to be updated with improvements and security fixes, that is the main reason.
ringshellfish wrote: Tue Jan 31, 2023 5:16 am I also had the problem that I couldn't build the kernel module for a custom 6.1.* kernel with Virtualbox 7. Here is how I fixed it.

1. Make a timeshift snapshot
Just in case if something gets messed up.

2. Purge Virtualbox
Open a terminal window and run the command

Code: Select all

sudo apt-get purge virtualbox*
3. Search for Virtualbox kernel modules and delete them

Code: Select all

sudo updatedb
locate vboxdrv.ko
This will give you a list of paths where the vboxdrv.ko module is stored. Ignore the files found in /timeshift/ !
Now delete the virtualbox kernel modules, insert your paths you found with locate.

Code: Select all

sudo rm /usr/lib/modules/6.1.8/updates/dkms/vbox*.ko
The command should look like this, note that vbox*.ko is deleted!

4. Download and install Virtualbox 7
The last step, reinstall Virtualbox. Now it should install without problems.
Hi! ringshellfish. Thanks for the reply. The main problem is running the virtual machines, virtualbox 7 installs fine. The error happens when I run the virtual machines in virtualbox 7 with kernel 5.19.

Any more ideas? Can some one help understand the posting that I found in my first post, in plain english please? Thanks for your time and help
ringshellfish
Level 2
Level 2
Posts: 83
Joined: Wed Jan 04, 2023 8:25 pm

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by ringshellfish »

Linuxbeliever wrote: Tue Jan 31, 2023 6:43 pm The main problem is running the virtual machines, virtualbox 7 installs fine. The error happens when I run the virtual machines in virtualbox 7 with kernel 5.19.
I'm aware of that. Your VM doesn't run because the kernel module couldn't be compiled. Had the same issue and this is how I fixed it, maybe it works for you too.
Linuxbeliever wrote: Tue Jan 31, 2023 6:43 pm Can some one help understand the posting that I found in my first post, in plain english please?
The post just says, install gcc12 and update the symlink.

Code: Select all

sudo apt get gcc-12
sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc -f
Which is plausible because the 5.19 kernel is compiled with gcc12.
Linuxbeliever
Level 1
Level 1
Posts: 32
Joined: Wed Jan 14, 2015 7:21 pm

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by Linuxbeliever »

ringshellfish wrote: Tue Jan 31, 2023 6:49 pm
Linuxbeliever wrote: Tue Jan 31, 2023 6:43 pm The main problem is running the virtual machines, virtualbox 7 installs fine. The error happens when I run the virtual machines in virtualbox 7 with kernel 5.19.
I'm aware of that. Your VM doesn't run because the kernel module couldn't be compiled. Had the same issue and this is how I fixed it, maybe it works for you too.
Linuxbeliever wrote: Tue Jan 31, 2023 6:43 pm Can some one help understand the posting that I found in my first post, in plain english please?
The post just says, install gcc12 and update the symlink.

Code: Select all

sudo apt get gcc-12
sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc -f
Which is plausible because the 5.19 kernel is compiled with gcc12.
Hi! ringshellfish

I tried your idea of purge virtualbox 7 and locating the kenel module driver vboxdrv.ko with locate command after updating it's database. Locate did not found vboxdrv.ko from the root ( / ) level.

In synaptic package manager, I’m showing 4 versions of gcc, including gcc-12, so I’ll assume it has the right compiler already. The only thing to do is the soft link to gcc-12 right? Do I need to uninstall the additional gcc versions?

Code: Select all

$ apt list --installed gcc*
Listing... Done
gcc-11-base/jammy-updates,jammy-security,now 11.3.0-1ubuntu1~22.04 amd64 [installed]
gcc-11/jammy-updates,jammy-security,now 11.3.0-1ubuntu1~22.04 amd64 [installed]
gcc-12-base/jammy-updates,jammy-security,now 12.1.0-2ubuntu1~22.04 amd64 [installed]
gcc/jammy,now 4:11.2.0-1ubuntu1 amd64 [installed]
$ 

Code: Select all

sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc -f, command right? 
And, if I need to undo it, I will need to change it to:

Code: Select all

sudo ln -s /usr/bin/gcc /usr/bin/gcc -f, command right?
Just double checking with you guys. Thanks for your time and help. Have a nice day. :)
ringshellfish
Level 2
Level 2
Posts: 83
Joined: Wed Jan 04, 2023 8:25 pm

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by ringshellfish »

Linuxbeliever wrote: Wed Feb 01, 2023 4:43 pm And, if I need to undo it
Before you change it find out where the target of the symlink is. ls /usr/bin/gcc -l
For me this looks like this

Code: Select all

lrwxrwxrwx 1 root root 6 Okt 11 17:33 /usr/bin/gcc -> gcc-11
It points to gcc-11, so to revert it after it is changed to gcc-12 you would do

Code: Select all

sudo ln -s /usr/bin/gcc-11 /usr/bin/gcc -f
Linuxbeliever
Level 1
Level 1
Posts: 32
Joined: Wed Jan 14, 2015 7:21 pm

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by Linuxbeliever »

ringshellfish wrote: Wed Feb 01, 2023 7:05 pm
Linuxbeliever wrote: Wed Feb 01, 2023 4:43 pm And, if I need to undo it
Before you change it find out where the target of the symlink is. ls /usr/bin/gcc -l
For me this looks like this

Code: Select all

lrwxrwxrwx 1 root root 6 Okt 11 17:33 /usr/bin/gcc -> gcc-11
It points to gcc-11, so to revert it after it is changed to gcc-12 you would do

Code: Select all

sudo ln -s /usr/bin/gcc-11 /usr/bin/gcc -f
Hi! ringshellfish

Yeap! is the same as me, see bellow for proof. Wish me luck! I'll try my best at it. Crossing fingers for good luck.

Code: Select all

maverick@TopGun:~$ ls /usr/bin/gcc -l
lrwxrwxrwx 1 root root 6 Aug  1  2022 /usr/bin/gcc -> gcc-11
maverick@TopGun:~$ 
Linuxbeliever
Level 1
Level 1
Posts: 32
Joined: Wed Jan 14, 2015 7:21 pm

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by Linuxbeliever »

Hi! Everybody

I reporting that, although the trick of changing the gcc version to the required gcc-12 for the kernel 5.19 does work, and vitualbox 7.0.6 does install without errors. But, when you try to signed the virtualbox drivers, like it says in

https://www.narenvadapalli.com/blog/vir ... oot-issue/

It gives me a lot of errors of vitualbox 7.0.6 still fails to build the drivers, somehow. See below for proof.

Code: Select all

root@TopGun:~# ls
module-signing  sign-vbox-modules
root@TopGun:~# sudo sign-vbox-modules
sudo: sign-vbox-modules: command not found
root@TopGun:~# sudo ./sign-vbox-modules
modinfo: ERROR: Module vboxdrv not found.
dirname: missing operand
Try 'dirname --help' for more information.
Signing /*.ko
At main.c:298:
- SSL error:FFFFFFFF80000002:system library::No such file or directory: ../crypto/bio/bss_file.c:67
- SSL error:10000080:BIO routines::no such file: ../crypto/bio/bss_file.c:75
sign-file: /*.ko: No such file or directory
root@TopGun:~# modprobe vboxdrv
modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/5.19.0-28-generic
root@TopGun:~# 

Any more ideas anyone? Thnaks for your time and help.
firestomper41
Level 1
Level 1
Posts: 40
Joined: Thu Jan 06, 2011 7:41 am

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by firestomper41 »

Linuxbeliever wrote: Tue Jan 31, 2023 12:20 am Hi! Everybody.

I try to run my VM's on the newest oracle virtualbox 7.0 with kenel 5.19.0-28-generic x86_64, on linux mint 21.1. I successfully installed oracle's virtualbox 7.0, but when I try to run my VM's, I get the error "Kernel driver not installed (rc=-1908)". Now, I know that is because I have secure boot enable and need to signed the keys for UEFI secure boot to load the drivers. I have not found a clean and standard way to do the MOK (Machine Owners Key), procedure on linux that I seen on google's searches, and some are incomplete or do not work, when I try oracles's virtualbox 7 and run a VM. And, there is no way to know what latest kernel will work with the latest oracle virtualbox. I also found this https://forums.virtualbox.org/viewtopic ... 7&t=107289 post from agaskew, about a comflict of gcc compiler versions and location, if this helps. So, can some one, give a clear and simple english steps to do the MOK procedure, and help me understand the post I found, please? I not an expert but I know a little more than a novice. :) I'm including his posting here, see below.
Re: VM not starting when using Linux kernel 6.0
by agaskew » 16. Nov 2022, 22:43
This isn't pretty, but it worked for me.
I had this error with VirtualBox 7 and Kernel 6.0.8 on Linux Mint:
7/9The VirtualBox Linux kernel driver is either not loaded or not set up correctly....etc
I reran 'sudo /sbin/vboxconfig' manually and it failed to build the kernel module. Checked
the log file /var/log/vbox-setup.log. The log file indicated syntax errors with the gcc
command, and at the top was a warning that the 6.0.8 kernel had been built with gcc version
12 whereas the system was still using gcc version 11.
Installed gcc-12 via 'sudo apt get gcc-12'
Deleted /usr/bin/gcc as its just a symlink to /usr/bin/gcc-11 and recreated it via 'sudo ln -s
/usr/bin/gcc-12 /usr/bin/gcc'. Checked the version of gcc being called is correct via 'gcc --
version' - result shows 'gcc (Ubuntu 12.1.0-2ubuntu1~22.04) 12.1.0'
After that I moved /var/log/vbox-setup.log out of the way, reran 'sudo /sbin/vboxconfig' and
this time no errors were generated.
Finally my Guest VMs would run.
Rudolf-CZ wrote:
God bless you! This was exactly my issues a Virtualbox works flawlessly since then (Kernel
5.19.17 & Virtualbox 6.1.40). Just to add existing symlink could be directly changed by using
"-f" so using "sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc -f" so deleting is not required.
Many thanks, this also sorted my virtualbox kernel issue out and now all working again!
Linuxbeliever
Level 1
Level 1
Posts: 32
Joined: Wed Jan 14, 2015 7:21 pm

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by Linuxbeliever »

Hi! Everyone

Anyone has anymore ideas? Mine is not working yet. I'll post my vbox-setup.log to review. And, anyone knows an easy step by step tutorial to do the MOK (Machine Owner Key) for signing and loading virtualbox drvers, please?

Otherwise, the last resort will be to follow an easy step by step install for KVM-QEMU. Anyone knows an easy step by step installation and use of it, please?

Thanks for your time and help. :)
vbox-setup.log
(3.2 KiB) Downloaded 22 times
RIH
Level 9
Level 9
Posts: 2864
Joined: Sat Aug 22, 2015 3:47 am

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by RIH »

You could try loading the latest 5.15 kernel & see if it works then.
It does for me..
Image
linuxovios
Level 3
Level 3
Posts: 132
Joined: Sun Jul 01, 2018 2:57 am

Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by linuxovios »

Linuxbeliever wrote: Sat Feb 04, 2023 9:51 pm Hi! Everyone

Anyone has anymore ideas? Mine is not working yet. I'll post my vbox-setup.log to review. And, anyone knows an easy step by step tutorial to do the MOK (Machine Owner Key) for signing and loading virtualbox drvers, please?

Otherwise, the last resort will be to follow an easy step by step install for KVM-QEMU. Anyone knows an easy step by step installation and use of it, please?

Thanks for your time and help. :)

vbox-setup.log
You haven't done the GCC trick. It seems that you are still using GCC 11.

From your log:
warning: the compiler differs from the one used to build the kernel
1) Install gcc 12

Code: Select all

sudo apt-get install gcc-12
2) then go here and right click (on empty space) and select "open as root"
bin_001.jpg
3) No you have a "gcc-12(copy)" link file. Rename it as "gcc"

4) Now open a terminal and type

Code: Select all

sudo /sbin/vboxconfig
And you are ready to go.
Linuxbeliever
Level 1
Level 1
Posts: 32
Joined: Wed Jan 14, 2015 7:21 pm

[FIXED] Re: Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by Linuxbeliever »

linuxovios wrote: Sun Feb 05, 2023 3:14 am
Linuxbeliever wrote: Sat Feb 04, 2023 9:51 pm Hi! Everyone

Anyone has anymore ideas? Mine is not working yet. I'll post my vbox-setup.log to review. And, anyone knows an easy step by step tutorial to do the MOK (Machine Owner Key) for signing and loading virtualbox drvers, please?

Otherwise, the last resort will be to follow an easy step by step install for KVM-QEMU. Anyone knows an easy step by step installation and use of it, please?

Thanks for your time and help. :)

vbox-setup.log
You haven't done the GCC trick. It seems that you are still using GCC 11.

From your log:
warning: the compiler differs from the one used to build the kernel
1) Install gcc 12

Code: Select all

sudo apt-get install gcc-12
2) then go here and right click (on empty space) and select "open as root"

bin_001.jpg

3) No you have a "gcc-12(copy)" link file. Rename it as "gcc"

4) Now open a terminal and type

Code: Select all

sudo /sbin/vboxconfig
And you are ready to go.
Hi! inuxovios

Thank you very much, it is fixed. YOU ARE AWESOME! Now I can run VM's. What I did, so others can follow:

STEP 1

Code: Select all

sudo apt-get install gcc-12
STE 2 in terminal execute

Code: Select all

sudo ln -s /usr/bin/gcc-12 /usr/bin/gcc -f
Or in file manager do, like linuxovios (Thanks again! linuxovios) says: in 2
then go here and right click (on empty space) and select "open as root"
Image

3) Now you have a "gcc-12(copy)" link file. Rename it as "gcc"

4) Open terminal and run:

Code: Select all

sudo /sbin/vboxconfig
That is all! Now run your VM's, they should work now. Thanks for every ones help and time. Have fun with VM's!
User avatar
xenopeek
Level 25
Level 25
Posts: 29595
Joined: Wed Jul 06, 2011 3:58 am

Re: [SOLVED] Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by xenopeek »

Yesterday the dkms package was updated (2.8.7-2ubuntu2.1mint1) which fixes this issue.
Image
Linuxbeliever
Level 1
Level 1
Posts: 32
Joined: Wed Jan 14, 2015 7:21 pm

Re: [SOLVED] Oracle virtualbox 7 not working on kernel 5.19 linux mint 21.1

Post by Linuxbeliever »

xenopeek wrote: Wed Feb 08, 2023 12:07 pm Yesterday the dkms package was updated (2.8.7-2ubuntu2.1mint1) which fixes this issue.
Thanks xenopeek for posting. I guess mint does not check gcc compatibility with latest kernel at time for upgrading to the latest Kernel, right? Thanks again for let us know, though. At least we know to check gcc compatibility with kernel first, before trying virtualbox. :?
Locked

Return to “Virtual Machines”