VirtualBox not working in Ubuntu 22.04 after upgrading to Kernel 6.5.0-14
My situation is similar to this thread https://ubuntuforums.org/showthread.php?t=2055886
I have upgraded to Kernel 6.5.0-14 from the 6.1 series kernel and now Virtualbox stops working and requests that I load or recompile the Virtualbox kernel driver.
I ran
then
It seems maybe there is no Virtualbox dkms package for the 6.5 series kernel as it looks like apt is pulling the 6.1 package for dkms. Anyway to solve this?
USER@HOSTNAME:~/Downloads$ sudo apt-get install virtualbox-source virtualbox virtualbox-dkms
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libroar2 libwmf0.2-7
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
virtualbox-qt
Suggested packages:
vde2 virtualbox-guest-additions-iso
The following NEW packages will be installed:
virtualbox virtualbox-dkms virtualbox-qt virtualbox-source
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/46.9 MB of archives.
After this operation, 178 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Selecting previously unselected package virtualbox-dkms.
(Reading database ... 260275 files and directories currently installed.)
Preparing to unpack .../virtualbox-dkms_6.1.38-dfsg-3~ubuntu1.22.04.1_amd64.deb ...
Unpacking virtualbox-dkms (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Selecting previously unselected package virtualbox-source.
Preparing to unpack .../virtualbox-source_6.1.38-dfsg-3~ubuntu1.22.04.1_amd64.deb ...
Unpacking virtualbox-source (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Selecting previously unselected package virtualbox.
Preparing to unpack .../virtualbox_6.1.38-dfsg-3~ubuntu1.22.04.1_amd64.deb ...
Unpacking virtualbox (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Selecting previously unselected package virtualbox-qt.
Preparing to unpack .../virtualbox-qt_6.1.38-dfsg-3~ubuntu1.22.04.1_amd64.deb ...
Unpacking virtualbox-qt (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Setting up virtualbox-source (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Setting up virtualbox (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Job for virtualbox.service failed because the control process exited with error code.
See "systemctl status virtualbox.service" and "journalctl -xeu virtualbox.service" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
× virtualbox.service - LSB: VirtualBox Linux kernel module
Loaded: loaded (/etc/init.d/virtualbox; generated)
Active: failed (Result: exit-code) since Sat 2024-01-13 14:08:00 EST; 3ms ago
Docs: man:systemd-sysv-generator(8)
Process: 476217 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)
CPU: 23ms
Jan 13 14:08:00 HOSTNAME systemd[1]: Starting LSB: VirtualBox Linux kernel module...
Jan 13 14:08:00 HOSTNAME virtualbox[476217]: * Loading VirtualBox kernel modules...
Jan 13 14:08:00 HOSTNAME virtualbox[476217]: * No suitable module for running kernel found
Jan 13 14:08:00 HOSTNAME virtualbox[476217]: ...fail!
Jan 13 14:08:00 HOSTNAME systemd[1]: virtualbox.service: Control process exited, code=exited, status=1/FAILURE
Jan 13 14:08:00 HOSTNAME systemd[1]: virtualbox.service: Failed with result 'exit-code'.
Jan 13 14:08:00 HOSTNAME systemd[1]: Failed to start LSB: VirtualBox Linux kernel module.
Setting up virtualbox-dkms (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Loading new virtualbox-6.1.38 DKMS files...
Building for 6.5.0-14-generic
Building initial module for 6.5.0-14-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash'
Error! Bad return status for module build on kernel: 6.5.0-14-generic (x86_64)
Consult /var/lib/dkms/virtualbox/6.1.38/build/make.log for more information.
dpkg: error processing package virtualbox-dkms (--configure):
installed virtualbox-dkms package post-installation script subprocess returned error exit status 10
Setting up virtualbox-qt (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for shared-mime-info (2.1-2) ...
Errors were encountered while processing:
virtualbox-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)
My situation is similar to this thread https://ubuntuforums.org/showthread.php?t=2055886
I have upgraded to Kernel 6.5.0-14 from the 6.1 series kernel and now Virtualbox stops working and requests that I load or recompile the Virtualbox kernel driver.
I ran
Code:
apt-get remove virtualbox virtualbox-dkms virtualbox-source
Code:
apt-get install virtualbox virtualbox-dkms virtualbox-source
Quote:
USER@HOSTNAME:~/Downloads$ sudo apt-get install virtualbox-source virtualbox virtualbox-dkms
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libroar2 libwmf0.2-7
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
virtualbox-qt
Suggested packages:
vde2 virtualbox-guest-additions-iso
The following NEW packages will be installed:
virtualbox virtualbox-dkms virtualbox-qt virtualbox-source
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/46.9 MB of archives.
After this operation, 178 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Selecting previously unselected package virtualbox-dkms.
(Reading database ... 260275 files and directories currently installed.)
Preparing to unpack .../virtualbox-dkms_6.1.38-dfsg-3~ubuntu1.22.04.1_amd64.deb ...
Unpacking virtualbox-dkms (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Selecting previously unselected package virtualbox-source.
Preparing to unpack .../virtualbox-source_6.1.38-dfsg-3~ubuntu1.22.04.1_amd64.deb ...
Unpacking virtualbox-source (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Selecting previously unselected package virtualbox.
Preparing to unpack .../virtualbox_6.1.38-dfsg-3~ubuntu1.22.04.1_amd64.deb ...
Unpacking virtualbox (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Selecting previously unselected package virtualbox-qt.
Preparing to unpack .../virtualbox-qt_6.1.38-dfsg-3~ubuntu1.22.04.1_amd64.deb ...
Unpacking virtualbox-qt (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Setting up virtualbox-source (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Setting up virtualbox (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Job for virtualbox.service failed because the control process exited with error code.
See "systemctl status virtualbox.service" and "journalctl -xeu virtualbox.service" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
× virtualbox.service - LSB: VirtualBox Linux kernel module
Loaded: loaded (/etc/init.d/virtualbox; generated)
Active: failed (Result: exit-code) since Sat 2024-01-13 14:08:00 EST; 3ms ago
Docs: man:systemd-sysv-generator(8)
Process: 476217 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)
CPU: 23ms
Jan 13 14:08:00 HOSTNAME systemd[1]: Starting LSB: VirtualBox Linux kernel module...
Jan 13 14:08:00 HOSTNAME virtualbox[476217]: * Loading VirtualBox kernel modules...
Jan 13 14:08:00 HOSTNAME virtualbox[476217]: * No suitable module for running kernel found
Jan 13 14:08:00 HOSTNAME virtualbox[476217]: ...fail!
Jan 13 14:08:00 HOSTNAME systemd[1]: virtualbox.service: Control process exited, code=exited, status=1/FAILURE
Jan 13 14:08:00 HOSTNAME systemd[1]: virtualbox.service: Failed with result 'exit-code'.
Jan 13 14:08:00 HOSTNAME systemd[1]: Failed to start LSB: VirtualBox Linux kernel module.
Setting up virtualbox-dkms (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Loading new virtualbox-6.1.38 DKMS files...
Building for 6.5.0-14-generic
Building initial module for 6.5.0-14-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/virtualbox-dkms.0.crash'
Error! Bad return status for module build on kernel: 6.5.0-14-generic (x86_64)
Consult /var/lib/dkms/virtualbox/6.1.38/build/make.log for more information.
dpkg: error processing package virtualbox-dkms (--configure):
installed virtualbox-dkms package post-installation script subprocess returned error exit status 10
Setting up virtualbox-qt (6.1.38-dfsg-3~ubuntu1.22.04.1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for shared-mime-info (2.1-2) ...
Errors were encountered while processing:
virtualbox-dkms
E: Sub-process /usr/bin/dpkg returned an error code (1)