0

I have tried many tutorials to install virtual box on Ubuntu 14.04 LTS but no matter what I do, it doesn't work.

Trying to register the VirtualBox kernel modules using DKMSError! Your kernel headers for kernel 4.2.0-c9 cannot be found.
Please install the linux-headers-4.2.0-c9 package,
or use the --kernelsourcedir option to tell DKMS where it's located  
 ...failed!
  (Failed, trying without DKMS)
Recompiling VirtualBox kernel modules ...failed!
  (Look at /var/log/vbox-install.log to find out what went wrong)

I have searched through many forums and read askubuntu questions but NONE of them works for me.

Here's the output of /var/log/vbox-install.log:

Uninstalling modules from DKMS Attempting to install using DKMS

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

DKMS: add completed.
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.
3
  • Try running sudo apt-get update; sudo apt-get install linux-headers-4.2.0-c9 and then reinstall VBox.
    – Daniel
    Commented Dec 26, 2015 at 3:59
  • sudo apt-get install linux-headers-4.2.0-c9 gives an error.
    – Lokesh
    Commented Dec 26, 2015 at 4:09
  • The error is E: Unable to locate package linux-headers-4.2.0-c9 E: Couldn't find any package by regex 'linux-headers-4.2.0-c9'
    – Lokesh
    Commented Dec 26, 2015 at 5:10

1 Answer 1

0

4.2.0-c9 kernel don't come in packages in Ubuntu. If you install this kernel from sources, then you need the kernel headers installed manually in /usr/src/linux-headers-4.2.0-c9 (and pray...)

My recommendation is that install the kernel from lts-wily with:

sudo apt-get install linux-image-generic-lts-wily linux-headers-generic-lts-wily build-essential

don't forget, reboot after install the new kernel, ensure that you are with the new kernel, if you installed correctly the new kernel, must appear in grub menu before boot, choose this, and now, you continue with your virtualbox install.

5
  • Ok. I am gonna try it and let you know. Thank you
    – Lokesh
    Commented Dec 26, 2015 at 6:46
  • Is there any way to verify that lts-wily installed successfully?
    – Lokesh
    Commented Dec 26, 2015 at 7:10
  • I am screwed. uname -r still shows 4.2.0-c9.
    – Lokesh
    Commented Dec 26, 2015 at 7:31
  • edited the answer, check Commented Dec 27, 2015 at 4:31
  • Thanks. It's working. Now I can install the virtual box :)
    – Lokesh
    Commented Dec 27, 2015 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .