Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

After upgrading from 11.10 to 12.04, virtual box stopped working.

I've run the following to try to fix it:

sudo aptitude update
sudo aptitude install dkms
sudo /etc/init.d/vboxdrv setup

but when i run the last command I get:

bash: /etc/init.d/vboxdrv: No such file or directory

When I try

sudo /etc/init.d/virtualbox start

I get:

 * Starting VirtualBox kernel modules
 * No suitable module for running kernel found

I've also tried:

sudo dkms install virtualbox/4.1.2

and got:

Error! Could not find module source directory.
Directory: /usr/src/virtualbox-4.1.2 does not exist.

I've also tried installing linux headers:

sudo apt-get install linux-headers-$(uname -r)

but they were already installed.

From what I've read re-installing may not fix the problem. Is there a way I can fix virtual box?

share|improve this question
    
lacking the 10 reputation to place an answer ... but shorthand is: ´apt-get install --reinstall virtualbox-dkms´ - one just needs to have build-essential and linux-headers installed previously. –  syslogic Feb 3 '13 at 18:17
add comment

6 Answers

I had a similar problem. Here is what worked for me:

This may be required if you get a kernel sources not found type of error:

sudo apt-get install build-essential linux-headers-`uname -r`

Then reconfigure the relevant packages to kick them in to rebuilding.

sudo dpkg-reconfigure virtualbox-dkms 
sudo dpkg-reconfigure virtualbox
share|improve this answer
    
That worked for me (with the modprobe as in GTO69's answer) –  Matthieu Jul 10 '12 at 17:24
1  
apt-get install build-essential linux-headers`uname -r` may also be needed, as a note. –  Mochan Feb 17 '13 at 6:37
1  
I am getting sudo dpkg-reconfigure virtualbox-dkms dpkg-query: package 'virtualbox-dkms' is not installed and no information is available when I try sudo dpkg-reconfigure virtualbox-dkms. I don't have this error after reinstalling virtualbox... –  pinouchon Mar 5 '13 at 10:20
add comment
up vote 11 down vote accepted

I ended up uninstalling and reinstalling virtualbox using apt-get. It saw that there were kernel parts missing and installed them.

sudo apt-get remove virtualbox
sudo apt-get install virtualbox
share|improve this answer
1  
Note that "sudo apt-get install virtualbox --reinstall" does not kick off the module build process. –  Ben Simpson May 9 '12 at 18:26
1  
why the down vote? This fixed the problem for me on 12.04 –  ContextSwitch Sep 8 '13 at 17:53
add comment

This worked for me too:

sudo apt-get remove virtualbox
sudo apt-get install virtualbox

However, I had to add:

sudo modprobe vboxdrv
share|improve this answer
add comment

This answer is based on @curtis's answer, apparenly the answer's version specific

You are using the wrong version for building the dkms. Try this:

sudo dkms install virtualbox/4.1.12

It appears to have worked for me. This is after you install the virtualbox-dkms package of course.

the version can be changed (in bold given in the quotation).

So try:

ls -d /usr/src/virtualbox*

which will give you something like

/usr/src/virtualbox-version

now take version and use it in the command above like

sudo dkms install virtualbox/version

If that is not giving you

Module virtualbox/version already installed on kernel kernelVersion-generic/architecture

run this following commands after that(taken from other answers on the post)

  • rebuilding just the kernel modules

    sudo dpkg-reconfigure virtualbox-dkms

  • reinstalling

    sudo apt-get remove virtualbox && sudo apt-get install virtualbox

and if required, load the module sudo modprobe vboxdrv

if DKMS is showing error that some kernel is missing, then just install the kernel and then rebuild/reinstall virtualbox.

EDIT: apparently this is also exist on 12.10

share|improve this answer
add comment

You are using the wrong version for building the dkms. Try this:

sudo dkms install virtualbox/4.1.12

It appears to have worked for me. This is after you install the virtualbox-dkms package of course.

share|improve this answer
add comment

I have same Problem, and in the Logfile

DKMS make.log for virtualbox-4.1.12 for kernel 3.8.0-31-generic (x86_64) Mo 7. Okt 14:43:01 CEST 2013 make: Gehe in Verzeichnis '/usr/src/linux-headers-3.8.0-31-generic' LD /var/lib/dkms/virtualbox/4.1.12/build/built-in.o LD /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/built-in.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/linux/SUPDrv-linux.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/SUPDrv.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/SUPDrvSem.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/alloc-r0drv.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/initterm-r0drv.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/memobj-r0drv.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/mpnotification-r0drv.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/powernotification-r0drv.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/linux/assert-r0drv-linux.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/linux/alloc-r0drv-linux.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/linux/initterm-r0drv-linux.o CC [M] /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c: In Funktion »rtR0MemObjNativeMapUser«: /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1451:38: Fehler: »VM_RESERVED« nicht deklariert (erste Benutzung in dieser Funktion) /var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.c:1451:38: Anmerkung: jeder nicht deklarierte Bezeichner wird nur einmal für jede Funktion, in der er vorkommt, gemeldet make[2]: * [/var/lib/dkms/virtualbox/4.1.12/build/vboxdrv/r0drv/linux/memobj-r0drv-linux.o] Fehler 1 make[1]: [/var/lib/dkms/virtualbox/4.1.12/build/vboxdrv] Fehler 2 make: ** [module/var/lib/dkms/virtualbox/4.1.12/build] Fehler 2 make: Verlasse Verzeichnis '/usr/src/linux-headers-3.8.0-31-generic'

what can i do?

3.8.0-31-generic

micha@Aspire-V3-771:~$ sudo dpkg-reconfigure virtualbox-dkms[sudo] password for micha:

-------- Uninstall Beginning -------- Module: virtualbox Version: 4.1.12

Kernel: 3.5.0-18-generic (x86_64)

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

vboxdrv.ko: - Uninstallation - Deleting from: /lib/modules/3.5.0-18-generic/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/3.5.0-18-generic/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/3.5.0-18-generic/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/3.5.0-18-generic/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: 4.1.12

completely from the DKMS tree.

Done. Loading new virtualbox-4.1.12 DKMS files... Building only for 3.8.0-31-generic Building initial module for 3.8.0-31-generic Error! Bad return status for module build on kernel: 3.8.0-31-generic (x86_64) Consult /var/lib/dkms/virtualbox/4.1.12/build/make.log for more information. * Stopping VirtualBox kernel modules [ OK ] * Starting VirtualBox kernel modules * No suitable module for running kernel found [fail] invoke-rc.d: initscript virtualbox, action "restart" failed. micha@Aspire-V3-771:~$

share|improve this answer
    
i have now install Virtualbox from virtualbox.org And now it's running ...:) –  lupopa Oct 7 '13 at 13:30
add comment

protected by Community May 21 '12 at 16:43

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.