19

I have been using VMWare on Windows for a long time. But after a long wait, I moved to VirtualBox on Ubuntu 11.10. I installed Ubuntu, 32 Bit, installed all available updates and installed Virtual Box. When I try to create a new Windows installation inside VirtualBox, I got the following error messages.

VirtualBox - Error

Failed to open a session for the virtual machine Windows XP.
The virtual machine '**Windows XP**' has terminated unexpectedly during startup with exit code 1.
Details

Result Code:
NS_ERROR_FAILURE (0x80004005)
Component:
Machine
Interface:
IMachine {5eaa9319-62fc-4b0a-843c-0cb1940f8a91}

2nd error dialogue

Virtualbox - Error in suplibOsinit
Kernal driver not installed (rc--1908)
Please install the virtualbox-dkmbs package and execute 'modprobe vboxdrv' as root.
  • I have already tried reinstalling VirtualBox.
  • Google result seem to indicate the the problem happens due to Kernel updates.

Is there anyway I can get this working? I need this for malware analysis and if VirtualBox is going to crash on me all the time, then I won't be able to use Ubuntu for work.

Output to dpkg -l | grep virtual

 server
rc  virtualbox                             4.1.2-dfsg-1ubuntu1                    
x86 virtualization solution - base binaries
rc  virtualbox-qt                          4.1.2-dfsg-1ubuntu1                    
x86 virtualization solution - Qt based user interface 
cute 'modprobe vboxdrv' as root.<p>
16
  • What is the output to dpkg -l | grep virtual?
    – jippie
    Apr 15, 2012 at 8:11
  • What is your version of Virtual Box? Where did you install it from: USC or Oracle repository? Did you try - as suggested - to install virtualbox-dkms package and sudo modprobe vboxdrv?
    – Takkat
    Apr 15, 2012 at 8:52
  • As Takkat asked, did you follow the steps on Download VirtualBox for Linux Hosts. Especially the Note: for Ubuntu/Debian users about the dkms package? Apr 15, 2012 at 15:01
  • @jippie i have updated the question with the result. it was too big to add as comment.
    – Sunil J
    Apr 16, 2012 at 6:03
  • 1
    Possible duplicate of Virtualbox Kernel driver not installed
    – bain
    Jan 22, 2016 at 23:31

13 Answers 13

17

Wierdly, for me it worked by closing VirtualBox and then running

sudo modprobe vboxdrv 

from the terminal and then restarting VirtualBox

6
  • 2
    they key being to close the VirtualBox GUI first. Thanks @JomanJi!
    – LRE
    Apr 23, 2014 at 8:01
  • 2
    This helped me. Apr 30, 2017 at 11:32
  • Doesn't work for me.
    – Max N
    Jun 4, 2017 at 13:41
  • Thank you very much working this comment..............
    – balaji
    Jun 6, 2019 at 6:31
  • Added some extra RAM module and all my VM's got NS_ERROR_FAILURE (0x80004005). Looks like sudo modprobe vboxdrv fixed the problem. Thanks May 14, 2020 at 12:41
9

I had the same problem and solved it by

  1. Purging Virtualbox:

    sudo apt-get purge virtualbox virtualbox-dkms virtualbox-ose-qt virtualbox-qt

  2. I then reinstalled;

    sudo apt-get install virtualbox virtualbox-dkms virtualbox-ose virtualbox

    and noticed:

    dependency problems prevent configuration of virtualbox-ose:
    virtualbox-ose depends on virtualbox; however:
    Package virtualbox is not configured yet.
    Package virtualbox-4.0 which provides virtualbox is not installed.
    
  3. so I tried installing virtualbox-4.0;

    sudo apt-get install virtualbox-4.0

    That worked and pulled in the correct VirtualBox DKMS kernel modules.

  4. I then had to download and install the correct version of the extension pack Oracle_VM_VirtualBox_Extension_Pack-4.0.16-75491.vbox-extpack.

That worked, and I now have a fully functioning Virtualbox instance.

3

Try to uninstall VirtualBox from the command line:

sudo apt-get purge virtualbox virtualbox-dkms virtualbox-ose-qt virtualbox-qt

If it succesfully uninstalled reinstall it:

sudo apt-get install virtualbox virtualbox-dkms virtualbox-ose-qt virtualbox-qt

Carefully check if the command completes succesfully.

15
  • Install also dkms
    – gajdipajti
    Apr 16, 2012 at 6:42
  • dkms automatically pulled in as a dependency
    – jippie
    Apr 16, 2012 at 6:48
  • Ok, I usually provide dkms also, because I had a strange experience with fedora. But I know, this is ubuntu:)
    – gajdipajti
    Apr 16, 2012 at 6:52
  • is this a problem? No suitable module for running kernel found [fail] invoke-rc.d: initscript virtualbox, action "restart" failed.
    – Sunil J
    Apr 16, 2012 at 6:57
  • With regard to the initial question, this may very well be related. Kernal driver not installed. Did you do a full patch cycle lately? for a in update upgrade dist-upgrade autoremove; do apt-get -y $a; done
    – jippie
    Apr 16, 2012 at 7:05
