Overview

This tutorial provides instructions for installing the latest Ubuntu LTS (Long Term Support) version using VirtualBox.

At the time of this writing, the current LTS is 24.04.

Video covers older installation

Note that the video linked above covers an older LTS, so the user interface of both VirtualBox and Ubuntu will differ from the most recent release.

Outcomes

  • Produce a working installation (virtual machine) of Ubuntu LTS

Prerequisites

Important note

A note to ARM64 users

Recent versions of VirtualBox now support ARM64 CPU architecture (ex. a Mac M series); however, if you're on a Mac, you can install Docker Desktop directly and execute the provided commands in the terminal to follow along in the course. If you're unsure if your Mac has an ARM64 CPU, see this article from Apple. Note the CLI commands used throughout the course tutorials will not work as-is in Windows PowerShell. Windows users should install Ubuntu (either via VirtualBox or natively on a separate partition). An alternative for Windows users is to use the Windows Subsystem for Linux (WSL). Installation and configuration using WSL is not a route that is currently covered in this tutorial, so proceed at your own peril 🧙.

Background

This section provides a bit of background on the key technologies involved in this tutorial.

What's Linux?

Linux is a common core or kernel shared by a class of operating systems (OS). Commonly, however, people simply use Linux to refer to operating systems that use the Linux kernel.

History/Lineage

