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 Docker Compose on Ubuntu: Step-by-Step Setup Guide

Docker Compose is a command-line tool that lets you define and run multi-container Docker applications using a single…

4 minutes ago

Install Vagrant on Ubuntu: Setup and Getting Started Guide

If your team needs identical development environments across different operating systems, Vagrant is the tool that makes…

18 minutes ago

Install GCC on Ubuntu: build-essential and Multiple Versions

GCC; the GNU Compiler Collection is the backbone of open-source software development on Linux. It supports…

31 minutes ago

Install Redis on Ubuntu: Configuration and Remote Access

Redis is an open-source, in-memory key-value store built for raw speed and versatility. It works equally well as…

22 hours ago

Install Skype on Ubuntu: Two Methods That Actually Work

Skype doesn't ship with Ubuntu by default it's a proprietary application owned by Microsoft and…

22 hours ago

Install PHP on Ubuntu: Complete Setup Guide for Apache & Nginx

PHP is the backbone of the web. Frameworks like Laravel, WordPress, and Magento all run on…

22 hours ago