0

I was using Ubuntu 14.10 on my setup and I had Virtualbox running fine.

Then my OCZ Vertex 2 (SSD) died unexpectedly and I had to reinstall everything.

But, because the Intel Graphics Drivers weren't installing on Ubuntu 14.10 (February 2015), I chose to install Ubuntu 14.04 LTS. What a surprise that the new April 2015 drivers will ONLY install on Ubuntu 14.10! So I then upgraded to Ubuntu 14.10 and, after installing the drivers I updated to 15.04.

Why I did this introduction? Because maybe something wrong happened during the update, especially with the kernel update.

When I install Virtualbox I get this error:

Trying to register the VirtualBox kernel modules using DKMS.

Error! Your kernel headers for kernel 3.19.7-031907-generic cannot be found.

Please install the linux-headers-3.19.7-031907-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
 ...failed!
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules ...failed!

Before, the kernel was like 3.16, I manually updated to 3.19.7, but it can't find kernel headers: what can I do?

Maythux
  • 84,289
  • 1
    Check if you don't have a case of http://askubuntu.com/questions/449905/wrong-kernel-after-upgrade-old-kernel-still-installed – Rmano May 08 '15 at 10:37

1 Answers1

1

you need to install the headers first:

sudo apt-get install linux-headers-$(uname -r)

you have to recompile the kernel module and install it by

sudo /etc/init.d/vboxdrv setup

If some error appears then try this solution:

sudo apt-get install virtualbox-ose

This will take care of dependencies like the kernel headers which is included in the package linux-headers-generic

Maythux
  • 84,289
  • it says linux-headers-3.19.7-031907-generic is not available (output not in english, my translation) – Magnetic_dud May 08 '15 at 07:34
  • sudo apt-get install linux-headers-$(uname -r) output opf this command? – Maythux May 08 '15 at 07:35
  • Il pacchetto linux-headers-3.19.7-031907-generic non ha versioni disponibili, ma è nominato da un altro pacchetto. Questo potrebbe indicare che il pacchetto è mancante, obsoleto oppure è disponibile solo all'interno di un'altra sorgente

    E: Il pacchetto "linux-headers-3.19.7-031907-generic" non ha candidati da installare

    – Magnetic_dud May 08 '15 at 07:38
  • Write in English please – Maythux May 08 '15 at 07:39
  • what happens if you run this sudo apt-get install virtualbox-ose? – Maythux May 08 '15 at 07:42
  • I manually installed kernel 4.0.1-040001-lowlatency and the sudo /etc/init.d/vboxdrv setup command finally worked (before it said kernel headers not found) – Magnetic_dud May 08 '15 at 07:43
  • Then you solve your problem? – Maythux May 08 '15 at 07:43