How To

Install VirtualBox on Ubuntu 18.04 from the Oracle Repository

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>&nbsp;You need sudo access.

Install VirtualBox on Ubuntu: Add the Oracle Repository

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

Install the VirtualBox Extension Pack

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.

Install VirtualBox from Ubuntu Repositories or Launch the Application

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.

Cyber Defence

Recent Posts

Install PostgreSQL on Ubuntu 18.04 with Remote Access Setup

PostgreSQL (also called Postgres) is a free, open-source, object-relational database management system with a strong reputation…

1 hour ago

Install VMware on Ubuntu 18.04: Workstation Player Setup Guide

VMware Workstation Player is a mature, stable virtualization platform that lets you run multiple isolated operating…

1 hour ago

Set Up a UFW Firewall on Ubuntu 18.04: Allow, Deny, and Manage

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>&nbsp;You&nbsp;need&nbsp;sudo&nbsp;access. Configure UFW Firewall on Ubuntu: Defaults, SSH, and Application Profiles If UFW is not installed, add it with: bashsudo…

1 hour ago

Disable UFW Firewall on Ubuntu 18.04: Stop, Reset, and Re-enable

UFW (Uncomplicated Firewall) is a user-friendly front-end for managing iptables rules on Ubuntu. It ships pre-installed…

2 hours ago

Install Apache Cassandra on Ubuntu 18.04: NoSQL Setup Guide

Apache Cassandra is a free, open-source NoSQL database designed for high availability and linear scalability with…

1 day ago

Install Rocket.Chat on Ubuntu 18.04 with Nginx and Let’s Encrypt

Rocket.Chat is a free, open-source team communication platform built with the Meteor framework. It is a…

1 day ago