Kernel updates break VirtualBox
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/
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.
Please report this proablem upstream (kernel devs).