94

I have installed VirtualBox Version 5.1.18 r114002 (Qt5.5.1) on Ubuntu 16.04 LTS. To virtualize everything (Kali, Windows 10).

I encounter the following error:

RTR3InitEx failed with rc=-1912 (rc=-1912)

The VirtualBox kernel modules do not match this version of VirtualBox. The installation of VirtualBox was apparently not successful. Executing

'/sbin/vboxconfig'

may correct this. Make sure that you do not mix the OSE version and the PUEL version of VirtualBox.

where: supR3HardenedMainInitRuntime what: 4 VERR_VM_DRIVER_VERSION_MISMATCH (-1912) - The installed support driver doesn't match the version of the user. enter image description here

  • What causes this problem?
  • How can this problem be solved?

When i run dpkg --list virtualbox-* in terminal, I get:

 Desired=Unknown/Install/Remove/Purge/Hold  
 | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend     
 |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)  
 ||/ Name       Version      Architecture Description
 +++-==============-============-============-================================= 
 rc  virtualbox-5.0 5.0.32-11293 i386         Oracle VM VirtualBox 
 rc  virtualbox-5.1 5.1.18-11400 i386         Oracle VM VirtualBox  
 un virtualbox-gue <none>       <none>       (no description available)
 un virtualbox-gue <none>       <none>       (no description available)
 un virtualbox-ose <none>       <none>       (no description available)
17
  • 1
    Have you read the error message? it says executing /sbin/vboxconfig my correct this. last version of virtualbox in repository is: 5.0.32, I suggest installing the vbox from offical repository.
    – Ravexina
    Apr 6, 2017 at 13:28
  • The error indicates that your virtual machine was installed in a VirtualBox version different to your present installation. This could be from mixing OSE (Ubuntu repositories) and PUEL version (after installing from Oracle including the extension pack), or from a different architecture (32 vs. 64 bit) - hard to say without knowing what you did before the error occured.
    – Takkat
    Apr 6, 2017 at 14:17
  • @Ravexina I have removed 5.1.18 and installed 5.0.32 but get previous Error.
    – Ali Hesari
    Apr 6, 2017 at 19:00
  • @Ravexina I run dpkg --list virtualbox-* and updated my question.
    – Ali Hesari
    Apr 6, 2017 at 19:34
  • 2
    Seems you still got 5.1 installed, run: sudo apt-get autoremove --purge virtualbox-5.1, then remove the unofficial repositories, and install virtualbox.
    – Ravexina
    Apr 6, 2017 at 19:41

10 Answers 10

118

If you installed VirtualBox by official manual and didn't forget to delete installed one from default Ubuntu repository.

Check if virtualbox-dkms is installed:

dpkg -l | grep virtualbox-dkms

If yes, then delete it and install dkms

sudo apt-get purge virtualbox-dkms && \
sudo apt-get install dkms

Rebuild VirtualBox kernel modules:

sudo /sbin/vboxconfig 
1
  • This is the way! This one seems like the most direct answer and worked for me here on 22.04.3LTS in Feb, 2024. 👍🏽
    – raddevus
    Feb 26 at 13:28
90
+100

Read This first!

Please note that this answer is intended to specifically solve the original poster's problem when typical solutions like running sudo /sbin/vboxconfig or removing virtualbox-dkms and installing dkms does not work.

Please first try these simple workarounds, these might help you right away.


It seems that your installation version of virtualbox is for 32-bit architecture while you are running 64-bit operation system which can be the cause of this problem.

My workaround would be to remove the installed version from PPA, and installing virtualbox from official repositories.

To remove virtualbox, run:

sudo apt autoremove --purge virtualbox*

After that make sure there is no other version installed on your system by:

dpkg -l 'virtualbox*' | grep ^i

You shouldn't get any output, also you can try to run virtualbox to make sure it's not installed.

Then remove all related PPAs from your sources.list and sources.list.d directory. ex:

mkdir ~/apt-tmp
sudo mv /etc/apt/sources.list.d/* ~/apt-tmp

Make sure there is nothing except official repositories sources in /etc/apt/sources.list.

And update your sources:

sudo apt update

Now we can search to see which versions are available to install:

apt-cache madison virtualbox | grep -iv sources

Which produces an output like this:

virtualbox | 5.0.32-dfsg-0ubuntu1.16.04.2 | http://mirrors.kernel.org/ubuntu xenial-updates/multiverse amd64 Packages
virtualbox | 5.0.18-dfsg-2build1 | http://mirrors.kernel.org/ubuntu xenial/multiverse amd64 Packages

Then I would install the last version mentioned in xenial-updates:

sudo apt install virtualbox=5.0.32-dfsg-0ubuntu1.16.04.2

Also sudo apt install virtualbox, would be fine, but I would go with the above command to make sure my desired version is going to be installed.

And after all, check that the correct version is installed.

From command line:

dpkg -l virtualbox* | grep ^i

ii  virtualbox                     5.0.32-dfsg-0ubuntu1.16.04.2 amd64        x86 virtualization solution - base binaries
ii  virtualbox-dkms                5.0.32-dfsg-0ubuntu1.16.04.2 all          x86 virtualization solution - kernel module sources for dkms
ii  virtualbox-qt                  5.0.32-dfsg-0ubuntu1.16.04.2 amd64        x86 virtualization solution - Qt based user interface

From GUI: to make sure correct version is running.

Help menu -> about virtualbox

Pay attention to green highlight

vbox

8
  • Thanks you for the reply. I run apt-cache madison virtualbox | grep -iv sources but I did not get output!!! no problem?
    – Ali Hesari
    Apr 10, 2017 at 18:44
  • You should get an output as my example, add this commands output to your question cat /etc/apt/sources.list.
    – Ravexina
    Apr 10, 2017 at 20:46
  • 5
    sudo mv /etc/apt/sources.list.d/* ~/apt-tmp by doing this, sudo apt-get install won't install any other software after. So don't forget to move it back
    – Asme Just
    Aug 23, 2017 at 8:35
  • Ran into the same issue, with some 3rd party apt retro, thanks heaps on how to remove it! Having said that, it IS already possible, to install 5.1 in direct fashions, see my answer here.
    – Frank N
    Sep 17, 2017 at 9:46
  • I followed your instructions and installed virtualbox but I am not able to install guest additions Jun 10, 2018 at 7:42
11

So, in my case, the kernel modules were not removed properly.

Here are the details:

root@Dell5280 [~]# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS

root@Dell5280 [~]# uname -r
4.13.0-31-generic

Problem:

root@Dell5280 [~]# modinfo vboxdrv
filename: /lib/modules/4.13.0-31-generic/updates/dkms/vboxdrv.ko
version: 5.0.40_Ubuntu r115130 (0x00240000)
license: GPL
description: Oracle VM VirtualBox Support Driver
author: Oracle Corporation
srcversion: 6D8B4900A693FC50489A130
depends:
name: vboxdrv
vermagic: 4.13.0-31-generic SMP mod_unload

FIX:

root@Dell5280 [~]# rm /lib/modules/4.13.0-31-generic/updates/dkms/vboxdrv.ko

root@Dell5280 [~]# modinfo vboxdrv
filename: /lib/modules/4.13.0-31-generic/updates/dkms/vboxdrv.ko
modinfo: ERROR: could not get modinfo from 'vboxdrv': No such file or directory
[1] root@Dell5280 [~]# /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.

root@Dell5280 [~]# modinfo vboxdrv
filename: /lib/modules/4.13.0-31-generic/misc/vboxdrv.ko
version: 5.2.7 r120349 (0x00290000)
license: GPL
description: Oracle VM VirtualBox Support Driver
author: Oracle Corporation
srcversion: 4880B21EFF1B605D6402982
depends:
name: vboxdrv
vermagic: 4.13.0-31-generic SMP mod_unload
parm: force_async_tsc:force the asynchronous TSC mode (int)

After this, everything works (at least in my case)

Hope it helps. Hide See full activity log

I posted the reply at https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1736116

0
6

It seems you have two separate versions of VirtualBox installed on your system!

I would recommend that you fully uninstall all versions of VirtualBox:

sudo apt-get autoremove 'virtualbox*'

Then reinstall directly from Oracle virtualbox. Go to the VB download page, scroll down to "Debian-based Linux distributions", and follow the instructions or download VB binary package for all distributions and then run the installer like this:

cd /path/to/downloaded/file
chmod +x VirtualBox-x.x.xx-xxxxxx-Linux_xxxxx.run
./VirtualBox-x.x.xx-xxxxxx-Linux_xxxxx.run
0
3

If reinstall Virtualbox not work. You should Try install or reinstall the dkms of Virtualbox

verify if have errors:

dpkg -P virtualbox-dkms

If you have error probably should try do:

sudo apt-get install virtualbox-dkms
3
  • 1
    This left files on my machine but this removed all autoremove --purge virtualbox*
    – mango
    Dec 15, 2019 at 3:10
  • Wow, the thing that fixed it for me was at the very bottom...sudo apt autoremove --purge virtualbox* Jan 22, 2020 at 0:00
  • i did the same i.e., solely reinstalled the 'virtualbox-dkms' package , but had to execute one last command afterwards in sequential order >>lsmod | grep vboxdrv resulted in nothing , so i had to execute >>modprobe vboxdrv , then >>lsmod | grep vboxdrv resulted in vboxdrv 479232 0 . then virtualbox worked afterwards without raising an error
    – xquilt
    Mar 3, 2021 at 10:43
3

a simple apt upgrade virtualbox worked for me

1
  • This helped to identify virtualbox-dkms was not upgraded together with virtualbox and caused version mismatch.
    – Saftever
    Jan 20, 2021 at 2:39
2

Check that you have vbox modules loaded:

lsmod | grep vbox

On my machine, I have vboxpci, vboxnetadp, vboxnetflt, and vboxdrv

Check if they are the correct version:

modinfo vboxdrv

Very likely that the version of this module would be 5.0.32 rxxxxxx, but you are running virtualbox 5.1

If this is not the case, this answer might not help solve your problem.

Otherwise, this might be caused by not removing the modules left over by your old-version virtualbox, and the new modules are not overwriting.

Simply remove all those old modules and reboot, and it should fix the problem:

# This command list all files in the same directory of the vboxdrv module
# Double check they are all vbox* modules and are outdated
# Then change "ls" to "rm" to remove all
ls $(dirname $(modinfo vboxdrv | sed -n 's/filename: *(\.*\)/\1/p'))/*
2

If you want to use the latest version of virtualbox, you need to remove modules in the dkms folder.

VB 5.1 and older places modules in misc while VB 5.0 in the fork stores them in dkms folder.

  1. Purge all virtualbox with apt
  2. Check modinfo vboxdrv to see if it outputs version 5.0:

    $ modinfo vboxdrv
    filename: /lib/modules/4.13.0-31-generic/updates/dkms/vboxdrv.ko
    version: 5.0.40_Ubuntu r115130 (0x00240000)
    license: GPL
    description: Oracle VM VirtualBox Support Driver
    author: Oracle Corporation
    srcversion: 6D8B4900A693FC50489A130
    depends:
    name: vboxdrv
    vermagic: 4.13.0-31-generic SMP mod_unload
     parm:           force_async_tsc:force the asynchronous TSC mode (int)
    
  3. If it does output 5.0, delete the modules in dkms folder:

    $ sudo -i
    # sudo rmmod vboxnetadp vboxnetflt vboxpci vboxdrv 
    # cd /lib/modules/(kernelversion)-generic/updates/dkms
    # rm vbox*
    
  4. Run sudo /sbin/rcvboxdrv setup (then check whether modinfo vboxdrv gives the correct version)

    $ modinfo vboxdrv
    filename:       /lib/modules/4.10.0-42-generic/misc/vboxdrv.ko
    version:        5.2.6 r120293 (0x00290000)
    license:        GPL
    description:    Oracle VM VirtualBox Support Driver
    author:         Oracle Corporation
    srcversion:     4880B21EFF1B605D6402982
    depends:        
    vermagic:       4.10.0-42-generic SMP mod_unload 
    parm:           force_async_tsc:force the asynchronous TSC mode (int)
    
2

after updating to 6.0 this message also appeared. In case you didn't do it, restart your system so that all new modules be loaded into the kernel. Sometimes it's as simple as that.

1

I removed virtualbox using the command given below:

sudo apt autoremove --purge virtualbox*

but it did not work.

I found that the old vboxdrv mod was not getting removed and had to manually remove vboxdrv.ko from "/lib/modules/$(uname -r)/updates/dkms/".

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .