Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have two kernels installed, 3.5.0 and 3.6.0. For several reasons I have to run kernel 3.5.0. VirtualBox works perfectly on 3.6.0, but not on 3.5.0.

After I booted kernel 3.5.0 I triggered a module rebuild of the with apt-get --reinstall install virtualbox-dkms. This recompiled the VirtualBox module successfully. However, it fails to load.

# modprobe vboxdrv
ERROR: could not insert 'vboxdrv': Exec format error

/var/log/messages:

warning: `VirtualBox' uses 32-bit capabilities (legacy support in use)
vboxdrv: disagrees about version of symbol module_layout

The module seems to be installed correctly:

$ ls /lib/modules/3.5.0/updates/dkms/
vboxdrv.ko  vboxnetadp.ko  vboxnetflt.ko  vboxpci.ko

System information: Debian unstable, package virtualbox-dkms is installed

$ uname -r
3.5.0

$ apt-cache show virtualbox | grep Version
Version: 4.1.18-dfsg-1.1

$ apt-cache show dkms | grep Version
Version: 2.2.0.3-1.2

Here is the output of the module build:

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 4.1.18
Kernel:  3.5.0 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.5.0/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.5.0/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.5.0/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.5.0/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 4.1.18
Kernel:  3.6.0 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.6.0/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.6.0/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.6.0/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/3.6.0/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.

------------------------------
Deleting module version: 4.1.18
completely from the DKMS tree.
------------------------------
Done.
Unpacking replacement virtualbox-dkms ...
Setting up virtualbox-dkms (4.1.18-dfsg-1.1) ...
Loading new virtualbox-4.1.18 DKMS files...
Building for 3.5.0 and 3.6.0
Building initial module for 3.5.0
Done.

vboxdrv:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.5.0/updates/dkms/

vboxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.5.0/updates/dkms/

vboxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.5.0/updates/dkms/

vboxpci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.5.0/updates/dkms/

depmod....

DKMS: install completed.
Building initial module for 3.6.0
Done.

vboxdrv:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.6.0/updates/dkms/

vboxnetadp.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.6.0/updates/dkms/

vboxnetflt.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.6.0/updates/dkms/

vboxpci.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/3.6.0/updates/dkms/

depmod....

DKMS: install completed.
[ ok ] Stopping VirtualBox kernel modules.
[FAIL] Starting VirtualBox kernel modules[....] modprobe vboxdrv failed. Please use 'dmesg' to find out why ... failed!
 failed!
invoke-rc.d: initscript virtualbox, action "restart" failed.

How can I get VirtualBox to work on 3.5.0?

share|improve this question
    
apt-cache show will show the highest priority version, which may or may not be the one installed. Use apt-cache policy <package> –  jordanm Oct 21 '12 at 21:48
    
You probably need to get the kernel headers(or sources) of 3.5.0 version to recompile it –  Serge Oct 21 '12 at 22:34
    
@jordanm The versions I show are ones actually installed. –  Marco Oct 21 '12 at 22:38
    
@Serge The package linux-headers-3.5.0 is installed. Otherwise the modules would not have been built and placed in /var/lib/modules/3.5.0 I assume. –  Marco Oct 21 '12 at 22:39
    
Yes, you are right. Then I have no advice –  Serge Oct 21 '12 at 22:43

2 Answers 2

up vote 1 down vote accepted

Thanks to the link from warlock I figured that there was some version mismatch. I assume it was caused by the fact that I didn't create a kernel-source package. Instead I was using the git repository which was used to compile several other versions as well.

First I deleted the packages linux-image and linux-headers (the currently running kernel).

The next step was a completely clean checkout (without build remains in the directory). Then I built the kernel and created the packges linux-image, linux-headers and the linux-source package and installed them. After this the VirtualBox module was built and its loading succeeded.

I don't know which versions didn't match before, but following these steps guarantees that there should be no version mismatch.

share|improve this answer

Do you have the virtualbox-dkms package installed?
I usually have to reinstall this after each kernel upgrade, which I think indicates that the dkms part of it is broken, but re-installing it works for me. I've never tried re-installing it on anything but a new kernel, but I assume it should build against whichever kernel is currently running.

share|improve this answer
    
Yes, virtualbox-dkms is installed. I triggered a rebuild with reinstalling the dkms package as mentioned in my question and the modules are successfully built. –  Marco Oct 22 '12 at 6:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.