As you probably know, starting with VirtualBox 4.0 some features are now available separately, in an extension pack. Here are the step-by-step instructions on installing both VirtualBox and the Extensions Pack in Ubuntu.

Install VirtualBox 4.0 in Ubuntu


1. Remove any previous VirtualBox version you had installed.
Presuming you were using version 3.2, you would have to run the following command:
sudo apt-get remove virtualbox-3.2


2. Add the VirtualBox contrib repository and install VirtualBox 4.0:

VirtualBox 4.0 is no longer available in the non-free component of the VirtualBox Ubuntu repository but in contrib.
Add it and install VirtualBox using the following commands:


sudo -v
echo "deb $(lsb_release -sc) contrib" | sudo tee -a /etc/apt/sources.list
wget -q -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install virtualbox-4.0


3. Download the Extension Pack.
For USB 2.0 devices, VirtualBox RDP and PXE boot for Intel cards support, you’ll also have to install an Extension pack which you can download from HERE.

4. Install the VirtualBox Extension pack.

Open VirtualBox 4.0 and go to File > Preferences and on the Extensions tab, click the “add” button on the right (first blue diamond) and browse for the VirtualBox extension pack you’ve downloaded in step 1. That’s it!