Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Cannot load virtualbox kernel modules: Exec format error

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
styxxx
Posts: 19
Joined: 2013-06-03 20:24

Cannot load virtualbox kernel modules: Exec format error

#1 Post by styxxx »

Hi,

for some unknown reason loading the virtualbox kernel modules suddenly fail. I already rebuilt the modules and even removed and reinstalled all virtualbox-related packages from the debian repositories without any effect. There were no error messages during install and building the modules, everything seemed to work.

Code: Select all

$ sudo modprobe --verbose vboxdrv
insmod /lib/modules/4.14.0-3-amd64/updates/dkms/vboxdrv.ko 
modprobe: ERROR: could not insert 'vboxdrv': Exec format error
kern.log/dmesg says:

Code: Select all

[79848.516182] module: vboxdrv: Unknown rela relocation: 4
That's all.

It's the correct module version (Google told me that wrong kernel-modules-combinations can be the issue sometimes, but not the case here):

Code: Select all

$ uname -a
Linux notebookneu 4.14.0-3-amd64 #1 SMP Debian 4.14.17-1 (2018-02-14) x86_64 GNU/Linux
--force-modversion and --force-vermagic doesn't have any effect either. But when I tried yesterday I once got

Code: Select all

[72179.741385] vboxdrv: bad vermagic: kernel tainted.
[72179.741392] Disabling lock debugging due to kernel taint
But that was before I reinstalled virtualbox and it didn't happen afterwards. Still this might be related?

Installed packages:

Code: Select all

ii  virtualbox                                                       5.2.16-dfsg-3                          amd64        x86 virtualization solution - base binaries
ii  virtualbox-dkms                                                  5.2.16-dfsg-3                          all          x86 virtualization solution - kernel module sources for dkms
ii  virtualbox-qt                                                    5.2.16-dfsg-3                          amd64        x86 virtualization solution - Qt based user interface

ii  linux-headers-4.14.0-3-amd64                                     4.14.17-1                              amd64        Header files for Linux 4.14.0-3-amd64
ii  linux-headers-4.14.0-3-common                                    4.14.17-1                              all          Common header files for Linux 4.14.0-3
ii  linux-image-4.14.0-3-amd64                                       4.14.17-1                              amd64        Linux 4.14 for 64-bit PCs
ii  linux-kbuild-4.14                                                4.14.17-1                              amd64        Kbuild infrastructure for Linux 4.14
(I'm still running kernel 4.14 since the newer ones come with some issues rendering them unusable on my laptop :/ )

Anyone any idea? ;)

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Cannot load virtualbox kernel modules: Exec format error

#2 Post by stevepusser »

Hmmm...those package versions aren't in the stretch or stretch-backports repository. I think one should let us know if you're running testing or a FrankenDebian in the first sentence of a post asking for help. So...what is your system's situation?
MX Linux packager and developer

styxxx
Posts: 19
Joined: 2013-06-03 20:24

Re: Cannot load virtualbox kernel modules: Exec format error

#3 Post by styxxx »

Oh sorry, I totally forgot. :oops: You're right, I'm using Debian testing.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Cannot load virtualbox kernel modules: Exec format error

#4 Post by stevepusser »

Does it help to force the rebuild of the driver with

Code: Select all

dpkg-reconfigure virtualbox-dkms

?
Watch the output to see if there are any build failures.

For what it's worth, it works for me on a Stretch base, 4.17.8 backported kernel, and backported vbox 5.2.16.
MX Linux packager and developer

styxxx
Posts: 19
Joined: 2013-06-03 20:24

Re: Cannot load virtualbox kernel modules: Exec format error

#5 Post by styxxx »

Thanks! I already tried that but did it again just now.
Everything seems normal, no errors. The module is built for two installed kernels including the used one. But I still get the same error when trying to modprobe it. :?

Code: Select all

-------- Uninstall Beginning --------
Module:  virtualbox
Version: 5.2.16
Kernel:  4.14.0-3-amd64 (x86_64)
-------------------------------------

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

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.14.0-3-amd64/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/4.14.0-3-amd64/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/4.14.0-3-amd64/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/4.14.0-3-amd64/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: 5.2.16
Kernel:  4.16.0-1-amd64 (x86_64)
-------------------------------------

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

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.16.0-1-amd64/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/4.16.0-1-amd64/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/4.16.0-1-amd64/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/4.16.0-1-amd64/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: 5.2.16
completely from the DKMS tree.
------------------------------
Done.
Loading new virtualbox-5.2.16 DKMS files...
Building for 4.14.0-3-amd64 4.16.0-1-amd64
Building initial module for 4.14.0-3-amd64
Done.

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

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

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

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

depmod............

DKMS: install completed.
Building initial module for 4.16.0-1-amd64
Done.

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

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

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

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

depmod.............

DKMS: install completed.




$ sudo modprobe --verbose vboxdrv
insmod /lib/modules/4.14.0-3-amd64/updates/dkms/vboxdrv.ko 
modprobe: ERROR: could not insert 'vboxdrv': Exec format error

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Cannot load virtualbox kernel modules: Exec format error

#6 Post by stevepusser »

Hmmm...if it's a regression in just one kernel version that's no longer in Debian, I doubt that the developers will be motivated to fix it. Can you get it working in the current Buster kernel despite the rendering issues? Then we'd know.

The rendering issues are also something that should be fixed before Buster is released.
MX Linux packager and developer

keneda212
Posts: 1
Joined: 2018-09-09 07:57

Re: Cannot load virtualbox kernel modules: Exec format error

#7 Post by keneda212 »

Hello
I have search the same error code, and the only research I found on internet is here
but when I have compare my informations with this topic I have see one thing : I was still in linux image 4.3 !
in fact, when I have build my debian, I think I haven't use the linux image amd64 but this image, and it was never update since
after the upgrade in the last linux image 4.17 now, virtual box works \o/
so thanks from a french man for this topic ;-)

styxxx
Posts: 19
Joined: 2013-06-03 20:24

Re: Cannot load virtualbox kernel modules: Exec format error

#8 Post by styxxx »

Totally forgot about this. But I tested other kernels that are currently installed: only the latest kernel seems to work. Using older ones always fail (for exampke 4.14, 4.15), although all the modules are installed without errors. Very strange.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Cannot load virtualbox kernel modules: Exec format error

#9 Post by stevepusser »

For what it's worth, a backported virtualbox 5.2.18 works fine on my backported 4.18.6 kernel, too. https://build.opensuse.org/package/show ... ource-4.18
MX Linux packager and developer

xchen
Posts: 1
Joined: 2018-09-14 13:20

Re: Cannot load virtualbox kernel modules: Exec format error

#10 Post by xchen »

It is due to a change in the kernel:

https://www.reddit.com/r/linuxquestions ... s_anymore/
https://git.kernel.org/pub/scm/linux/ke ... 1ebf2fb4cd

It has nothing to do with virtualbox. All dkms modules have this problem if your kernel is not up-to-date and you are compiling modules with binutils >= 2.31 (debian testing/unstable).

Post Reply