2

I am using Ubuntu, and I am trying to install virtualbox. But I get this error. If anyone knows how to solve this, please, tell me.

Error:
WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (2.6.32-042stab092.2) or it failed to
load. Please recompile the kernel module and install it by

   sudo /etc/init.d/vboxdrv setup

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

*Edit: After ThomasW's answer this showed up:

ERROR ON LOG: Error log file:
Uninstalling modules from DKMS
Attempting to install using DKMS
Failed to install using DKMS, attempting to install without
Makefile:183: *** Error: unable to find the sources of your current Linux kernel.
Specify KERN_DIR=<directory> and run Make again. Stop

marked as duplicate by Eric Carvalho, user.dz, MadMike, Arronical, qbi Jun 14 '16 at 13:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Open a terminal and do as the error message says. Call sudo /etc/init.d/vboxdrv setup – MadMike Oct 16 '14 at 14:32
  • Also he needs to install some needed packages like make gcc kernel-headers and such. There's already a few answers here with that. – LnxSlck Oct 16 '14 at 14:34
1

You need to run the command that is being provided in the error, as well as recompile it.

First, start by installing build-essential to get the essential libraries for building things:

sudo apt-get install build-essential

Next, run the command that error is specifying:

sudo /etc/init.d/vboxdrv setup
  • I get this error: Recompiling VirtualBox kernel modules ...failed! (Look at /var/log/vbox-install.log to find out what went wrong) – Joserex65 Oct 16 '14 at 18:21
  • @Joserex65 attach the content of that log file into your question as an edit, we need to see the exact error – Thomas Ward Oct 16 '14 at 18:29
  • Added! Error log file: Uninstalling modules from DKMS Attempting to install using DKMS Failed to install using DKMS, attempting to install without Makefile:183: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop. – Joserex65 Oct 19 '14 at 12:47
  • Added! Check my last comment. – Joserex65 Oct 20 '14 at 14:11
  • @Joserex65 I can't read that on my phone, can you add that to your original question as an edit instead of as a comment to my answer? – Thomas Ward Oct 20 '14 at 16:24
0

First, start off by following Thomas W.'s answer:

sudo apt-get install build-essential

followed by

sudo /etc/init.d/vboxdrv setup 

To fix your error, run:

sudo apt-get install linux-generic linux-headers-generic
  • 1
    I've already tried this, and it doesn't works. – Joserex65 Oct 23 '14 at 15:16
0

What did work for me :

sudo apt-get install linux-headers-amd64 

replace amd64 by your architecture.

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