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>
Braiam
  • 67,791
  • 32
  • 179
  • 269
Sunil J
  • 315
  • 1
  • 2
  • 7
  • What is the output to dpkg -l | grep virtual? – jippie Apr 15 '12 at 08: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 '12 at 08: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? – irrational John Apr 15 '12 at 15:01
  • @jippie i have updated the question with the result. it was too big to add as comment. – Sunil J Apr 16 '12 at 06:03
  • @Takkat I didn't add oracle repository... just did sudo apt-get install virtualbox. i removed it and tried sudo apt-get install virtualbox-dkms with no luck. sudo modprobe vboxdrv says "module vboxdrv not found" – Sunil J Apr 16 '12 at 06:07
  • @irrationalJohn i just tried it. – Sunil J Apr 16 '12 at 06:08
  • @irrationalJohn i just tried it. added deb http://download.virtualbox.org/virtualbox/debian oneiric contrib to repository. but I'm getting the following message when I try to update.

    W: Failed to fetch http://download.virtualbox.org/virtualbox/debian/dists/oneiric/Release Unable to find expected entry 'contrib/source/Sources' in Release file (Wrong sources.list entry or malformed file)

    E: Some index files failed to download. They have been ignored, or old ones used instead.

    – Sunil J Apr 16 '12 at 06:14
  • Could you check the formatting to dpkg -l in your question? It is a bit messed up right now and I can't figure out completely what it should look like. The lines shouldn't start with rc, they should start with ii. Installation did not finish as intended. – jippie Apr 16 '12 at 06:35
  • After removing the OSE (Ubuntu repository) version try installing Virtual Box from Oracle repository (see this answer for procedures). Virtual Box runs very stable here, just to have said it. – Takkat Apr 16 '12 at 07:47
  • @jippie updated the formatting. I had copied it from the terminal. – Sunil J Apr 16 '12 at 08:11
  • @Takkat i have done those steps, but for some reason, its not able to check the repository. see the comment above. – Sunil J Apr 16 '12 at 08:11
  • You may have to manually check if the entries in your /etc/apt/sources.list are o.k.. Don't forget to download and register the public key and sudo apt-get update. – Takkat Apr 16 '12 at 09:19
  • Oh - forgot to mention that: you don't need a sources (deb-src) entry. Just comment out (#...) this line from your sources.list. – Takkat Apr 16 '12 at 09:53
  • this is what i have @Takkat '## This software is not part of Ubuntu, but is offered by third-party

    developers who want to ship their latest software.

    deb http://extras.ubuntu.com/ubuntu oneiric main deb-src http://extras.ubuntu.com/ubuntu oneiric main deb http://download.virtualbox.org/virtualbox/debian oneiric contrib deb-src http://download.virtualbox.org/virtualbox/debian oneiric contrib'

    – Sunil J Apr 18 '12 at 08:04
  • As said before: try to put a # in front of the line deb-src download.virtualbox.org/virtualbox/debian oneiric contrib. Then sudo apt-get update, downlaod the key wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -, and install sudo apt-get install virtualbox-4.1. – Takkat Apr 18 '12 at 08:17
  • 1

13 Answers13

17

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

sudo modprobe vboxdrv 

from the terminal and then restarting VirtualBox

JomanJi
  • 311
  • 2
    they key being to close the VirtualBox GUI first. Thanks @JomanJi! – LRE Apr 23 '14 at 08:01
  • 2
    This helped me. – Michele Carino Apr 30 '17 at 11:32
  • Doesn't work for me. – Max N Jun 04 '17 at 13:41
  • Thank you very much working this comment.............. – balaji Jun 06 '19 at 06: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 – Adam Filipczyk May 14 '20 at 12:41
  • Just adding a few more words to the previous comment I left in this tread. I have 5 internal drives on my 18.04. One smaller ssd for startup and 4 remaining big ones for everything else. However. None of the .vdi's pointing to the 1st drive where the OS and VBox installation are set up. My setup is that every time my machine is rebooted all remaining 4 drives are enabled on the startup, but not mounted, until I physically start browsing them and mount it. In effect if I run my VBox instance before mounting the drive where my vdi's are pointing, I'll get this funny NS_ERROR_FAILURE (0x80004005) – Adam Filipczyk May 18 '20 at 20:16
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.

