VirtualBox is a free, open-source, cross-platform virtualization application maintained by Oracle. It lets you run multiple guest operating systems simultaneously on a single machine, each in its own isolated virtual environment. Common uses include testing software on different operating systems, running Windows applications on Ubuntu, setting up sandboxed development environments, and building server configurations that mirror production without risk to your host machine.
This guide covers how to install VirtualBox on Ubuntu 18.04 using two methods: the Oracle repository, which always provides the latest release, and the Ubuntu multiverse repository, which is simpler but may lag by a version. The same steps apply to Ubuntu 16.04, Linux Mint, and Elementary OS.
<strong>Prerequisite:</strong> You need sudo access.
The Oracle repository gives you the most current VirtualBox release. At the time of writing, the latest stable version is VirtualBox 6.0.
Import the Oracle GPG keys. VirtualBox uses two separate signing keys — both must be imported:
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 print OK to confirm successful import. Packages from the repository will be trusted by apt once both keys are in place.
Add the VirtualBox repository:
bashsudo add-apt-repository "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
The $(lsb_release -cs) part detects your Ubuntu codename automatically, for example bionic for Ubuntu 18.04.
Install VirtualBox:
bashsudo apt updatesudo apt install virtualbox-6.0
The Extension Pack adds features that are not included in the base VirtualBox package: virtual USB 2.0 and 3.0 device support, Remote Desktop Protocol (RDP), and virtual disk image encryption. Without it, USB devices plugged into the host machine are not accessible inside the VM, and RDP-based remote management is not available.
Download the Extension Pack that matches your VirtualBox version exactly:
bashwget https://download.virtualbox.org/virtualbox/6.0.0/Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack
Install it with VBoxManage:
bashsudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.0.vbox-extpack
The Oracle license is displayed. Type y and press Enter to accept. The Extension Pack installs and confirms success with a 100% progress bar.
Ubuntu repository method. If you do not need the absolute latest version, the Ubuntu multiverse repository is a simpler one-command install. It also includes the Extension Pack automatically:
bashsudo apt updatesudo apt install virtualbox virtualbox-ext-pack
Launch VirtualBox. Open it from the Activities menu by searching for “Oracle VM VirtualBox,” or start it from the terminal:
bashvirtualbox
The VirtualBox Manager window opens. Click New to create a virtual machine. You configure RAM, virtual CPUs, video memory, network adapters, and storage during setup. VirtualBox supports both dynamically-allocated disk images, which grow as data is written, and fixed-size images, which allocate all space up front for better performance.
VirtualBox is now installed on your Ubuntu 18.04 machine. Visit the VirtualBox documentation to learn how to configure shared folders, manage snapshots, and set up host-only networks. Leave a comment below if you run into any issues.
PostgreSQL (also called Postgres) is a free, open-source, object-relational database management system with a strong reputation…
VMware Workstation Player is a mature, stable virtualization platform that lets you run multiple isolated operating…
A properly configured firewall is one of the most important layers of security for any internet-facing server. UFW (Uncomplicated Firewall) is a user-friendly front-end for managing iptables rules that ships pre-installed on Ubuntu. Its defaults are sensible: block all incoming connections, allow all outgoing connections. No outside traffic reaches your server unless you explicitly open a port. This guide covers how to configure a UFW firewall on Ubuntu 18.04, from setting default policies and application profiles to writing allow and deny rules for specific ports, IPs, and subnets. <strong>Prerequisite:</strong> You need sudo access. Configure UFW Firewall on Ubuntu: Defaults, SSH, and Application Profiles If UFW is not installed, add it with: bashsudo…
UFW (Uncomplicated Firewall) is a user-friendly front-end for managing iptables rules on Ubuntu. It ships pre-installed…
Apache Cassandra is a free, open-source NoSQL database designed for high availability and linear scalability with…
Rocket.Chat is a free, open-source team communication platform built with the Meteor framework. It is a…