Join me on Facebook!
— Written by Triangles on May 03, 2016 • ID 35 —
How do I install kernel header files?
Every time I install a new kernel version in my Debian Testing, I mess up the Virtual Box configuration. The message that comes from VirtualBox is pretty clear:
Kernel driver not installed (rc=-1908)
The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing
as root. [...]
Here the kernel version has changed under the hood, and VirtualBox should be notified about that. The solution lies in the message above: run
/etc/init.d/vboxdrv setup as root and everything should be fine.
If you are a bit less lucky like me, you might not have the latest kernel headers at hand, and because of that
vboxdrv cannot work properly. That's not a problem at least on Debian-based distros. You just have to install them with:
sudo apt-get install linux-headers-<kernel-version>-<processor>
If you don't remember the kernel version or the architecture of your processor, the small utility
uname comes to the rescue. It's a Unix app that prints some information about the operating system running on your machine. Invoke it with the flag
-r to print the kernel release. In my case it is:
That's enough for apt-get to do its job. Let's glue those parts together:
sudo apt-get install linux-headers-$(uname -r)
And you're done.