jippie
  • 5,683
  • Install also dkms – gajdipajti Apr 16 '12 at 06:42
  • dkms automatically pulled in as a dependency – jippie Apr 16 '12 at 06:48
  • Ok, I usually provide dkms also, because I had a strange experience with fedora. But I know, this is ubuntu:) – gajdipajti Apr 16 '12 at 06: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 '12 at 06: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 '12 at 07:05
  • @gajdipajti dkms is already there..thanks for the suggestion. i guess as jippie said, it must have been installed as a dependency. I think it has something to do with the no suitable module for running kernal. Unfortunately, even though I have used ubuntu on and off for several years, I am still a noob. – Sunil J Apr 16 '12 at 07:06
  • @jippie I installed ubuntu just 2 days back on this laptop. I did an update after that. I am not able to see any update available. Does it mean I have done a full patch cycle? – Sunil J Apr 16 '12 at 07:34
  • @jippie I am getting the following message when I start virtualbox from terminal

    The character device /dev/vboxdrv does not exist. Please install the virtualbox-ose-dkms package and the appropriate headers, most likely linux-headers-generic.

    You will not be able to start VMs until this problem is fixed.

    – Sunil J Apr 16 '12 at 07:37
  • You're missing a kernel module, I have no clue why. What is the output for uname -a and for find /lib/modules | grep vboxdrv? – jippie Apr 16 '12 at 18:00
  • uname -a Linux laptop 3.0.0-17-generic-pae #30-Ubuntu SMP Thu Mar 8 17:53:35 UTC 2012 i686 i686 i386 GNU/Linux – Sunil J Apr 26 '12 at 12:08
  • no thing for find /lib/modules | grep vboxdrv – Sunil J Apr 26 '12 at 12:10
  • vbox insgtall logs 'Uninstalling modules from DKMS removing old DKMS module vboxhost version 4.1.12

    Deleting module version: 4.1.12 completely from the DKMS tree.


    Done. Attempting to install using DKMS

    Creating symlink /var/lib/dkms/vboxhost/4.1.12/source -> /usr/src/vboxhost-4.1.12

    DKMS: add Completed. Failed to install using DKMS, attempting to install without Makefile:172: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.'

    – Sunil J Apr 26 '12 at 12:10
  • Strange. Your filesystem isn't full, is it? df -h – jippie Apr 26 '12 at 19:28
  • Filesystem Size Used Avail Use% Mounted on /dev/sda1 290G 16G 260G 6% / udev 1.9G 4.0K 1.9G 1% /dev tmpfs 765M 988K 764M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.9G 3.5M 1.9G 1% /run/shm – Sunil J Apr 27 '12 at 09:00
  • Don't know. I could advise you lots of things, but I'm afraid I'd just be making your system a mess. Maybe upgrading to 12.04 would solve the issue, but personally I like to wait a couple of weeks to see if any annoying issues pop up with the new release. – jippie Apr 27 '12 at 17:41
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!

Anwar
  • 76,649
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.

Peachy
  • 7,117
  • 10
  • 38
  • 46
Alexis
  • 11
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

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
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...

Seth
  • 58,122
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
guntbert
  • 13,134
Haikel
  • 11
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.

Dumindu
  • 11
  • 1
    pacman is the package manager for Arch Linux, not Ubuntu. How does this apply to Ubuntu? – muru Apr 30 '15 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 04 '17 at 14:08
0

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

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.

Alastair
  • 201
-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.

Routh
  • 1
-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.

guntbert
  • 13,134
Julian
  • 1