I recently got stuck while trying to install Headless Virtualbox on a Centos 5.2 server per the directions at Howtoforge here. The RPM failed with the error that it couldn’t find the kernel source. I thought I had already installed kernel-devel, and confirmed that I did. The instructions were to define the KERN_DIR variable like so:

$ export KERN_DIR=/usr/src/kernels/2.6.18-92.1.22.el5-i686/
$ /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [  OK  ]
Removing old VirtualBox netflt kernel module [  OK  ]
Removing old VirtualBox kernel module [  OK  ]
Recompiling VirtualBox kernel module [  OK  ]
Starting VirtualBox kernel module [FAILED]
(modprobe vboxdrv failed. Please use 'dmesg' to find out why)

dmesg shows this:

vboxdrv: disagrees about version of symbol struct_module

Interesting!

After several missteps, it turns out there is a separate development rpm for the PAE kernel:

$ yum install kernel-PAE-devel

After that installs, we are good:

$ export KERN_DIR=/usr/src/kernels/2.6.18-92.1.22.el5-PAE-i686/
$ /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [  OK  ]
Removing old VirtualBox netflt kernel module [  OK  ]
Removing old VirtualBox kernel module [  OK  ]
Recompiling VirtualBox kernel module [  OK  ]
Starting VirtualBox kernel module [  OK  ]

Golden.

13 comments
  1. Pingback: Dave Drager
  2. I tried to install VirtualBox on a Xen Kernel. After about 7 hours of banging my head and searching for the correct headers, dealing with build errors etc I gave up! (very unlike me). It just wasnt worth the hassle. I am now working on a PAE kernel, lets hope its more straightforward!

  3. I tried to install VirtualBox on a Xen Kernel. After about 7 hours of banging my head and searching for the correct headers, dealing with build errors etc I gave up! (very unlike me). It just wasnt worth the hassle. I am now working on a PAE kernel, lets hope its more straightforward!

  4. That’s because you must have installed kernel-devel instead of kernel-xen-devel. This will compile the module. But when you try to load the module, it will reboot the system and then you wont be able to boot it unless you boot in single user mode and then disable the vboxdrv init script.

    Xen and VirtualBox are incompatible (at least at the time of writing this). Someone filed bug with virtualbox but that was closed with the status as “wont fix”. So I guess you will need some other kernel and not xen.

  5. That’s because you must have installed kernel-devel instead of kernel-xen-devel. This will compile the module. But when you try to load the module, it will reboot the system and then you wont be able to boot it unless you boot in single user mode and then disable the vboxdrv init script.

    Xen and VirtualBox are incompatible (at least at the time of writing this). Someone filed bug with virtualbox but that was closed with the status as “wont fix”. So I guess you will need some other kernel and not xen.

  6. I tried with this, but it still won’t solve my problem.
    I do just follow the advice, and get a problem as this link is not available:
    /lib/modules/build -> ../../../usr/src/kernels/2.6.35.6-48.fc14.i686.PAE

    Then I find that the kernel source file and kernel module don’t match each other:
    $ ll /usr/src/kernels/; ll /lib/modules/; ll /lib/modules/2.6.35.6-48.fc14.i686.PAE/ |grep build
    total 16
    drwxr-xr-x. 22 root root 4096 Nov 19 14:58 2.6.35.6-45.fc14.i686
    drwxr-xr-x. 22 root root 4096 Nov 15 00:04 2.6.35.6-48.fc14.i686
    drwxr-xr-x. 22 root root 4096 Dec 8 17:08 2.6.35.9-64.fc14.i686
    drwxr-xr-x. 22 root root 4096 Dec 8 15:19 2.6.35.9-64.fc14.i686.PAE
    total 12
    drwxr-xr-x. 7 root root 4096 Dec 8 16:50 2.6.35.6-45.fc14.i686
    drwxr-xr-x. 6 root root 4096 Dec 8 16:50 2.6.35.6-48.fc14.i686
    drwxr-xr-x. 6 root root 4096 Nov 27 23:38 2.6.35.6-48.fc14.i686.PAE
    lrwxrwxrwx. 1 root root 50 Nov 27 23:17 build -> ../../../usr/src/kernels/2.6.35.6-48.fc14.i686.PAE
    lrwxrwxrwx. 1 root root 5 Nov 27 23:17 source -> build

    $ rpm -q kernel-PAE-devel
    kernel-PAE-devel-2.6.35.9-64.fc14.i686
    $ uname -r
    2.6.35.6-48.fc14.i686.PAE

    How can that be?
    Since there’s only one PAE for src and one for module, I simply make link as build -> ../../../usr/src/kernels/2.6.35.9-64.fc14.i686.PAE

    then fail as:
    Starting VirtualBox kernel modules [FAILED]
    (modprobe vboxdrv failed. Please use ‘dmesg’ to find out why)
    dmesg shows:
    [ 1544.584690] vboxdrv: version magic ‘2.6.35.9-64.fc14.i686.PAE SMP mod_unload 686 ‘ should be ‘2.6.35.6-48.fc14.i686.PAE SMP mod_unload 686 ‘

    Now I get stuck. anybody know what’s next?

Comments are closed.

You May Also Like

Command Line Packet Sniff Existing Running Process in Linux

Have you ever come across a server that is doing a lot…

A phpBB 3 iPhone Style Theme With Option to Disable

A forum that I am an adminstrator for has been clamoring for an iPhone theme (style) for a long time now. In the past, I hadn’t seen any usable iPhone template for phpBB3, until now. View this entire post to view my modifications to a theme switcher for mobile devices, so that the end user can disable a mobile theme for their login if they should choose to do so.

What a Resilver Looks Like in ZFS (and a Bug and/or Feature)

At home I have an (admittedly small) ZFS array set up to experiment with this neat newish raid technology. I think it has been around long enough that it can be used in production, but I’m still getting used to the little bugs/features, and here is one that I just found. After figuring out that I had 2 out of 3 of my 1TB Seagate Barracuda hard drives fail, I had to give the array up for a loss and test out my backup strategy. Fortunately it worked and there was no data loss. After receiving the replacement drives in from RMA, I rebuilt the ZFS array (using raidz again) and went along my merry way. After 6 months or so, I started getting some funky results from my other drive. Thinking it might have some issue as with the others, I removed the drive and ran Seatools on it (by the way, Seatools doesn’t offer a 64-bit Windows version – what year is this?). The drive didn’t show any signs of failure, so I decided to wipe it and add it back into the array to see what happens. That, of course, is easier said than done.

C++ Compiler

I you are trying to compile software on a new system, and…