Install VirtualBox 4.1.2 on Ubuntu

Install VirtualBox 4.1.2 on Ubuntu
In the previous article we have discussed how to install VirtualBox 4.0.10 on Ubuntu Natty, now we will discuss how to install the latest VirtualBox, VirtualBox 4.1.2. Actually, how to install both types of VirtualBox are not much different. Oops, before we discuss the installation steps, let see what is new in VirtualBox 4.1.2

VirtualBox 4.1.2's new items:
  • VMM: fixed 64-bit guests on AMD Fusion CPUs (bug #8824).
  • VMM: fixed handling of the sysenter/sysexit machine instructions in 64-bit guests on Intel hosts.
  • GUI: added linked clone support.
  • GUI: fixed error check when changing the VM controller settings (4.1.0 regression; bug #9246).
  • GUI: fixed the inclusion of additional information (license, vendor, …) on OVF export.
  • GUI: when taking a snapshot from the VM selector, don’t do a live snapshot.
  • GUI: fixed immediate crash during start on certain environments due to a library version conflict.
  • Guest control execution: implemented copying single files from guest to the host (directories and filters not supported yet).
  • Guest control execution: limited to serve up to 5 guest processes at a time by default.
  • Main: return the correct RDP default port fixing settings warnings in the GUI if the remote display was enabled at runtime (bug #9368), etc.

Here are step by step to install VirtualBox 4.1.2 on Ubuntu.
First, you must change the sources.list file:
gksudo gedit /etc/apt/sources.list
In the last line, add the following command:
deb natty contrib
For ubuntu 10.10 users add the following command:
deb maverick contrib non-free
Save and exit:
wget -q -O- | sudo apt-key add -
Perform updates for sourcelist we have modified:
sudo apt-get update
Command to install VirtualBox:
sudo apt-get install virtualbox-4.1

Please pay attention, when the linux kernel version updated during the next apt-get upgrade, your VirtualBox host kernel modules (vboxdrv, vboxnetflt, and vboxnetadp) will not work properly unless you install dkms package to ensure there are no problems with your VirtualBox. The dkms package can be installed through the Synaptic Package manager or through the following command:
sudo apt-get install dkms
That's all how to install VirtualBox 4.1.2 on Ubuntu. Hope it helps. Happy virtualizing...
Source: UbuntuGeek.