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.
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.
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)
This section provides a bit of background on the key technologies involved in this tutorial.
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.
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).
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.
Highly customizable: Unlike operating systems such as Window or MacOS, the core of a Linux OS is open-source software (OSS) making it highly customizable.
Democratized access: Most Linux distributions are free and some Linux distributions are completely open source!
Fast and lightweight: Linux distributions can be barebones. Some have no graphical interface at all (these are typically labeled as server distributions). As such, they typically run faster than commercial alternatives.
Common in the developer world: While you may not see many computers sold with a Linux distribution preinstalled at large retailers, Linux distributions are quite common. Many devices such as TVs and e-readers are powered by Linux.
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.
Before starting, ensure that ...
Follow this link and install VirtualBox according to the instructions provided for your operating system (OS).
VirtualBox
→ About VirtualBox
. You can check the version in the window that launches.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:
Download
. 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
.Continue
.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.
Finish
.If you'd like to adjust your system resource allocations, you can do so by clicking Settings
-> System
.
Now that the virtual machine has been created, we are ready to install Ubuntu in this VM.
Start
. The installation process that follows may differ a little from version to version. The screenshots here are based on Ubuntu 24.04.
Next
. Next
. Next
.Next
. Next
(No, this won't erase your host OS and all of your favorite cat photos).Next
.Next
.Install
. Wait until the installation is finished. After the installation is complete, click the Restart now
button.ENTER
key.ENTER
.Your Ubuntu Desktop installation is ready. Congratulations!
This step is optional but highly recommended.
Guest Additions extend the capabilities of VirtualBox in several useful ways, including ...
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
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.
Press Return
key to complete the installation.
Reboot your VM. You may need to enter your password in order to restart the VM.
$ sudo reboot
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).
The keyboard shortcuts for copying and pasting differ depending on whether there are executed within the terminal elsewhere.
To copy text from the terminal/CLI prompt, use SHIFT+Ctrl+c
. To past into the terminal, use SHIFT+Ctrl+v
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
.
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.
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.
From your VM's perspective, this is equivalent to unplugging the power from your computer.
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.
For an introduction to the Linux command line, see this tutorial.