How to fix vermagic mismatch of vboxdrv?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
gnh1201
Posts: 2
Joined: 24. Aug 2017, 11:46

How to fix vermagic mismatch of vboxdrv?

Post by gnh1201 »

Hello.
I confused because modprobe vboxdrv failed when running /sbin/vboxconfig.

so, I found mismatched vermagic of vboxdrv. but I can not know how to fix.
Can I get help?

Code: Select all

[root@scw-bf4e0c ~]# /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why.
This system is not currently set up to build kernel modules (system extensions).
Running the following commands should set the system up correctly:

  yum install /lib/modules/devel-4.9.20-std-1/kernel
(The last command may fail if your system is not fully updated.)
  yum install /lib/modules/devel

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.

[root@scw-bf4e0c ~]# modprobe vboxdrv
modprobe: ERROR: could not insert 'vboxdrv': Exec format error

dmesg:
[ 1841.872090] vboxdrv: disagrees about version of symbol module_layout

[root@scw-bf4e0c ~]# modinfo vboxdrv
filename:       /lib/modules/[u]4.9.20-std-1[/u]/misc/vboxdrv.ko
version:        5.1.26 r117224 (0x002a0000)
license:        GPL
description:    Oracle VM VirtualBox Support Driver
author:         Oracle Corporation
rhelversion:    7.3
srcversion:     BBC180DD3624ED0BFE568D9
depends:        
vermagic:       [u]3.10.0-514.26.2.el7.x86_64[/u] SMP mod_unload modversions 
parm:           force_async_tsc:force the asynchronous TSC mode (int)
Last edited by socratis on 25. Aug 2017, 09:20, edited 1 time in total.
Reason: Enclosed the information in [code] tag for better readability
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to fix vermagic mismatch of vboxdrv?

Post by Perryg »

This system is not currently set up to build kernel modules (system extensions).
Running the following commands should set the system up correctly:

yum install /lib/modules/devel-4.9.20-std-1/kernel
(The last command may fail if your system is not fully updated.)
yum install /lib/modules/devel

There were problems setting up VirtualBox. To re-start the set-up process, run
/sbin/vboxconfig
as root
.
Did you actually do what the message stated? It also looks like a custom kernel, are you sure you have the necessary packages to build external modules?
gnh1201
Posts: 2
Joined: 24. Aug 2017, 11:46

Re: How to fix vermagic mismatch of vboxdrv?

Post by gnh1201 »

Yes. I did it. but I got this messages.

Code: Select all

No package /lib/modules/devel-4.9.20-std-1/kernel
No package /lib/modules/devel available.
I think it is a little extraordinary.

/lib/modules/devel-4.9.20-std-1/kernel, and /lib/modules/devel is not valid expression and not exists.
also, I am not using additional external modules.

If I need necessary packages, I want know how to find these.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to fix vermagic mismatch of vboxdrv?

Post by Perryg »

The suggested method is not a VirtualBox install, so if you did what they suggested and it failed you would need to ask them. As for building external modules that is what you are doing when you install VirtualBox and install their kernel modules. It looks like you are installing a fork from your distro and we would have no idea what to tell you since we do not know/use their installer. Now the mismatch vermagic usually happens when you have two versions of vboxdrv on the same system. Usually from mixing the official version with the repo version and installing without purging the first install. This fix would be to remove (purge) everything VirtualBox and then installing the version you want to use now.
Post Reply