We have a new version of VirtualBox and want to try it. The steps to install VirtualBox 4.0 on your machine are very simple. Before if we have installed any previous version should remove it from our system. With an open terminal write the following commands:

echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox4.0.list

Which VirtualBox repository added to our system. The command is valid for all the recent versions of Ubuntu. Then write in the terminal to add the pgp key valid Oracle files to download from the repository, the following command:

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

And finally, we update and install with:

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

So VirtualBox is installed and ready for use in Applications -> System Tools -> Oracle VM VirtualBox