Kernel updates break VirtualBox

Bug #1811157 reported by Michael von Glasow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu MATE
Invalid
Undecided
Unassigned

Bug Description

After every kernel update, VirtualBox stops working, i.e. VMs will no longer launch. The following commands will fix it:

sudo apt-get --reinstall install virtualbox-dkms
sudo modprobe vboxdrv
sudo modprobe vboxnetflt

(If the last two are omitted, VirtualBox will work again after the next reboot.)

The underlying issue is that virtualbox-dkms contains kernel modules, which are built against the running kernel at install time. This process needs to be repeated if the kernel is updated, but that does not happen automatically.

This is likely an issue with every package which installs kernel modules, thus I am surprised that there is no standard procedure for handling this situation (or it has not been implemented here).

Potential fixes:
1. Whenever a new kernel is installed, trigger a rebuild of virtualbox-dkms against the new kernel. (Not sure if there is a mechanism to do that—query all installed kernel modules, determine their packages and reinstall/reconfigure them?)
2. With every package that installs kernel modules, include a script that runs on startup and checks if modules for the current kernel are present. If not, rebuild them. Minor drawback: the first boot after a kernel upgrade will take longer.

Revision history for this message
APolihron (apolitech) wrote :

Please report this proablem upstream (kernel devs).

Changed in ubuntu-mate:
status: New → Invalid
Revision history for this message
Michael von Glasow (michael-vonglasow) wrote :

This is not an issue with the kernel itself, but with the update process. Presumably this needs to be solved by changing the way the kernel is packaged, without touching the kernel itself.

I just ran into this issue again. It appears to affect all DKMS modules (I am also running anbox, installed from a third-party repo, and it is also affected). I was able to solve this by running `sudo apt-get --reinstall install` for all my DKMS modules after a kernel upgrade, but before rebooting. This reinstalls a module for every kernel on the machine, i.e. the old and the new one.

The way to fix this is probably the following:

* After installing a new kernel, gather a list of all DKMS modules which were installed via deb packages.
* Then run `sudo apt-get --reinstall install` for the DKMS module packages.

The only difficulty might be to determine a list of DKMS module packages currently on the machine. If there is no other way, a solution might be to require all DKMS module packages to add their name to a text config file, and pull the list of modules to reinstall from that file.

Would that kind of packaging-only change be taken care of by the kernel devs? If so, where can I reach them? If not, who maintains the deb package spec for the kernel?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.