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?
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:
Then reconfigure the relevant packages to kick them in to rebuilding.
I ended up uninstalling and reinstalling virtualbox using apt-get. It saw that there were kernel parts missing and installed them.
This worked for me too:
However, I had to add:
This answer is based on @curtis's answer, apparenly the answer's version specific
the version can be changed (in bold given in the quotation).
So try:
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
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
You are using the wrong version for building the dkms. Try this:
It appears to have worked for me. This is after you install the virtualbox-dkms package of course.
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:~$