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.
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.0for a newer release.
The VirtualBox Extension Pack unlocks additional capabilities for guest machines, including:
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.
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.