VirtualBox DKMS with custom kernel

I have a custom kernel on my linux machine (that I apparently did not install correctly) so when I went to use VirtualBox I got an error about DKMS not being ready. The docs say I needed to update my “virtualbox-ose-dkms” package to the latest version but when I did that it failed to install, saying the module could not be built.

Running the reconfigure command manually gave me this error:

$ sudo dpkg-reconfigure virtualbox-dkms
------------------------------
Deleting module version: 4.1.12
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-4.1.12 DKMS files...
Building only for 3.2.37-32corexeon
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
* Stopping VirtualBox kernel modules [ OK ]
* Starting VirtualBox kernel modules
* No suitable module for running kernel found [fail]
invoke-rc.d: initscript virtualbox, action "restart" failed.

What you’ll find online if you search for this error is its missing the linux-headers-`uname -r` package. I had it installed, but it still wasn’t finding it.

The issue turned out to be my /lib/modules/3.2.37-32corexeon directory was linking to the original location where I had compiled the kernel, but I had since moved those files. I updated this symlink and then it worked:

/lib/modules/3.2.37-32corexeon/build
-> /usr/src/linux-headers-3.2.37-32corexeon/

Thanks *nix notes!


Share on facebook
Share on twitter
Share on linkedin
Share on print
Share on email