How to Install VirtualBox on Ubuntu

Configurare noua (How To)

Situatie

Oracle’s free and open-source offering VirtualBox is an excellent virtualization tool, especially for desktop operating systems. You can use virtualization software like VirtualBox for installing and using another operating system within a virtual machine. You can also use VirtualBox for installing another Linux distribution within your current Linux system.

The easiest way to install VirtualBox on Ubuntu is to search for it in the Software Center and install it from there.

VirtualBox in Ubuntu Software Center

You can also install it from the command line using this command:

sudo apt install virtualbox

However, if you check the package version before installing it, you’ll see that the VirtualBox provided by Ubuntu’s repository is quite old.

For example, the current VirtualBox version at the time of writing is 7.0, but the one in Software Center is 6.2. This means you won’t get the newer features introduced in the latest version of VirtualBox.

Install VirtualBox using deb file from Oracle’s website

If you want to use the latest version of VirtualBox on Ubuntu, the easiest way would be to use the deb file. Oracle provides ready-to-use binary files for VirtualBox releases. If you look at its download page, you’ll see the option to download the deb installer files for Ubuntu and other distributions.

You just have to download this deb file and double-click on it to install it. It’s as simple as that. However, the problem with this method is that you won’t get automatically updated to newer VirtualBox releases. The only way is to remove the existing version, download the newer version and install it again.

Install VirtualBox using Oracle’s repository

First, add the key for the repository. You can download and add the key using this single command.

wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

Important for Mint users

The next step will work for Ubuntu only. If you’re using Linux Mint or some other distribution based on Ubuntu, replace $(lsb_release -cs) in the command with the Ubuntu version your current version is based on. For example, Linux Mint 19 series users should use bionic and Mint 18 series users should use xenial. Something like this:

sudo add-apt-repository “deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian bionic contrib“

Now add the Oracle VirtualBox repository to the list of repositories using this command:

sudo add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"

If you see an add-apt-repository command not found error, you’ll have to install the software-properties-common package.

Now that you have the correct repository added, refresh the list of packages available through these repositories and install VirtualBox.

sudo apt update && sudo apt install virtualbox-7.0

Solutie

Tip solutie

Permanent

Voteaza

(6 din 14 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?