How to install or upgrade VirtualBox on Ubuntu or Debian

VirtualBox is a cross-platform virtualization software package for x86 architecture. A nice thing about VirtualBox is that it has several quite useful features, not available on other similar software such as VMware Player, which include: virtual machine snapshots. disk image conversion and support (e.g., VMware's VMDK, Microsoft's VHD, Apple's DMG), guest machine cloning, etc.

Install VirtualBox on Ubuntu or Debian

First, update /etc/apt/sources.list to add the official repository of VirtualBox. Use the following command for that. The command will determine the release version of your Ubuntu or Debian, and update /etc/apt/sources.list file accordingly.

$ sudo sh -c "echo 'deb '$(lsb_release -cs)' contrib non-free' > /etc/apt/sources.list.d/virtualbox.list"

Next, run the following commands to install VirtualBox.

$ wget -q -O- | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install virtualbox-4.2

Upgrade VirtualBox on Ubuntu or Debian

If you want to upgrade VirtualBox, go to Help -> "Check for Updates" on VirtualBox GUI menu.

If there is any new version of VirtualBox available, you will see the following pop-up window. This window can also pop up automatically when launching VirtualBox any time.

In order to upgrade VirtualBox, you can follow the exactly the same steps described above. As you already went through these steps during the first-time installation, upgrading VirtualBox is easier. Just run the following.

$ sudo apt-get update
$ sudo apt-get install virtualbox-4.2

VirtualBox will then be upgraded automatically to the latest version, 4.2.10 in this case.

When you restart VirtualBox after upgrade, you may be asked to upgrade VirtualBox Extension Pack as well. Click on "Download" to proceed.

Download the latest VirtualBox Extension Pack.

Install the latest VirtualBox Extension Pack.

When prompted, go ahead and upgrade VirtualBox Extension Pack.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

Leave a comment

Your email address will not be published. Required fields are marked *