Virtualbox error after installing new linux kernel 4.4
Try to install g++/gcc version 5.3 and compile dkms with it
I'm using Ubuntu 14.04 and I was able to run virtual machine using the following advice
First try
sudo /usr/lib/virtualbox/vboxdrv.sh setup
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMSERROR (dkms apport): kernel package linux-headers-4.4.0-040400-generic is not supported
Error! Bad return status for module build on kernel: 4.4.0-040400-generic (x86_64)
Consult /var/lib/dkms/vboxhost/5.0.14/build/make.log for more information.
...failed!
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules ...failed!
(Look at /var/log/vbox-install.log to find out what went wrong)
add repository
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
install gcc/g++
sudo apt-get install gcc-5 g++-5
The next step is to add alternatives to gcc/g++ show installed versions
ls -lh /usr/bin/gcc*
and for each of them add alternative, mine are
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 20 --slave /usr/bin/g++ g++ /usr/bin/g++-5
last step is to select what to use
sudo update-alternatives --config gcc
and select 3 entry in my case
Now try to compile DKMS
sudo /usr/lib/virtualbox/vboxdrv.sh setup
Now it is successfully compiled
sudo /usr/lib/virtualbox/vboxdrv.sh setup
Stopping VirtualBox kernel modules ...done.
Uninstalling old VirtualBox DKMS kernel modules ...done.
Trying to register the VirtualBox kernel modules using DKMS ...done.
Starting VirtualBox kernel modules ...done.