---
title: "Take Control of VMs and Install VirtualBox on Ubuntu 20.04"
description: "Learn to manage and control VMs for testing and development with VirtualBox on Ubuntu 20.04 in this ATA Learning tutorial!"
canonical: "https://adamtheautomator.com/virtualbox-on-ubuntu-2004/"
---

# Take Control of VMs and Install VirtualBox on Ubuntu 20.04

> Learn to manage and control VMs for testing and development with VirtualBox on Ubuntu 20.04 in this ATA Learning tutorial!

Source: https://adamtheautomator.com/virtualbox-on-ubuntu-2004/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Take Control of VMs and Install VirtualBox on Ubuntu 20.04](https://adamtheautomator.com/wp-content/uploads/2022/08/Take-Control-of-VMs-and-Install-VirtualBox-on-Ubuntu-20.04.jpg)

# Take Control of VMs and Install VirtualBox on Ubuntu 20.04

[![](https://secure.gravatar.com/avatar/2788bb1a3f735603f81eca51d68daec56a9d97e805a10268fb2c20afcc76b81b?s=192&d=mm&r=g)Nicholas Xuan Nguyen](https://adamtheautomator.com/author/nicholas-xuan-nguyen/)12 August 20229 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Ubuntu Limux](/tag/ubuntu-limux/)[VirtualBox](/tag/virtualbox/)[Virtualization](/tag/virtualization/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing VirtualBox on Ubuntu 20.04 via APT](#installing-virtualbox-on-ubuntu-2004-via-apt)
*   [Installing VirtualBox from Oracle’s Official Repository](#installing-virtualbox-from-oracles-official-repository)
*   [Install VirtualBox using a Deb Package](#install-virtualbox-using-a-deb-package)
*   [Creating Your First VM](#creating-your-first-vm)
*   [Attaching a Bootable Media](#attaching-a-bootable-media)
*   [Increasing VM’s Video Memory (VRAM) to Improve Performance](#increasing-vms-video-memory-vram-to-improve-performance)
*   [Conclusion](#conclusion)

A wise man once said, “With great power comes great responsibility.” The same can be said about virtual machines (VMs). VMs are gaining popularity because they offer a lot of power and flexibility. But all this power can be confusing for newcomers. Well, unless you have VirtualBox on Ubuntu 20.04 machine.

In this tutorial, you’ll learn how to install VirtualBox and how you can take control of your VMs without losing yourself in the process.

Ready? Start managing your VMs like a pro with VirtualBox!

## Prerequisites

This tutorial will be a hands-on demonstration. If you’d like to follow along, be sure you have the following:

*   An Ubuntu 20.04 system.

Related:[How to Install Ubuntu 20.04 \[Step-by-Step\]](https://adamtheautomator.com/install-ubuntu/)

*   A user account with sudo privileges – This tutorial uses a root account, but you can also use a regular account with sudo privileges.

> _If you use a non-root user, prepend sudo on each command in this tutorial._

*   An [SSH](https://adamtheautomator.com/ssh-chrome-extension/) client of your choice – This tutorial assumes that you’ve logged/SSH’d into your Ubuntu 20.04 system.

Related:[How to Set up the SSH Chrome Extension](https://adamtheautomator.com/ssh-chrome-extension/)

*   A minimum of 4GB of RAM – VirtualBox recommends at least 16GB for optimal performance.
    
*   A minimum of 20GB of free storage space – Each VM you create needs its own storage.
    

> _In real-world usage, the amount of memory and storage you need will depend on how many VMs you create and what you plan to do with them._

*   An OS image file (ISO) – This tutorial uses an ISO image of Windows 10 (32-bit).

## Installing VirtualBox on Ubuntu 20.04 via APT

The base repositories for Ubuntu 20.04 include VirtualBox, but it doesn’t come installed by default. The easiest way to install VirtualBox on Ubuntu is to use the APT package manager. This method works whether you’re using Ubuntu Desktop or Server.

> _Note that the version of VirtualBox in the repositories may not be the latest and greatest. But no worries. You can install the latest version using Oracle’s official repository, which you will learn about in the following section._

To install VirtualBox from the Ubuntu repositories using APT:

1\. Run the [apt update](https://linuxize.com/post/how-to-use-apt-command/#updating-package-index-apt-update) command below to update the list of available packages.

```bash
apt update -y
```

![Updating the list of available packages](https://adamtheautomator.com/wp-content/uploads/2022/08/image-61.png)

Updating the list of available packages

Related:[Learning Ubuntu Apt Get Through Examples](https://adamtheautomator.com/ubuntu-apt-get/)

2\. Next, run the below [apt install](https://linuxize.com/post/how-to-use-apt-command/#installing-packages-apt-install) command to install VirtualBox and the extended pack.

The extended pack is a set of additional features for VirtualBox that lets you use certain features, such as USB 2.0 and 3.0 support, Remote Desktop Protocol (RDP), etc.

Related:[Sure Fire Ways to Connect to VMs with Azure RDP](https://adamtheautomator.com/azure-rdp/)

```bash
apt install virtualbox virtualbox-ext-pack -y
```

![Installing VirtualBox and the extended pack](https://adamtheautomator.com/wp-content/uploads/2022/08/image-62.png)

Installing VirtualBox and the extended pack

3\. Select **OK**, and press Enter after reading the VirtualBox Extension Pack Personal Use and Evaluation License (PUEL) terms.

![Reading the VirtualBox Extension Pack Personal Use and Evaluation License (PUEL)](https://adamtheautomator.com/wp-content/uploads/2022/08/image-63.png)

Reading the VirtualBox Extension Pack Personal Use and Evaluation License (PUEL)

4\. Now, select **Yes**, and press Enter to accept the Oracle Binary Code License Agreement for the VirtualBox Extension Pack.

![Accepting the Oracle Binary Code License Agreement](https://adamtheautomator.com/wp-content/uploads/2022/08/image-64.png)

Accepting the Oracle Binary Code License Agreement

The installer will download and install all the necessary files, as shown below. Wait for the process to complete. That’s it! You’ve successfully installed VirtualBox on your machine using APT.

![Unpacking the VirtualBox extension pack](https://adamtheautomator.com/wp-content/uploads/2022/08/image-65.png)

Unpacking the VirtualBox extension pack

5\. Finally, run the following command to start using VirtualBox or open it from the Applications menu.

> _This step applies when opening VirtualBox regardless of which method you used to install the application in this tutorial._

```bash
virtualbox
```

The main VirtualBox Manager window appears, as shown below, where you can manage your VMs.

![Opening the VirtualBox](https://adamtheautomator.com/wp-content/uploads/2022/08/image-66.png)

Opening the VirtualBox

## Installing VirtualBox from Oracle’s Official Repository

You’ve learned to install VirtualBox using the APT package manager, a quick method. But that method has one major downside; you will not get the latest version of VirtualBox.

If you prefer to get the latest version of VirtualBox, you need to install it from Oracle’s official repository. Oracle releases new versions of VirtualBox frequently. Note that this method is a bit more complex than the previous one.

To install VirtualBox from Oracle’s official repository, you first need to add the Oracle repository key to your system:

1\. Run the wget command below to download and add the Oracle repository key to your keyring. This key ensures that the packages you install using this repository are valid and come from a trusted source.

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

![Adding the Oracle repository key to the keyring](https://adamtheautomator.com/wp-content/uploads/2022/08/image-67.png)

Adding the Oracle repository key to the keyring

Related:[Install Python Wget and Automate your File Downloads](https://adamtheautomator.com/python-wget/)

2\. Next, run the following [add-apt-repository](https://linuxize.com/post/how-to-add-apt-repository-in-ubuntu/) command to add the Oracle repository to your system. This repository contains the latest versions of VirtualBox for Ubuntu.

```bash
add-apt-repository "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -cs) contrib"
```

![Adding the Oracle repository to the system](https://adamtheautomator.com/wp-content/uploads/2022/08/image-68.png)

Adding the Oracle repository to the system

3\. After adding the repository, run the below apt update command to update the APT cache and apply the new changes.

```bash
apt update -y
```

![Updating APT cache to apply changes](https://adamtheautomator.com/wp-content/uploads/2022/08/image-69.png)

Updating APT cache to apply changes

4\. Run the [apt cache](https://debian-handbook.info/browse/stable/sect.apt-cache.html) command to check which version of VirtualBox is available in the official repositories.

```bash
apt-cache policy virtualbox
```

Pick the latest version of VirtualBox from the list to install.

![Checking available VirtualBox versions from the repositories](https://adamtheautomator.com/wp-content/uploads/2022/08/image-70.png)

Checking available VirtualBox versions from the repositories

5\. Now, run the apt install command to install the latest VirtualBox version you picked from step four.

```bash
apt install virtualbox-6.1 -y
```

![Installing VirtualBox from Oracle’s official repository](https://adamtheautomator.com/wp-content/uploads/2022/08/image-71.png)

Installing VirtualBox from Oracle’s official repository

Alternatively, you can copy and paste the apt install virtualbox- command to your terminal and press Tab to autocomplete the version number.

All the versions currently available will be displayed, as shown below. Choose the newest one to install. This behavior works for any supported Ubuntu release and VirtualBox version combination.

![Auto-completing VirtualBox versions](https://adamtheautomator.com/wp-content/uploads/2022/08/image-72.png)

Auto-completing VirtualBox versions

6\. Next, run the following command to download the VirtualBox Extension Pack. Ensure the version number of the extension pack matches the version of VirtualBox you just installed (6.1).

> _You can find the_ [_download link for the extension pack_](https://www.virtualbox.org/wiki/Downloads) _on the same page where you found the download link for VirtualBox._

```bash
wget https://download.virtualbox.org/virtualbox/6.1.26/Oracle_VM_VirtualBox_Extension_Pack-6.1.26.vbox-extpack
```

![Downloading the VirtualBox Extension Pack](https://adamtheautomator.com/wp-content/uploads/2022/08/image-73.png)

Downloading the VirtualBox Extension Pack

7\. Lastly, run the [VBoxManage](https://www.virtualbox.org/manual/ch08.html) command below to install the VirtualBox Extension Pack.

```bash
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.1.26.vbox-extpack
```

Type y and press Enter when prompted to agree to the terms, as shown below.

![Installing the VirtualBox Extension Pack](https://adamtheautomator.com/wp-content/uploads/2022/08/image-74.png)

Installing the VirtualBox Extension Pack

## Install VirtualBox using a Deb Package

If you’re not a fan of adding third-party repositories to your system, you can install VirtualBox using a deb package. You can download the deb package from Oracle and install it manually on your system.

To install VirtualBox from a .deb package:

1\. Open your favorite web browser, head to the VirtualBox Linux [downloads](https://www.virtualbox.org/wiki/Linux_Downloads) page, and look for your Linux distribution. This tutorial goes for the VirtualBox 6.1.34 for Ubuntu 20.04.

Right click on the hyperlink, as shown below, and choose Copy link address to copy the download link.

![Copying the download link for the VirtualBox deb package](https://adamtheautomator.com/wp-content/uploads/2022/08/image-75.png)

Copying the download link for the VirtualBox deb package

2\. Now run the wget command to download the .deb package. Replace the link below with the download link you copied in step one.

The -P option is used to specify the destination directory, which in this case is the Downloads folder.

```bash
wget https://download.virtualbox.org/virtualbox/6.1.34/virtualbox-6.1_6.1.34-150636.1~Ubuntu~eoan_amd64.deb -P Downloads
```

![Downloading the VirtualBox deb package](https://adamtheautomator.com/wp-content/uploads/2022/08/image-76.png)

Downloading the VirtualBox deb package

3\. Now, run the following commands to switch to the Downloads directory and install VirtualBox.

```bash
cd Downloads
dpkg -i Downloads/virtualbox-6.1_6.1.34-150636.1~Ubuntu~eoan_amd64.deb
```

![Installing VirtualBox using the deb package](https://adamtheautomator.com/wp-content/uploads/2022/08/image-77.png)

Installing VirtualBox using the deb package

> _If you get an error saying that some dependencies are not satisfied, run the following command to fix them._
> 
> _apt-get install -f_

## Creating Your First VM

You’ve successfully installed VirtualBox on your machine and are ready to create your first VM. This tutorial uses a Windows 10 image to create a VM, but you can choose any you prefer.

To create your first VM:

1\. Launch VirtualBox if it’s not already open.

2\. Click the **New** button on the toolbar to create a new VM.

![Initiating creating a new VM](https://adamtheautomator.com/wp-content/uploads/2022/08/image-78.png)

Initiating creating a new VM

3\. Configure the name and operating system (OS) for your VM with the following:

*   **Name** – Provide a name for your VM. This tutorial’s choice is **W10**.
    
*   **Machine Folder** – Choose the folder where you want your VM to reside.
    

> _By default, your VM files are stored in the home directory under the VirtualBox directory._

*   **Type** – Select the type of OS for your VM. This tutorial’s choice is Windows 10 (32-bit).
    
*   Click **Next** to continue.
    

![Creating Your First VM](https://adamtheautomator.com/wp-content/uploads/2022/08/image-79.png)

Creating Your First VM

4\. Now, specify how much memory (RAM in MB) you want to allocate for your VM, and click Next.

![Allocating the VM’s memory](https://adamtheautomator.com/wp-content/uploads/2022/08/image-80.png)

Allocating the VM’s memory

5\. Select the **Create a virtual hard** disk now option on the next screen, and click **Create**.

This option lets you create a virtual hard disk (a file) that stores all the data for your VM, including the operating system, applications, and files.

![Creating a virtual hard disk](https://adamtheautomator.com/wp-content/uploads/2022/08/image-81.png)

Creating a virtual hard disk

6\. Next, choose the **VDI (VirtualBox Disk Image)** option, which is a good choice for most users, and click **Next**.

But if you’re running VirtualBox on an enterprise environment, choose one of the other two options instead.

![Selecting a hard disk file type](https://adamtheautomator.com/wp-content/uploads/2022/08/image-82.png)

Selecting a hard disk file type

7\. On the next screen, choose the storage type for your virtual hard disk. But for this tutorial, select the default option (Dynamically allocated) and click Next.

Why use dynamic allocation? This option is more efficient with storage space because it only allocates the amount of disk space the VM uses.

![Selecting the VM’s storage type](https://adamtheautomator.com/wp-content/uploads/2022/08/image-83.png)

Selecting the VM’s storage type

8\. Choose a name for the virtual hard disk, allocate the storage space for your VM, and click Create. You can choose the storage size you prefer, but this tutorial’s choice is 20 GB.

![Allocating 20 GB of space for the VM](https://adamtheautomator.com/wp-content/uploads/2022/08/image-84.png)

Allocating 20 GB of space for the VM

Once the VM is created, you’ll see the VM listed in the left pane of the VirtualBox window.

![Verifying the new VM](https://adamtheautomator.com/wp-content/uploads/2022/08/image-85.png)

Verifying the new VM

## Attaching a Bootable Media

You’ve just created your first VM on VirtualBox. But right now, even if you start the VM, it won’t do anything since you haven’t attached any bootable media to the VM.

To attach a bootable media to your VM:

1\. Click on your VM in the left pane, and click Settings from the toolbar to access your VM’s settings.

![Accessing the VM’s settings](https://adamtheautomator.com/wp-content/uploads/2022/08/image-86.png)

Accessing the VM’s settings

2\. On the Settings window, click Storage in the left pane —> Empty drive under Storage Devices —> the disc icon under Attributes.

A context menu opens where you can choose how to attach a bootable media for the VM (step three).

![Accessing bootable media options](https://adamtheautomator.com/wp-content/uploads/2022/08/image-87.png)

Accessing bootable media options

3\. Select Choose disk file from the dropdown menu to look up your bootable media (ISO).

![Choosing a disk file as the bootable media](https://adamtheautomator.com/wp-content/uploads/2022/08/image-88.png)

Choosing a disk file as the bootable media

4\. Now, locate and select your ISO image file.

![Locating the Windows 10 ISO file](https://adamtheautomator.com/wp-content/uploads/2022/08/image-89.png)

Locating the Windows 10 ISO file

5\. Click OK to close the Settings window.

![Saving the settings changes](https://adamtheautomator.com/wp-content/uploads/2022/08/image-90.png)

Saving the settings changes

6\. Lastly, click Start at the toolbar to start your new VM.

![Starting the new VM](https://adamtheautomator.com/wp-content/uploads/2022/08/image-91.png)

Starting the new VM

You’ll see a new window open with your VM booting up. At this point, you can install your OS ([Windows 10](https://www.digitalcitizen.life/how-install-windows-10/)) as you usually would on a local machine.

After installing the OS, you can boot up your VM and use it just like any other computer.

![Starting up the VM to set up its operating system](https://adamtheautomator.com/wp-content/uploads/2022/08/image-92.png)

Starting up the VM to set up its operating system

## Increasing VM’s Video Memory (VRAM) to Improve Performance

Did you notice slowness on your VM after setting up its OS? By default, the VRAM allocated to a VM is only 128 MB, which is also the max VRAM you can allocate, as shown below.

![Showing max VRAM to allocate](https://adamtheautomator.com/wp-content/uploads/2022/08/image-93.png)

Showing max VRAM to allocate

This amount of VRAM is fine if you have only one or two windows open. But, if you try to do anything graphics-intensive, like testing your video games on different OS, you’ll need more VRAM.

To increase the video memory for your VM:

1\. Click on the Machine menu —> ACPI Shutdown, as shown below, or press Host+H keys to shutdown your VM. The Host key is the right Ctrl key on your keyboard.

![Shutting down the VM](https://adamtheautomator.com/wp-content/uploads/2022/08/image-94.png)

Shutting down the VM

2\. Next, run the below command to increase (modifyvm) your VM’s VRAM to 256. This command doesn’t provide output but sets your VM’s max VRAM to 256. Be sure to replace W10 with your VM’s name.

> _Note that 256MB is the maximum video memory you can allocate._

```bash
VBoxManage modifyvm "W10" --vram 256
```

3\. Start your VM again, and you’ll notice the difference in performance.

4\. Finally, open VM’s settings, click on Display in the left pane and see the Video Memory is set to 256 MB, as shown below. This output indicates that your Windows 10 VM’s video adapter now uses 256 MB of video memory.

> _You can experiment with different amounts of video memory to find the sweet spot for your needs. But remember that you can’t allocate more than 256 MB of video memory to a VM._

![Verifying new VRAM allocation](https://adamtheautomator.com/wp-content/uploads/2022/08/image-95.png)

Verifying new VRAM allocation

## Conclusion

In this tutorial, you’ve learned how to install VirtualBox on your Ubuntu 20.04 system and create your first VM. You’ve also improved performance by increasing your VM’s VRAM to your liking. With these skills, you can test different OSs and run multiple VMs simultaneously without any slowdown.

VirtualBox, no doubt, is one of the best virtualization software available. This software is free, open-source, and cross-platform.

Many system administrators and developers [use VirtualBox with a local Kubernetes](https://www.youtube.com/watch?v=EHDDm_iR1Fs) cluster for development and testing purposes. Would you do the same?

Related:[Master Installing Kubernetes on Ubuntu](https://adamtheautomator.com/installing-kubernetes-on-ubuntu/)

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fvirtualbox-on-ubuntu-2004%2F&text=Take%20Control%20of%20VMs%20and%20Install%20VirtualBox%20on%20Ubuntu%2020.04)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fvirtualbox-on-ubuntu-2004%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fvirtualbox-on-ubuntu-2004%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2023/06/vbox-usb-passthrough.jpg)

### [Enabling VirtualBox (VBox) USB Passthrough to Access Devices](/vbox-usb-passthrough/)

Utilize devices through VirtualBox (VBox) USB Passthrough and take advantage of external devices from the virtualized OS.

![](https://adamtheautomator.com/wp-content/uploads/2022/11/vmware-ubuntu-install.jpg)

### [Learning Linux Virtualization With a VMware Ubuntu Install](/vmware-ubuntu-install/)

Learn how to get started with virtualization through a VMware Ubuntu install and make your development and testing life easier!

![](https://adamtheautomator.com/wp-content/uploads/2022/11/Crafting-a-Virtual-Machine-with-Proxmox-VE.jpg)

### [Crafting a Virtual Machine with Proxmox VE](/proxmox-ve/)

Discover how to utilize Proxmox VE and craft whole environments for testing and for production systems in this ATA Learning tutorial!

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
