Blog of Raivo Laanemets

Stories about web development, freelancing and personal computers.

VirtualBox 5.x on Slackware 14.1 with a custom kernel


Today I tried to upgrade my VirtualBox installation to gain access for Guest Additions in Windows 10 guest installation. The kernel driver for VirtualBox compiled successfully but refused to load with the following error message:

vboxdrv: version magic '3.10.17 SMP mod_unload ' should
be '3.12.8raivo SMP preempt mod_unload '

The issue is that it compiled the module for the wrong configuration/source by using the source of the standard kernel, not my custom one. This was easy to fix: download source again and extract it into /usr/src. This created the directory /usr/src/linux-3.12.8 for me. Then copy the old configuration to /usr/src/linux-3.12.8/.config and run the following command:

make oldconfig && make prepare && make scripts

Old configuration can also be extracted from /proc/config.gz if the kernel had this feature built in. If you have lost the old config, you are probably out of luck :(

This should generate enough files for recompiling the VirtualBox module. Remove the old symlink and install the new one with:

rm /usr/src/linux
ln -sf /usr/src/linux-3.12.8 /usr/src/linux

Then rebuild the module:

/etc/rc.d/rc.vboxdrv setup

This "proper" way of installing kernels is also recommended by the more-less official Slackware kernel build guide.


Comments

No comments have been added so far.

Email is not displayed anywhere.
URLs (max 3) starting with http:// or https:// can be used. Use @Name to mention someone.