Linux was developed by Linus Torvalds in the 1990s as an extension to the GNU operating system (which in turn was a rewrite of AT&T's Unix OS).

What's VirtualBox?

VirtualBox is a free, cross-platform (AMD64 CPUs running MacOS, Windows, Linux, etc.) application for software virtualization that allows you to run multiple guest operating systems (virtual machines) at the same time on a single host OS (the OS of the physical machine on which VirtualBox is running). If something goes wrong with a virtual machine (for example, perhaps you're experimenting with a completely new OS), you can safely delete or replace it without damaging your host OS.

Why use Linux?

Why is this necessary?

Many of the tools we will use were developed on Linux-based OS. This course uses a Linux-based development environment. For the sake of uniformity, we'll be using the latest Ubuntu Desktop LTS which is a Debian-based Linux distribution.

Prerequisites

Before starting, ensure that ...

  • you have a machine with at least 8GB of RAM and 50GB of free space

Part 1: Installing VirtualBox

Follow this link and install VirtualBox according to the instructions provided for your operating system (OS).

Checking the version of VirtualBox

  1. Click VirtualBox About VirtualBox. You can check the version in the window that launches.

virtualbox-version

Part 2: Downloading Ubuntu LTS

  1. Open the Ubuntu Desktop LTS (Long Term Support) release page in your computer's web browser. You can download the Ubuntu disk image (also known as an ISO file) here.
Check your platform version

Be sure to select the .iso file for the appropriate platform architecture for your machine (AMD64 or ARM64). AMD64 will have the -amd64.iso suffix, while ARM64 will use the -arm64.iso suffix.

Alternatively, you can use one of the following links:

  1. After confirming that the platform architecture of your ISO file, click Download.

ubuntu-download

Part 3: Creating a virtual machine (VM) using VirtualBox

  1. Open VirtualBox (instructions vary depending on your host OS). If it's your first time opening VirtualBox, select the Basic mode.

virtualbox-basic-mode

  1. Click Create a new virtual machine (VM).

create-new-vm

  1. Enter a name for your virtual machine. Since we're installing an Ubuntu LTS, I'll enter 'ubuntu-hlt'. Note that VirtualBox automatically changes OS to Linux and OS Distribution to Ubuntu. These two options are what we need, so keep those settings. Note that the value of OS Version will depend on your CPU architecture (ex. Ubuntu (ARM/AMD 64-bit)). In the ISO Image dropdown, select the Ubuntu LST .iso file that you downloaded in the previous step. Click Continue.

virtualbox-vm-name-and-os

  1. Select the amount of RAM to use for the virtual machine (VM). Click and drag the slider left or right to decrease or increase the amount of RAM, number of CPUs, and disk space that VirtualBox will make available to your Ubuntu VM. Click Continue.
  • The "ideal" amount of RAM will automatically be selected when you get to this page.
Don't max out your resources

Make sure not to maximize the values for these fields, as the host machine (your computer) also needs resources. If you allocate too large a percentage of your system resources to your VM, your host machine will perform sluggishly (or grow nonresponsive) while your VM is running.

virtualbox-vm-resources
Try to allocate at least 4GB of RAM to your VM and 50 GB of storage.

  1. Review the values and click Finish.

virtualbox-vm-settings

Need to adjust resources?

If you'd like to adjust your system resource allocations, you can do so by clicking Settings -> System.

Part 4: Installing Ubuntu in VirtualBox

Now that the virtual machine has been created, we are ready to install Ubuntu in this VM.

  1. Select your new VM created in Part 3 and click Start .

virtualbox-vm-start

Look a little different?

The installation process that follows may differ a little from version to version. The screenshots here are based on Ubuntu 24.04.

  1. Using the arrow keys, select, Try or Install Ubuntu and hit Enter.

vm-install-1-try-or-install

  1. Select your preferred language and click Next.

vm-install-2-select-language

  1. Select Install Ubuntu and click Next.

vm-install-3-install-ubuntu

  1. Select Interactive installation and click Next.

vm-install-4-interactive-installation

  1. Check all of the available boxes to install proprietary software and click Next.

vm-install-5-proprietary-software

  1. This one may sound a little scary, but select Erase disk and install Ubuntu and click Next (No, this won't erase your host OS and all of your favorite cat photos).

vm-install-6-erase-and-install

  1. Enter your preferred name, username, computer name, and password. Note that this user will have root/sudo privilege on your VM. When ready, click Next.

vm-install-7-username-and-password

  1. Select your preferred timezone (dream destination or actual timezone) and click Next.

vm-install-8-timezone

  1. Review your choices and click Install. Wait until the installation is finished. After the installation is complete, click the Restart now button.

vm-install-9-review-choices

vm-install-10-installation-progress

vm-install-11-restart-now

  1. When you see a screen with a black background saying Please remove the installation medium, then press ENTER:, simply hit the ENTER key.

vm-install-12-remove-installation-medium

  1. To log in, enter the password you chose earlier and press ENTER .

vm-login

Your Ubuntu Desktop installation is ready. Congratulations!

Part 5: Installing Guest Additions

This step is optional but highly recommended.

Guest Additions extend the capabilities of VirtualBox in several useful ways, including ...

  • enabling bidirectional host guest copy / paste support
  • sharing folders across host and guest systems
  • dragging and dropping files between host and guest
  • graphics improvements
    • higher resolutions
    • full screen
    • app windows
  • improved mouse integration

1. Install required packages

Open the terminal and run the following command:

If you are not sure how to open the terminal, please refer to the FAQ below.

$ sudo apt install -y bzip2 tar build-essential

2. Install Guest Additions

In order to install VirtualBox Guest Additions on your Ubuntu VM, use the menu to select Devices Insert Guest Additions CD image.

As soon as you attach the Guest Additions image to the VM, click on the CD icon in the menu bar, and then click the Run Software button in Files window. You'll be prompted to enter you password.

vm-guest-additions-install

Press Return key to complete the installation.

vm-guest-additions-install-complete.png

Reboot your VM. You may need to enter your password in order to restart the VM.

$ sudo reboot

FAQ

How do I open the terminal?

Open the activity menu (The Show Apps button at the bottom of the menu bar) , type terminal, and hit Enter key (or select the terminal icon).

faq-terminal-open

How do I copy and paste in Ubuntu?

The keyboard shortcuts for copying and pasting differ depending on whether there are executed within the terminal elsewhere.

Terminal

To copy text from the terminal/CLI prompt, use SHIFT+Ctrl+c. To past into the terminal, use SHIFT+Ctrl+v

Everywhere else

To copy text elsewhere (VM's web browser, code editor, etc.), use Ctrl+c

To paste text anywhere other than the terminal, use Ctrl+v.

How do I copy and paste from host to guest and guest to host?

To enable bidirectional copy / paste, you must first install Guest Additions. From the VM menu, navigate to Settings General Advanced and select Bidirectional from the Shared Clipboard dropdown.

setting-shared-clipboard.png

How do I restart a VM?

If your VM is unresponsive, you can force it to reset by right-clicking the entry for the VM in left pane of the VirtualBox window and selecting Restart.

faq-reset

Pulling the plug

From your VM's perspective, this is equivalent to unplugging the power from your computer.

How do I shut down a VM?

If you are running an Ubuntu LTS VM, click the power icon in the upper righthand corner of your screen, click the power icon that appears, and select Power Off Power Off.

faq-shutdown

Next Steps

For an introduction to the Linux command line, see this tutorial.

cd ~/👾 Bug?Creative Commons License