Ubuntu – VirtualBox error kernel headers

androidandroid-studiogenymotionkernelvirtualbox

I'm with Ubuntu 15.04 and I'm trying to create an emulator (genymotion), but when run virtualbox, i got the error:

Stopping VirtualBox kernel modules …done.
Uninstalling old VirtualBox DKMS kernel modules …done.
Trying to register the VirtualBox kernel modules using DKMSError! Your kernel headers for kernel 3.16.0-30-generic cannot be found.
Please install the linux-headers-3.16.0-30-generic package,
or use the –kernelsourcedir option to tell DKMS where it's located
…failed!
(Failed, trying without DKMS)
Recompiling VirtualBox kernel modules …failed!
(Look at /var/log/vbox-install.log to find out what went wrong)

I performed

uname -a

And the result is:

Linux douglas 3.16.0-30-generic #40-Ubuntu SMP Mon Jan 12 22:06:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Someone help me?Already I uninstalled and installed again.

Best Answer

You are missing the kernel for Ubuntu Vivid. Probably it was remove by accident. So here are the steps.

# Install latest kernel
$ sudo apt-get install linux-generic

# Restart your machine ...

# Recompile the kernel module for Virtualbox
$ sudo /etc/init.d/vboxdrv setup

I had the same problem after trying to install Virtualbox 5.0 on Ubuntu 15.04 and I think I 've removed also the kernel while purging the virtualbox packages.