How To

Install VirtualBox on Ubuntu from Ubuntu Repositories

The simplest approach is Ubuntu’s multiverse repository. A single command installs both VirtualBox and the Extension Pack together:

bashsudo apt updatesudo apt install virtualbox virtualbox-ext-pack

You will be prompted to review and accept the Extension Pack license during the process. Once accepted, both packages install automatically with no additional steps.

This method is ideal for users who want a fast, no-fuss setup. The trade-off is that Ubuntu’s packaged version may trail the latest official VirtualBox release by a version or two. For everyday development and testing, this is rarely a concern.

Get the Latest Version via Oracle Repository

To always have the most current VirtualBox release — including the latest drivers, features, and security patches, install directly from Oracle’s official APT repository.

Step 1: Import Oracle’s GPG signing keys so your system trusts packages from this source:

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

Both commands should output OK.

Step 2: Add the Oracle VirtualBox repository to your package sources:

bashecho "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib" | \     sudo tee -a /etc/apt/sources.list.d/virtualbox.list

The $(lsb_release -cs) variable automatically inserts your Ubuntu codename, focal for Ubuntu 20.04, for example.

Step 3: Update the package index and install:

bashsudo apt updatesudo apt install virtualbox-6.1

Tip: Visit the VirtualBox downloads page before installing to confirm the current version number. Adjust the package name accordingly — for example, virtualbox-7.0 for a newer release.

Add the VirtualBox Extension Pack

The VirtualBox Extension Pack unlocks additional capabilities for guest machines, including:

  • Virtual USB 2.0 and USB 3.0 device passthrough
  • Remote Desktop Protocol (RDP) access to guest VMs
  • Disk image encryption to protect sensitive VM data
  • NVMe storage and PXE network boot support

Make sure the Extension Pack version exactly matches your installed VirtualBox version, then download it:

bashwget https://download.virtualbox.org/virtualbox/6.1.8/Oracle_VM_VirtualBox_Extension_Pack-6.1.8.vbox-extpack

Install it with the VBoxManage utility:

bashsudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.8.vbox-extpack

Accept the Oracle license by typing y when prompted. A progress bar confirms when the Extension Pack has installed successfully.

Launch VirtualBox

Once installed, start VirtualBox directly from the terminal:

bashvirtualbox

Or open the Activities panel, search for “VirtualBox”, and click the icon. On first launch, the VirtualBox Manager window appears, your central control panel for creating virtual machines, adjusting CPU and memory allocation, and managing snapshots. From here you can spin up your first Windows or Linux guest within minutes.

VirtualBox gives you a powerful, free virtualization layer on Ubuntu with minimal setup. The Ubuntu repository method gets you running immediately; the Oracle repository keeps you on the latest release with a few extra steps. Either way, once VirtualBox is live, you can start building guest machines right away. Want to manage VMs entirely from the command line? Pair VirtualBox with Vagrant for a fully scripted workflow. Questions? Leave a comment below.

Cyber Defence

Recent Posts

Install Pip on Ubuntu 18.04: Python 3 and Python 2 Setup Guide

Pip is the official package manager for Python and the standard way to install libraries from…

1 day ago

Install R on Ubuntu 18.04 from CRAN: Statistical Computing Setup

R is an open-source programming language and environment built for statistical computing and data visualization. It…

1 day ago

Install Jenkins on Ubuntu 18.04: CI/CD Server Setup Guide

Jenkins is an open-source automation server that makes it easy to build CI/CD pipelines. Continuous integration…

1 day ago

Install Android Studio on Ubuntu 18.04 with Snap and OpenJDK 8

Android Studio is the official IDE for Android development, built on JetBrains' IntelliJ IDEA platform. It…

1 day ago

Install and Configure GitLab on Ubuntu 18.04 with Omnibus

GitLab is a web-based, open-source Git repository manager written in Ruby. It includes built-in tools for…

1 day ago

Install Anaconda on Ubuntu 18.04: Python Data Science Setup Guide

Anaconda is the most widely used Python distribution for data science and machine learning. It bundles…

2 days ago