3 Ways to install VirtualBox in Ubuntu

 Posted by:   Posted on:   Updated on:  2023-01-07T21:28:14Z

How to install VirtualBox in Ubuntu Linux: from the default repositories, from Oracle repositories or manually from deb file.

VirtualBox is a free virtualization software developed by Oracle. It runs on and can run all major operating systems. If your host computer has enough resources, VirtualBox can run multiple virtual machines at a time. It can also take screenshots and record screen of virtual machines. Overall it is a great tool for anyone looking to test new operating systems without making any changes to the host computer.

This post will describe three installation procedures for Linux (Ubuntu). You can install VirtualBox from the default repositories, from Oracle repositories or from deb file. Each has its advantages and disadvantages. Of course, the best method is the one that brings you the best results.

VirtualBox main window screenshot
VirtualBox main window

1. Default repository

This is the easiest way to install VirtualBox. You can do it from the software center, from Synaptic Package Manager or from Terminal. In this way you will get a version that may sometimes be a little outdated, but tested with the OS version you are running. This may be the best option if you're looking for compatibility and stability. Before installing you should know that the virtualbox package only recommends (not requires) the Guest Additions ISO image and will not download it unless you select the package. Anyway, there should be no issue, because when you try to use Guest Additions, it will prompt you to download it.

VirtualBox GuestAdditions ISO download prompt
VirtualBox GuestAdditions ISO download
If you want to go with this method, open a Terminal and run these commands:
sudo apt-get update && sudo apt-get install dkms virtualbox virtualbox-guest-additions-iso

2. Oracle repository

Using this method you will get the newest VirtualBox version every time it is released. You need to add the Oracle repository to your sources.list file and install the virtualbox-5.0 package. Copy and paste this in Terminal:
sudo apt-add-repository 'deb http://download.virtualbox.org/virtualbox/debian wily contrib' && wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - && sudo apt-get update && sudo apt-get install virtualbox-5.0
Replace wily with the codename of your Ubuntu version. This method is recommended if you want to get the newest features and keep your VirtualBox installation updated.

3. Package

You can also install VirtualBox by downloading the correct package for your system version and architecture and unpacking it. For this you should go to the Linux Downloads page for VirtualBox and choose the suitable package. After you download it, open a Terminal in the download directory, paste and run these commands:
sudo apt-get update && sudo apt-get install dkms && sudo dpkg -i virtualbox*.deb && sudo apt-get install -f
In this way you can install whatever version you choose (the one that works best for you) and you will get no updates.

These are the three ways to install VirtualBox in Ubuntu. You can now test and install different operating systems. These installation methods apply to other software too (default repository, developer repository or manual installation).

No comments :