virtualbox broken after last upgrade

Asked by Luc Saffre

I use virtualbox to run a venerable legacy accounting software under Windows XP from within my Ubuntu system (22.4) . Works like a charm. But after the latest system upgrade (or at least I cannot see any other reason) it was broken. When I try to launch the VM, it says "Kernel driver not installed (rc=-1908) (...) Please reinstall virtualbox-dkms package ...

I tried to reinstall all the virtualbox packages, also to remove them and purge them.

I think that the most relevant error message is the following:

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
dpkg: dependency problems prevent configuration of virtualbox:
 virtualbox depends on virtualbox-dkms (>= 6.1.38-dfsg-3~ubuntu1.22.04.1) | virtualbox-source (>= 6.1.38-dfsg-3~ubuntu1.22.04.1) | virtualbox-modules; however:
  Package virtualbox-dkms is not configured yet.
  Package virtualbox-source is not installed.
  Package virtualbox-modules is not installed.
  Package virtualbox-dkms which provides virtualbox-modules is not configured yet.
dpkg: error processing package virtualbox (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of virtualbox-qt:
 virtualbox-qt depends on virtualbox (= 6.1.38-dfsg-3~ubuntu1.22.04.1); however:
  Package virtualbox is not configured yet.
dpkg: error processing package virtualbox-qt (--configure):
 deNo apport report written because the error message indicates its a followup error from a previous failure.

System diagnostics:

$ dpkg -l | grep -i virtualb
iU virtualbox 6.1.38-dfsg-3~ubuntu1.22.04.1 amd64 x86 virtualization solution - base binaries
iF virtualbox-dkms 6.1.38-dfsg-3~ubuntu1.22.04.1 amd64 x86 virtualization solution - kernel module sources for dkms
rc virtualbox-guest-utils 6.1.38-dfsg-3~ubuntu1.22.04.1 amd64 x86 virtualization solution - non-X11 guest utilities
iU virtualbox-qt 6.1.38-dfsg-3~ubuntu1.22.04.1 amd64 x86 virtualization solution - Qt based user interface

$ uname -a
Linux yoga 6.5.0-14-generic #14~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 20 18:15:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

$ sudo dmesg | grep -i -e virtualb -e vbox
(no output)

$ find /lib/modules -iname vboxdrv.ko -ls
(no output)

More detailed reports on my blog https://luc.lino-framework.org/blog/2024/0111.html

I have no more ideas now. How can help me?

Luc

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Best Manfred Hampl (m-hampl) said :
#1

I assume that you are hit by an incompatibility between the version of virtualbox (6.1.38-dfsg-3~ubuntu1.22.04.1 from the Ubuntu repositories) and the new kernel version (6.5.0-14-generic).

What is the output of the command ls -l /boot ?

"Consult /var/lib/dkms/virtualbox/6.1.38/build/make.log for more information."

Revision history for this message
Luc Saffre (luc-saffre) said :
#2

Thanks, Manfred! Yes, that seems to be the explanation! I also have "too many arguments to function ‘get_user_pages" in my make.log file.

$ ls -l /boot
total 180916
-rw-r--r-- 1 root root 275553 nov 16 11:48 config-6.2.0-39-generic
-rw-r--r-- 1 root root 278940 nov 20 16:07 config-6.5.0-14-generic
drwx------ 3 root root 4096 jaan 1 1970 efi
drwxr-xr-x 5 root root 4096 jaan 11 07:07 grub
lrwxrwxrwx 1 root root 27 jaan 11 07:07 initrd.img -> initrd.img-6.5.0-14-generic
-rw-r--r-- 1 root root 69631325 jaan 11 07:17 initrd.img-6.2.0-39-generic
-rw-r--r-- 1 root root 70223917 jaan 11 07:17 initrd.img-6.5.0-14-generic
lrwxrwxrwx 1 root root 27 jaan 11 07:07 initrd.img.old -> initrd.img-6.2.0-39-generic
-rw-r--r-- 1 root root 182800 veebr 6 2022 memtest86+.bin
-rw-r--r-- 1 root root 184476 veebr 6 2022 memtest86+.elf
-rw-r--r-- 1 root root 184980 veebr 6 2022 memtest86+_multiboot.bin
-rw------- 1 root root 7972373 nov 16 11:48 System.map-6.2.0-39-generic
-rw------- 1 root root 8256525 nov 20 16:07 System.map-6.5.0-14-generic
lrwxrwxrwx 1 root root 24 jaan 11 07:07 vmlinuz -> vmlinuz-6.5.0-14-generic
-rw------- 1 root root 13796904 nov 16 11:50 vmlinuz-6.2.0-39-generic
-rw------- 1 root root 14228296 nov 20 16:12 vmlinuz-6.5.0-14-generic
lrwxrwxrwx 1 root root 24 jaan 11 07:07 vmlinuz.old -> vmlinuz-6.2.0-39-generic

Revision history for this message
Luc Saffre (luc-saffre) said :
#3

Thanks Manfred Hampl, that solved my question.

Revision history for this message
Kurai (kurai101) said :
#4

hey, i am experiencing the same issue, whats the solution?

Revision history for this message
Kurai (kurai101) said :
#5

Manfred Hampl, the output in the make.log file is as below..

`````````````````````````````
  CC [M] /var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/semevent-r0drv-linux.o
  CC [M] /var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/semeventmulti-r0drv-linux.o
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeLockUser’:
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1228:18: error: too many arguments to function ‘get_user_pages’
 1228 | rc = get_user_pages(R3Ptr, /* Where from. */
      | ^~~~~~~~~~~~~~
In file included from /var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/the-linux-kernel.h:102,
                 from /var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:31:
./include/linux/mm.h:2430:6: note: declared here
 2430 | long get_user_pages(unsigned long start, unsigned long nr_pages,
      | ^~~~~~~~~~~~~~
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1261:33: error: passing argument 6 of ‘get_user_pages_remote’ from incompatible pointer type [-Werror=incompatible-pointer-types]
 1261 | papVMAs /* vmas */
      | ^~~~~~~
      | |
      | struct vm_area_struct **
./include/linux/mm.h:2400:33: note: expected ‘int *’ but argument is of type ‘struct vm_area_struct **’
 2400 | int *locked);
      | ~~~~~^~~~~~
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1245:18: error: too many arguments to function ‘get_user_pages_remote’
 1245 | rc = get_user_pages_remote(
      | ^~~~~~~~~~~~~~~~~~~~~
./include/linux/mm.h:2397:6: note: declared here
 2397 | long get_user_pages_remote(struct mm_struct *mm,
      | ^~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1304:39: error: assignment of read-only member ‘vm_flags’
 1304 | papVMAs[rc]->vm_flags |= VM_DONTCOPY | VM_LOCKED;
      | ^~
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In function ‘rtR0MemObjNativeMapUser’:
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1774:35: error: assignment of read-only member ‘vm_flags’
 1774 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
      | ^~
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o: warning: objtool: VBoxHost_RTR0MemKernelCopyTo+0x13: redundant CLD
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o: warning: objtool: VBoxHost_RTR0MemKernelCopyFrom+0x13: redundant CLD
cc1: some warnings being treated as errors
  CC [M] /var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/semfastmutex-r0drv-linux.o
make[3]: *** [scripts/Makefile.build:251: /var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/SUPDrvTracer.o: warning: objtool: SUPR0TracerFireProbe+0x7: indirect jump found in RETPOLINE build
/var/lib/dkms/virtualbox/6.1.38/build/vboxdrv/SUPDrvTracer.o: warning: objtool: supdrvTracerProbeFireStub+0x0: 'naked' return found in RETHUNK build
make[2]: *** [scripts/Makefile.build:488: /var/lib/dkms/virtualbox/6.1.38/build/vboxdrv] Error 2
make[1]: *** [/usr/src/linux-headers-6.5.0-14-generic/Makefile:2037: /var/lib/dkms/virtualbox/6.1.38/build] Error 2
make: *** [Makefile:234: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.5.0-14-generic'

`````````````````````

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

There is already a bug report (linked above) and I hope that the developers are already working on a solution.

For a temporary workaround you can try booting into an older version of the kernel (e.g. Luc has still version 6.2.0-39-generic installed) and try running virtualbox there. (selection of an older kernel is done in the grub menu).

Revision history for this message
Kurai (kurai101) said :
#7

Alright thanks, i too share similar kernel version as the original poster. Really didn't want to downgrade but for now there is no other choice. Thanks alot for the solution, Manfred Hampl.

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

Another possible workaround is installing an updated version of virtualbox, e.g. from a PPA.
A potential candidate might be ppa:costamagnagianfranco/virtualbox-ppa

Revision history for this message
Luc Saffre (luc-saffre) said :
#9

They fixed the bug (https://bugs.launchpad.net/bugs/2048956) and I just had to say "apt reinstall virtualbox". Great! Thanks!