0

I am pretty new to Ubuntu. I had been using genymotion for the past 2-3 days. When I tried to start it today, it indicated something is wrong with the virtualbox. I had it installed from the repos. I have uninstalled it, then reinstalled it again from the repos, then uninstalled it again and then reinstalled using the .deb from the VirtualBox site. Tried installing dkms, nothing happened. Trying to start Virtual Box I am getting this message,

      WARNING: The vboxdrv kernel module is not loaded. Either there is no module available for the current kernel (4.4.0-65-generic) or it failed to load. Please recompile the kernel module and install it by

       sudo /sbin/vboxconfig

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

Trying to run sudo /sbin/vboxconfig, I get this:

vboxdrv.sh: Building VirtualBox kernel modules.

 This system is not currently set up to build kernel modules (system extensions).

  Running the following commands should set the system up correctly:

  apt-get install linux-headers-4.4.0-65-generic
  (The last command may fail if your system is not fully updated.)
   apt-get install linux-headers-generic
   vboxdrv.sh: failed: Look at /var/log/vbox-install.log to find out what went wrong.

  This system is not currently set up to build kernel modules (system extensions).

   Running the following commands should set the system up correctly:

  apt-get install linux-headers-4.4.0-65-generic

  (The last command may fail if your system is not fully updated.)

  apt-get install linux-headers-generic

  There were problems setting up VirtualBox.  To re-start the set-up process, run /sbin/vboxconfig as root.

The contents of /var/log/vbox-install.log is:

Makefile:185: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR <directory> and run Make again.  Stop.

Makefile:185: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR <directory> and run Make again.  Stop.

Makefile:185: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR <directory> and run Make again.  Stop.

Makefile:185: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR <directory> and run Make again.  Stop.

Makefile:185: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR <directory> and run Make again.  Stop.

Makefile:185: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR <directory> and run Make again.  Stop.

And running apt-get install linux-headers-4.4.0-65-generic, I get:

  Package linux-headers-4.4.0-65-generic is not available, but is referred to by another package.

  This may mean that the package is missing, has been obsoleted, or is only available from another source

  E: Package 'linux-headers-4.4.0-65-generic' has no installation candidate
codeNoob
  • 101
  • First, how are you installing virtualbox ? Second, did you read the message ? It gives clear instructions. apt-get install linux-headers-generic , gave you that message more then once, so, sudo apt-get update && sudo apt-get upgrade && sudo apt-get install linux-headers-generic and then try again to install vbox. Vbox is in the repos , and KVM and similar are supported out of the box as alternates to vbox. – Panther Mar 03 '17 at 16:31
  • @bodhi.zazen Of course I did try all of those. But it didn't fix it. I installed first from the repos, then the .deb from the site. And gennymotion requires virtualbox, kvm won't do, I think – codeNoob Mar 03 '17 at 16:36
  • Of course you did what ? You need to update your question with 1. How are you installing vbox ? and what commands you ran to try to fix the problem. See also - https://help.ubuntu.com/community/VirtualBox/Installation – Panther Mar 03 '17 at 16:38
  • @bodhi.zazen Sorry updated the comment. – codeNoob Mar 03 '17 at 16:39
  • Update the question, not everyone reads the comments. See also the link I gave you and tell us where you got what version of vbox and tried installing it how ..... – Panther Mar 03 '17 at 16:40
  • See also http://askubuntu.com/questions/41478/how-do-i-install-the-virtualbox-version-from-oracle-to-install-an-extension-pack – Panther Mar 03 '17 at 16:41
  • That is NOT the command I asked you to run. Run sudo apt-get update && sudo apt-get upgrade && sudo apt-get install linux-headers-generic then try installing vbox again – Panther Mar 03 '17 at 17:00
  • Can you please reboot and run sudo apt-get install linux-headers-generic – Panther Mar 03 '17 at 18:29
  • I have tried it. It doesn't solve the problem. It was the first thing I did. – codeNoob Mar 03 '17 at 18:33
  • Did you reboot ? You really should update the question with these details. My guess is that your kernel updated and so you need to reboot. If it fails after a reboot, post the output of uname -r and try sudo apt-get install linux-headers-$(uname -r) – Panther Mar 03 '17 at 18:36
  • I have rebooted. I have tried to reboot after trying to fix broken packages from recovery mode. The oupput of uname -r is linux-4.4.0-65-generic – codeNoob Mar 03 '17 at 18:39
  • If you have updated and run sudo apt-get install linux-headers-generic and it still fails with the error message you gave you will have to file a bug report against linus-headers-generic and try booting an older kernel . – Panther Mar 03 '17 at 18:43
  • Yeah. It works with an older kernel. – codeNoob Mar 03 '17 at 19:36
  • The problem is that the kernel headers are not yet available for the new kernel. Wait a few days and try again or file a bug report, your choice. – Panther Mar 03 '17 at 19:41

1 Answers1

0

This error may occour when the module is not loaded. Even if you don't use Arch Linux, you can still read this: https://wiki.archlinux.org/index.php/VirtualBox#Load_the_VirtualBox_kernel_modules

So, just try:

sudo modprobe vboxdrv

or reboot your computer.

  • In Ubuntu that error is because the headers are not installed so modprobe will not work (yet) . The arch linux documents are awesome, but with Ubuntu use the ubuntu docs - https://help.ubuntu.com/community/VirtualBox – Panther Mar 03 '17 at 17:00
  • Hmmm, then update your system using "sudo apt-get update && sudo apt-get dist-upgrade", reinstall the headers, virtualbox and reboot / use modprobe. – Thomas William Mar 03 '17 at 17:06
  • On ubuntu, to install the headers, you need sudo apt-get install linux-headers-generic as in the message given to the user in the output on the command s/he ran, as in my comments. With Ubuntu see https://help.ubuntu.com/community/VirtualBox/Installation and https://www.virtualbox.org/wiki/Linux_Downloads – Panther Mar 03 '17 at 17:34
  • "Package linux-headers-4.4.0-65-generic is not available, but is referred to by another package.

    This may mean that the package is missing, has been obsoleted, or is only available from another source

    E: Package 'linux-headers-4.4.0-65-generic' has no installation candidate". That's because kernel headers were deleted from the repos because there is a new kernel release avaliable. So, s/he must update the whole system before installing the headers.

    – Thomas William Mar 03 '17 at 17:46
  • @ThomasWilliam But sudo apt-get dist-upgrade says there's nothing to upgrade, same as upgrade. – codeNoob Mar 03 '17 at 18:01
  • Can you please reboot and run sudo apt-get install linux-headers-generic – Panther Mar 03 '17 at 18:29
  • I have tried it. It says the linux-headers are newest version (linux-headers-4.4.0-64.8-generic). But my kernel version is linux-4.4.0-65 – codeNoob Mar 03 '17 at 18:35
  • If you have updated and run sudo apt-get install linux-headers-generic and it still fails with the error message you gave you will have to file a bug report against linus-headers-generic and try booting an older kernel . – Panther Mar 03 '17 at 18:42
  • The headers sometimes lag a few days, but you will need to file a bug report. – Panther Mar 03 '17 at 19:17
  • @bodhi.zazen Where should I file the bug report? – codeNoob Mar 03 '17 at 19:42
  • https://bugs.launchpad.net/ and https://bugs.launchpad.net/ubuntu/+filebug?no-redirect= – Panther Mar 03 '17 at 19:44
  • It is against the new kernel, just report kernel headers are not available – Panther Mar 03 '17 at 19:45