Friday, April 22, 2016

Install Oracle VirtualBox 5.0.18 on Ubuntu 16.04 ("Xenial") Desktop AMD64


I was trying to install Oracle VirtualBox 5.0.18 on my newly installed Ubuntu 16.04 ("Xenial") Desktop AMD64.

VirtualBox 5.0.18 for Ubuntu 16.04 Desktop AMD64 edition can be downloaded from: http://download.virtualbox.org/virtualbox/5.0.18/virtualbox-5.0_5.0.18-106667~Ubuntu~xenial_amd64.deb

Once it is downloaded I entered the below command to install it.
#sudo dpkg -i virtualbox-5.0_5.0.18-106667~Ubuntu~xenial_amd64.deb

However I was getting the dependency errors listed below.
dpkg: dependency problems prevent configuration of virtualbox-5.0:
 virtualbox-5.0 depends on libqt4-opengl (>= 4:4.7.2); however:
  Package libqt4-opengl is not installed.


dpkg: error processing package virtualbox-5.0 (--install):
 dependency problems - leaving unconfigured
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for shared-mime-info (1.5-2) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160415-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for mime-support (3.59ubuntu1) ...
Errors were encountered while processing:
 virtualbox-5.0

 
I assume that you might have also encounted the same error while you are trying to install VirtualBox on Ubuntu 16.04.

To resolve the above error. I tried the below list of commands. Firstly I checked for latest updates using:
#sudo apt-get update

Then installed the missing packages using the command:
#sudo apt-get install libqt4-opengl

At this stage you may try the below command instead of individually installing missing packages.
#sudo apt-get -f install

This will fix the previously encountered error and recompile the VirtualBox and you will get the below output in your terminal.
Setting up virtualbox-5.0 (5.0.18-106667~Ubuntu~xenial) ...
Adding group `vboxusers' (GID 129) ...
Done.
Stopping VirtualBox kernel modules ...done.
Recompiling VirtualBox kernel modules

 ...done.
Starting VirtualBox kernel modules ...failed!
  (modprobe vboxdrv failed. Please use 'dmesg' to find out why)
Processing triggers for libc-bin (2.23-0ubuntu3) ...

4 comments:

Unknown said...

any news about resolving VBox errors in 16.04?

Unknown said...

ok, if you can't still load vitualbox (for example I start it via vagrant) try disable Secure Boot in BIOS (or change to "other OS"). It helps me.

Kushan Sharma said...

Thanks, this helps to resolve the vbox error.

Unknown said...

Thank, my problem is solved