Install Virtualbox in Ubuntu 14.04 / 13.10 / 13.04 / 12.04 using PPA

VirtualBox is a powerful Open Source virtualization software from Oracle, Which supports Linux, Windows and Mac OS. Current stable release is VirtualBox 4.3.

Recommended way of installing Virtualbox in Ubuntu / Linux Mint is by adding PPA to your repository.

Dependency

First install the dependency package to avoid error.

sudo apt-get install dkms

To add PPA

Open a terminal and run the following command to download and  install the key from Oracle. Issue the password for the user when prompted.

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

After installing the Oracle public key, use the below command to add it to your repository.

For Ubuntu 14.04

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian trusty contrib" >> /etc/apt/sources.list.d/virtualbox.list'

For Ubuntu 13.10

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian saucy contrib" >> /etc/apt/sources.list.d/virtualbox.list'

For Ubuntu 13.04

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian raring contrib" >> /etc/apt/sources.list.d/virtualbox.list'

For Ubuntu 12.10

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian quantal contrib" >> /etc/apt/sources.list.d/virtualbox.list'

For Ubuntu 12.04

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian precise contrib" >> /etc/apt/sources.list.d/virtualbox.list'

For Ubuntu 11.10

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian oneiric contrib" >> /etc/apt/sources.list.d/virtualbox.list'

For Ubuntu 11.04

sudo sh -c 'echo "deb http://download.virtualbox.org/virtualbox/debian natty contrib" >> /etc/apt/sources.list.d/virtualbox.list'

Once you added the repo using the above command, Update your repository.

sudo apt-get update

To Install

Now install the virtualbox 4.3 using the below command.

sudo apt-get install virtualbox-4.3

To install the previous version just replace 4.3 to 4.2 / 4.1 / 4.0 / 3.2 in the above command.

To Open

Go to dash and type Virtualbox, click on the icon. Check the screen shot.

Ubuntu_VirtualboxPermanently add virtualbox icon to unity launcher by right-click on it and lock to Launcher. Check the screen shot.

virtualbox_Ubuntucheck how to manage virtualbox commandline.

Hope this will be helpful for you!!!

