Yesterday I received a kernel upgrade and after reboot, VirtualBox stopped working.
Here is my system info (after kernel upgrade):
matteo@workstation:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
matteo@workstation:~$ uname -a
Linux workstation 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
I installed VirtualBox long ago with
sudo apt install linux-headers-$(uname -r)
sudo apt install virtualbox-dkms virtualbox virtualbox-qt
used on daily basis and never had problems with kernel updates. The error I receive now is
matteo@workstation:~$ sudo modprobe vboxdrv
modprobe: ERROR: could not insert 'vboxdrv': Exec format error
matteo@workstation:~$ dmesg | tail -n 1
[ 1413.167311] vboxdrv: version magic '4.4.0-116-generic SMP mod_unload modversions ' should be '4.4.0-116-generic SMP mod_unload modversions retpoline '
I found a forum post with this error message here from three days ago, unfortunately without resolution. Therfore I tried to remove the VirtualBox packeges from the Ubuntu repo, and install the latest 5.2 using this procedure. However, even after rebooting the machine, the error remains.
What can I do in this case?
Best Answer
I was facing the same problem. After kernel upgrade my gcc version was showing as 5.4.1. Downgrading this version to 5.4.0 helped me to have retpoline for vboxdrv kernel module.
Following steps from this link helped me solve my issue:
After these steps gcc --version should be (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Then purge all the new linux headers (4.4.0-116)
Again install them
Then re-install virtualbox, I installed latest virtualbox-5.2 this time, but default 5.0 version of virtualbox should also work fine.
And, we have retpoline support in latest module