How do I install VirtualBox 4.1?

Solution 1:

Install virtualbox 4.1 on any ubuntu version

You need to edit /etc/apt/sources.list

gksudo gedit /etc/apt/sources.list

Add the following line

Add one of the following lines according to your distribution to your /etc/apt/sources.list:

deb http://download.virtualbox.org/virtualbox/debian oneiric contrib
deb http://download.virtualbox.org/virtualbox/debian natty contrib
deb http://download.virtualbox.org/virtualbox/debian maverick contrib non-free
deb http://download.virtualbox.org/virtualbox/debian lucid contrib non-free
deb http://download.virtualbox.org/virtualbox/debian karmic contrib non-free
deb http://download.virtualbox.org/virtualbox/debian hardy contrib non-free
deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free
deb http://download.virtualbox.org/virtualbox/debian lenny contrib non-free

Save and exit the file

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

Update source list

sudo apt-get update

Install virtualbox

sudo apt-get install virtualbox-4.1

Note: Ubuntu/Debian users might want to install the dkms package to ensure that the VirtualBox host kernel modules (vboxdrv, vboxnetflt and vboxnetadp) are properly updated if the linux kernel version changes during the next apt-get upgrade. For Debian it is available in Lenny backports and in the normal repository for Squeeze and later. The dkms package can be installed through the Synaptic Package manager or through the following command:

sudo apt-get install dkms

Solution 2:

You can also try using a PPA for the latest updates, see http://www.ubuntuupdates.org/ppas/7.

sudo add-apt-repository ppa:debfx/virtualbox 
sudo apt-get update
sudo apt-get install virtualbox