Related Posts Plugin for WordPress, Blogger...

  • Nausser

    after doing all this on my 13.04 machine, I get this error:

    “Kernel driver not installed (rc=-1908)

    The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel module by executing

    ‘/etc/init.d/vboxdrv setup’

    as root. If it is available in your distribution, you should install the DKMS package first. This package keeps track of Linux kernel changes and recompiles the vboxdrv kernel module if necessary.”

    When running the above script, I get:

    ” * Stopping VirtualBox kernel modules [ OK ]

    * Uninstalling old VirtualBox DKMS kernel modules [ OK ]

    * Trying to register the VirtualBox kernel modules using DKMS Error! Your kernel headers for kernel 3.8.0-22-generic cannot be found.

    Please install the linux-headers-3.8.0-22-generic package,

    or use the –kernelsourcedir option to tell DKMS where it’s located

    * Failed, trying without DKMS

    * Recompiling VirtualBox kernel modules

    * Look at /var/log/vbox-install.log to find out what went wrong”

    The log file is as stated:

    ” * Stopping VirtualBox kernel modules [ OK ]

    * Uninstalling old VirtualBox DKMS kernel modules [ OK ]

    * Trying to register the VirtualBox kernel modules using DKMS Error! Your kernel headers for kernel 3.8.0-22-generic cannot be found.

    Please install the linux-headers-3.8.0-22-generic package,

    or use the –kernelsourcedir option to tell DKMS where it’s located

    * Failed, trying without DKMS

    * Recompiling VirtualBox kernel modules

    * Look at /var/log/vbox-install.log to find out what went wrong”

    Please advise.

    • HowOpenSource

      Hi Nausser,

      First install the Linux headers generic using the below command

      sudo apt-get install linux-headers-generic

      then run ” sudo /etc/init.d/vboxdrv setup”

  • DrDan

    I have basically the same problem but it continues after installing linux-headers-generic and then running /etc/init.d/vboxdrv setup I get:

    root@Office:/home/dan# /etc/init.d/vboxdrv setup

    * Stopping VirtualBox kernel modules [ OK ]

    * Uninstalling old VirtualBox DKMS kernel modules [ OK ]

    * Trying to register the VirtualBox kernel modules using DKMS Error! Your kernel headers for kernel 3.5.0-26-generic cannot be found.

    Please install the linux-headers-3.5.0-26-generic package,

    or use the –kernelsourcedir option to tell DKMS where it’s located

    * Failed, trying without DKMS

    * Recompiling VirtualBox kernel modules

    * Look at /var/log/vbox-install.log to find out what went wrong

    vbox-install.log says:

    Uninstalling modules from DKMS

    removing old DKMS module vboxhost version 4.2.16

    ——————————

    Deleting module version: 4.2.16

    completely from the DKMS tree.

    ——————————

    Done.

    Attempting to install using DKMS

    Creating symlink /var/lib/dkms/vboxhost/4.2.16/source ->

    /usr/src/vboxhost-4.2.16

    DKMS: add completed.

    Failed to install using DKMS, attempting to install without

    Makefile:181: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR= and run Make again. Stop.

    How do I specify KERN_DIR? Or how can I get my VM to run again.

  • Ricardo Ramos de Oliveira
  • The “-4.3″ in “sudo apt-get install virtualbox-4.3″ makes the command not to work in mine

  • mrzeeusa

    vboxusers:x:125:

    # usermod -G 124

  • mrzeeusa

    one more thing for easy install apt-get instal aptitude and then aptitude install virtualbox auto resolve dependencies.

  • WheatleyOS

    I accidentally typed “sudo sh -c ‘echo “deb htto://download.virtualbox.org/virtualbox/debian precise contrib” >> /etc/apt/sources.list.d/virtualbox.list'”

    Notice the “htto”. Now _whenever_ I type sudo apt-get update it shows error message below:

    “E: The method driver /usr/lib/apt/methods/htto could not be found.”

    how do I fix this issue? Even after restarting ubuntu I can no longer successfully run “sudo apt-get update” :S
    Thanks in advance

  • WheatleyOS

    I accidentally typed “sudo sh -c ‘echo “deb htto://download.virtualbox.org/virtualbox/debian precise contrib” >> /etc/apt/sources.list.d/virtualbox.list'”

    Notice the “htto”. Now _whenever_ I type sudo apt-get update it shows error message below:

    “E: The method driver /usr/lib/apt/methods/htto could not be found.”

    how do I fix this issue? Even after restarting ubuntu I can no longer successfully run “sudo apt-get update” :S
    Thanks in advance

    I’m reposting this as a signed in user so that I get notified in my email inbox from any potential reply, and as a signed in user, sry :p

    • Neil Blenkiron

      sudo nano /etc/apt/sources.list.d/virtualbox.list

      Correct the error. then:

      Control X to exit nano
      Y to agree to save the changes
      Press enter to complete the process

      sudo apt-get update

      and take it from there

      • WheatleyOS

        Thanks for the help :). Although I already got my problem fixed somehow else (by someone I know). They told me (and they are far more experienced with Linux than I am – a relative who I don’t live with – and they told me that it’s a terrible idea to run the command, given; “wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -” because it is easy to corrupt the system by running sudo within a wget command by mistyping like I did. (Also I was unaware that you can in fact copy/paste, but you also need to add “Shift” to “Ctrl+V”

  • You now need to install virtualbox 5.0 manual to upgrade to the latest version:

    sudo apt-get install virtualbox-5.0
    Then it will be updated as usual with dist-upgrade.

  • Stevo Pusser

    Every outside repository is not a PPA!