0

I'm trying to install Virtualbox on my Ubuntu 16.04. When I try to open it, it gives me an error that tells me to run sudo /sbin/vboxconfig. Running this command results in the following output:

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.2.0-35-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.2.0-35-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 suggested steps don't work on my machine. It says that the package is obsolete. The only available header packages are 4.4.0 packages. Running uname -r gives me version 4.2.0 though.

Any ideas how to fix this?

Output of cat /etc/lsb-release:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"

Output of sudo apt install linux-generic:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-generic is already the newest version (4.4.0.36.38).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Output of cat /etc/default/grub:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT="                                                               Windows 10"
#GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="5"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL="console"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE="640x480"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID="true"

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

export GRUB_COLOR_NORMAL="green/black"
export GRUB_COLOR_HIGHLIGHT="light-green/black"
export GRUB_MENU_PICTURE="/home/user/grub/maxresdefault.jpg"
GRUB_SAVEDEFAULT="false"
  • Please run sudo apt install linux-generic and post the output. – Pilot6 Sep 7 '16 at 20:34
  • You probably used some grub customizer or something that fixes the kernel to boot. – Pilot6 Sep 7 '16 at 20:44
  • Please post the output of cat /etc/default/grub. – Pilot6 Sep 7 '16 at 20:45
  • When I first installed VirtualBox on my workstation (running 14.04 with a 4.2 kernel), I had to add package dkms to support the building of 'dynamic kernel modules' used by VirtualBox. You will also need the kernel headers package for your current kernel. The kernel your machine says its running is from wily, not xenial. Did you do an in-place upgrade with the kernel packages pinned? Have you rebooted since you upgraded? – user207998 Sep 7 '16 at 22:20
  • Yes, I've done an in-place update, but I'm not sure about the kernel. I have rebooted since then. – henne90gen Sep 8 '16 at 4:19
0

You have a spoiled /etc/default/grub file.

Fix the line

GRUB_DEFAULT="                                                               Windows 10"

to

GRUB_DEFAULT=0

Then remove

GRUB_SAVEDEFAULT="false"

and run

sudo update-grub

Then reboot.

  • Thanks for the answer, but that didn't do anything. After the reboot, the output of uname -r is still 4.2.0. :-/ – henne90gen Sep 7 '16 at 20:25
  • This means you do not have Ubuntu 16.04. – Pilot6 Sep 7 '16 at 20:29
  • What does cat /etc/lsb-release show? – Pilot6 Sep 7 '16 at 20:30
  • Fixing the grub file didn't help either but I noticed that there were 4.4.0 kernels listed during the update-grub process. – henne90gen Sep 7 '16 at 21:05
  • Did you remove GRUB_SAVEDEFAULT="false"? You can always boot with kernel 4.4 using grub menu. that will fix the problem. You will need to fix your broken grub anyway. – Pilot6 Sep 7 '16 at 21:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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