2

I was getting NS_ERROR_FAILURE (0x80004005) whenever I try to start the VM in Debian 9 unstable. None of the solution worked including re-building kernel modules, starting in headless mode etc.

Then I tried to install extension pack and it failed due to /opt being not owned by the root! I fixed the ownership of /opt and then the pack installed successfully and also virtualbox starts! weird!

1

I had almost the same error:

Failed to open a session for the virtual machine Windows XP.
The virtual machine '**Windows XP**' has terminated unexpectedly during startup with exit code 1.

Then a second window appeared saying I had to run this command:

sudo /etc/init.d/vboxdrv setup

When I Issued that command the following error came out:

$ sudo /etc/init.d/vboxdrv setup
 * Stopping VirtualBox kernel modules                                                             [ OK ] 
 * Uninstalling old VirtualBox DKMS kernel modules                                                                   [ OK ] 
 * Trying to register the VirtualBox kernel modules using DKMS                                                              
Error! Your kernel headers for kernel 2.6.38-16-generic-pae cannot be found at
/lib/modules/2.6.38-16-generic-pae/build or /lib/modules/2.6.38-16-generic-pae/source.
Failed, trying without DKMS
Recompiling VirtualBox kernel modules                                                                                    Look at /var/log/vbox-install.log to find out what went wrong

Solution

Install the appropriated linux-headers for your O.S. version. In my case was:

sudo apt-get install linux-headers-2.6.38-16-generic-pae

Ensure all VirtualBox windows are closed.

1

I tried this : To fix this, run the following, as directed by the prompt:

sudo /etc/init.d/vboxdrv setup

If successful, the result will read Starting VirtualBox kernel modules [ OK ] and it's OK now

1

I had this issue but fortunately I solved it not from comand line but from GUI... open your home directory ~/VirtualBox VMs
open your hard disk image file
open name of your virtual machine.vbox

Your virtual box should run normally from here and that should fix your problem( if you had the same issue I had , the problem shown up when I had all data in my VirtualBox.xml in the .VirtualBox directory was gone!!!)

Another suggestion: If the previous one didn't work for you ...
go to .Virtualbox in you home directory
type the following (cp VirtualBox.xml-prev VirtualBox.xml)
I think this should do it for you too...

Good luck...

1

Solution :

sudo apt-get install virtualbox-dkms
sudo apt-get install linux-headers-generic
sudo /etc/init.d/virtualbox start
 * Starting VirtualBox kernel modules  

execute virtualbox :

/usr/bin/virtualbox or virtualbox
1

This is due to extension pack's different version than other VB packages.

Fix

1) Removing extension pack - sudo apt-get remove virtualbox-extension-pack

2) Disable USB 2 support from VM settings

It will works ! If you want to use extension pack , reinstall the correct version. You can download it from here.

2
  • 1
    pacman is the package manager for Arch Linux, not Ubuntu. How does this apply to Ubuntu?
    – muru
    Apr 30, 2015 at 14:41
  • Said command results in Unable to locate package virtualbox-extension-pack, downloading the extension pack makes virtualbox say that the same version is already installed.
    – Max N
    Jun 4, 2017 at 14:08
0

To fix this, run the following, as directed by the prompt:

sudo /etc/init.d/vboxdrv setup

If successful, the result will read * Starting VirtualBox kernel modules [ OK ]

If it fails, the reason should be logged in /var/log/vbox-install.log but it always seems to be because headers for the current (host) kernel are missing: Your kernel headers for kernel 3.5.0-22-generic cannot be found so install them then try again:

sudo apt-get install linux-headers-$(uname -r) ## e.g. 3.5.0-22-generic
sudo /etc/init.d/vboxdrv setup

Note: You will need to do this after every kernel upgrade unless package-maintainers find a solution.

0

Run /sbin/vboxconfig as superuser. You may have to wait after some error messages before it completes the command.

-2

Something that seems to not be covered is kernel source. You need the kernel headers for your current kernel installed or it will fail to build the modules needed, resulting in this error.

1
  • Welcome to askubuntu, could you perhaps include a how-to to help other users that may have this problem? Jan 8, 2013 at 19:36
-2

This is so easy. I had the same problem and I was wondered how easy to solve this is. Make sure to close VirtualBox first, completly. Then issue the following command:

sudo vboxreload

That's it! I found this out by typing "vbox" and hitting TAB twice on arch linux. This should also work on Ubuntu and any other distribution.

1
  • 1
    Will not work, there is no such command as vboxreload on Ubuntu.
    – guntbert
    May 1, 2016 at 19:43

You must log in to answer this question.

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