Sunday, February 18, 2024

VirtualBox not working in Ubuntu 22.04 with Linux Kernel after 6.2 (FIXED)

OS: Ubuntu (Host) 

Hypervisor: VirtualBox (7.0)

Since upgrading the Linux kernel header of Ubuntu 22.04 from 5.19 to 6.2 (and now 6.5), VirtualBox suddenly stopped working. As an employee in a local government agency, I have to be able to use Windows guest OS to use Microsoft 365 on my personal computer (which runs Ubuntu Desktop). In addition, I use VirtualBox to run Kali Linux and Ubuntu Server VMs. The break forced me to use earlier Linux headers (5.19) to allow me to run VirtualBox VMs. 

Recently, I installed qemu to try to run VMs in the updated Linux kernel header. This hypervisor seemed fast and I was able to run Kali Linux and Windows 10 VMs easily. However, when I tried to install a VM for learning vulnerability scanning, the format of .vmdx is not easily accessible to qemu. I tried a lot of how-tos, to no avail. This forced me to go back to VirtualBox, which required me to run in the dated Linux kernel header.

Based on the last post (dated January 18) here, I though I would follow the logic. So I followed this: 

I tried to run virtualbox from the terminal (virtualbox), which gave me the same error:

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.

I tried the suggested command "sudo /sbin/vboxconfig". The machine gave me the same error, with additional line that if my system is using EFI Secure Boot, I may need to sign the kernel modules. That really sounded complicated. Also, I know my system does not use EFI Secure Boot. 

I followed the guide to read the error log. Based on the error log, I saw that I could follow the logic to install gcc-12, so I did with: 

sudo apt install gcc-12

Then I installed build-essentials: 

sudo apt install build-essentials 

Then I tried again 

sudo /sbin/vboxconfig 

The Virtual Box services were restarted. 

I tried to run the VM from VirtualBox GUI: They worked!

No comments:

Post a Comment

VirtualBox not working in Ubuntu 22.04 with Linux Kernel after 6.2 (FIXED)

OS: Ubuntu (Host)  Hypervisor: VirtualBox (7.0) Since upgrading the Linux kernel header of Ubuntu 22.04 from 5.19 to 6.2 (and now 6.5), Virt...