Debian is one of the best Linux distros out there (if not the best). The latest stable version called Lenny was released about a month ago, but as always, Debian never ships the latest software or kernel versions. So I decided to install the latest vanilla kernel (2.6.29) from kernel.org (I might provide a howto for this task later… 😉 ). This work’s really great – most of the time… I ran into one problem installing Debians (rather old) VirtualBox OSE 1.6.6 though. As I don’t run Debians kernel I needed to compile a suitable kernel module for my kernel 2.6.29 using Debians module-assistant. But compiling the module bailed out with errors:
‘struct task_struct’ has no member named ‘euid’. Luckily I found a solution for VirtualBox 2.10 on VirtualBox Forums. Of course the provided patch didn’t work for VirtualBox 1.6.6 but from there on it was easy to build one. If you run into the same problem, well, this is how it worked for me:
su -c "apt-get install virtualbox-ose-source module-assistant"
Then switch as root to
/usr/src and unpack “virtualbox-ose.tar.bz2”
tar xvf virtualbox-ose.tar.bz2
This will create a new subdirectory “modules” where the source code of the VirtualBox module can be found. We need to patch
Download my patch for VirtualBox 1.6.6 from here and then invoke
patch SUPDrv-linux.c < /path/to/vbox-ose.patch
Now go back to
/usr/src and rename the source package because we’ll create a new one now (make sure no other module source code resides within the modules directory – if so, just move it out of the way temporarily):
mv virtualbox-ose.tar.bz2 virtualbox-ose_bak.tar.bz2
tar cvf virtualbox-ose.tar modules
This is basically it. You can now build the module by
m-a a-i virtualbox-ose
This should build and install a working virtualbox kernel module!