virtual box fails kernel 5.0.0-21-generic

Asked by tomdean on 2019-07-30

After a system upgrade to kernel 5.0.0-21-generic, virtual box fails to start. The problem seems to be related to the kernel 5.0.0-21-generic release. virtualbox works if I boot the 4.18.0-25-generic kernel.

Google returned way too many answers, but, most seemed to be around reinstall, etc. So, I used apt install --reinstall, etc. I tried removing and purging all of virtual box and reinstalling. Failed.

> sudo apt-get install --reinstall build-essential linux-headers-`uname -r` dkms virtualbox-dkms

============== From /var/log/apt/term.log =======================================================
Unpacking virtualbox-dkms (5.2.18-dfsg-2~ubuntu18.04.5) over (5.2.18-dfsg-2~ubuntu18.04.5) ...
Setting up linux-headers-5.0.0-21-generic (5.0.0-21.22+system76) ...
/etc/kernel/header_postinst.d/dkms:
 * dkms: running auto installation service for kernel 5.0.0-21-generic
   ...done.
Setting up build-essential (12.4ubuntu1) ...
Setting up dkms (2.3-3ubuntu9.4) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up virtualbox-dkms (5.2.18-dfsg-2~ubuntu18.04.5) ...
Loading new virtualbox-5.2.18 DKMS files...
Building for 5.0.0-21-generic
Building initial module for 5.0.0-21-generic
ERROR (dkms apport): kernel package linux-headers-5.0.0-21-generic is not supported
Error! Bad return status for module build on kernel: 5.0.0-21-generic (x86_64)
Consult /var/lib/dkms/virtualbox/5.2.18/build/make.log for more information.
Job for virtualbox.service failed because the control process exited with error code.
See "systemctl status virtualbox.service" and "journalctl -xe" 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 Mon 2019-07-29 19:11:17 PDT; 4ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 5382 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)

Jul 29 19:11:17 Meerkat systemd[1]: Starting LSB: VirtualBox Linux kernel module...
Jul 29 19:11:17 Meerkat virtualbox[5382]: * Loading VirtualBox kernel modules...
Jul 29 19:11:17 Meerkat virtualbox[5382]: * No suitable module for running kernel found
Jul 29 19:11:17 Meerkat virtualbox[5382]: ...fail!
Jul 29 19:11:17 Meerkat systemd[1]: virtualbox.service: Control process exited, code=exited status=1
Jul 29 19:11:17 Meerkat systemd[1]: virtualbox.service: Failed with result 'exit-code'.
Jul 29 19:11:17 Meerkat systemd[1]: Failed to start LSB: VirtualBox Linux kernel module.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
2019-07-30
Last query:
2019-07-30
Last reply:
2019-07-30

Is Ubuntu installed in a VirtualBox VM?

Thanks

tomdean (tomdean) said : #2

On 7/29/19 7:42 PM, actionparsnip wrote:
> Your question #682420 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/682420
>
> Status: Open => Needs information
>
> actionparsnip requested more information:
> Is Ubuntu installed in a VirtualBox VM?
>
> Thanks
>

No, Windows 10 is installed in a VirtualBox VM. I boot Ubuntu 18.04 and
sometimes run virtualbox to access windows 10. About one time a month.

Did you look through
 /var/lib/dkms/virtualbox/5.2.18/build/make.log
For clues?

tomdean (tomdean) said : #4

On 7/29/19 8:17 PM, actionparsnip wrote:
> Your question #682420 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/682420
>
> Status: Open => Needs information
>
> actionparsnip requested more information:
> Did you look through
> /var/lib/dkms/virtualbox/5.2.18/build/make.log
> For clues?
>

There are errors in that log. I believe the same errors that are
reported from the higher level processes. Both are in
   memuserkernel-r0drv-linux.c
Strange looking messages. First, wrong number of arguments, then
undeclared...

Looks like a mismatch between virtualbox and the linux-headers. The
definition of access_ok changed between kernel 4.18.0-25-generic and
5.0.0.21-generic.

 > cat /var/lib/dkms/virtualbox/5.2.18/build/make.log
<snip>
/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-li
nux.c: In function ‘VBoxHost_RTR0MemUserIsValidAddr’:
/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-li
nux.c:69:55: error: macro "access_ok" passed 3 arguments, but takes just 2
      bool fRc = access_ok(VERIFY_READ, (void *)R3Ptr, 1);
                                                        ^
/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-li
nux.c:69:16: error: ‘access_ok’ undeclared (first use in this function)
      bool fRc = access_ok(VERIFY_READ, (void *)R3Ptr, 1);
                 ^~~~~~~~~
/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserkernel-r0drv-li
nux.c:69:16: note: each undeclared identifier is reported only once for
each fun
ction it appears in
scripts/Makefile.build:284: recipe for target
'/var/lib/dkms/virtualbox/5.2.18/b
uild/vboxdrv/r0drv/linux/memuserkernel-r0drv-linux.o' failed
make[2]: ***
[/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv/r0drv/linux/memuserk
ernel-r0drv-linux.o] Error 1
make[2]: *** Waiting for unfinished jobs....
scripts/Makefile.build:515: recipe for target
'/var/lib/dkms/virtualbox/5.2.18/b
uild/vboxdrv' failed
make[1]: *** [/var/lib/dkms/virtualbox/5.2.18/build/vboxdrv] Error 2
Makefile:1606: recipe for target
'_module_/var/lib/dkms/virtualbox/5.2.18/build'
  failed
make: *** [_module_/var/lib/dkms/virtualbox/5.2.18/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.0.0-21-generic'

Best Manfred Hampl (m-hampl) said : #5

What you see is a known problem: Ubuntu Bug #1835576 and virtualbox ticket https://www.virtualbox.org/ticket/18475

I assume that virtualbox version 5.2.32-dfsg-0~ubuntu18.04.1 (in bionic-proposed) solves the problem.
This newer version will probably be published in bionic-updates in a few days (see the bug report).

tomdean (tomdean) said : #6

Thanks Manfred Hampl, that solved my question.