Saturday, May 7, 2011

VirtualBox 4.0 in Ubuntu Natty: Installation and Troubleshooting

VirtualBox 4.0 is out now. Most importantly, it supports Unity as well as Gnome-Shell in the Virtual Environment. For a complete list of changes, please take a look at changelog here.

http://www.virtualbox.org/wiki/Changelog

Installation

Go to Terminal under Applications > Accessories  sub-menu on Ubuntu Classic session or press <Super> (Windows Logo) key in Unity and type 'Terminal'. Click at the icon and type this command:

gksudo gedit /etc/apt/sources.list

At the end of the file that opens up, paste this line:

deb http://download.virtualbox.org/virtualbox/debian natty contrib

Save and close this file. Now we need to download the signed key and register. Run this command:

wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

The output should be 'OK'.

Now update your sources and install the VirtualBox 4.0 package by following this command:

sudo apt-get update && sudo apt-get install virtualbox-4.0

DKMS, an Important Package

Most likely, dkms package is installed on your computer but we need to make sure it is installed as this package is responsible for updating VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) when the Linux Kernel version changes during the next update / upgrade process:

sudo apt-get install dkms

Troubleshooting

Some common problems with VirtualBox in Natty are listed below.

Invalid / BADSIG

While refreshing your repository index, this error is common with VirtualBox sources:

The following signatures were invalid: BADSIG ...

To correct this, you need to follow the commands below one-by-one (from the official VirtualBox website):

sudo -s -H
apt-get clean
rm /var/lib/apt/lists/*
rm /var/lib/apt/lists/partial/*
apt-get clean
apt-get update

Once installed, you can access VirtualBox from Applications > Accessories sub-menu on Ubuntu Classic and by pressing <Super> and searching for VirtualBox in Unity.

Failed to access the USB subsystem

After creating a new machine, when you click the 'Settings' button in VirtualBox main window to make some changes, most of the times you are greeted with the error message shown in image below.


Somehow, the User Privileges don't get assigned correctly. The solution is to press the <Super> key, type 'Users and groups' and open it.

In the Users and Groups main window, click 'Manage Groups' and look for the 'vboxusers' group. Highlight it and click properties. In the new window under members, enable your account. Close it.



Once again on the Users and Groups main window, click your username and then click 'Advanced Settings'. Go to the 'User Privileges' tab and scroll down to the bottom where you see this option.

Use VirtualBox virtualization solution

Make sure it is enabled. A reboot would be enough to make the error disappear now.

Related Posts:

Natty Narwhal , Troubleshooting , VirtualBox