This tutorial provides instructions for installing Ubuntu 20.04 LTS using VirtualBox.
If you're using a machine with an ARM64 CPU (ex. a Mac M1), you won't be able to run VirtualBox. Windows users should install Ubuntu (either via VirtualBox or natively on a separate partition).
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 Ubuntu 20.04 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
Download
. New
. Continue
.Continue
.Create
.Continue
.Continue
.Create
.Now that the virtual machine has been created, we are ready to install Ubuntu in this VM.
Settings
. Storage
category (1 in the image) and then Empty
under Controller:IDE
(2 in the image). Click the "CD/DVD" icon (3 in the image) on the right hand side and select the Ubuntu ISO file to mount.Open
. Location
field and make sure that the correct ISO file is selected, then click Ok
.Start
button. Start
. Note that the installation process that follows may differ a little from version to version. The screenshots here are based on Ubuntu 20.04. Install
, and follow the steps. Make sure the Erase disk and install Ubuntu option is selected and click the Install Now
button. This may sound scary, but nothing on your computer will be erased.
Click Continue
.
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 linux-headers-$(uname -r) build-essential dkms
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, you will get a prompt to run the automatic installation. Click Run
.
Press Return
key to complete the installation.
Reboot your system. You may need to enter your password in order to restart the VM.
$ sudo reboot
Open the activity menu and 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.
Warning: From your VM's perspective, this is equivalent to unplugging the power from your computer.
If you are running an Ubuntu 20.04 VM, click the power icon in the upper righthand corner of your screen and select Power Off / Log Out → Power Off....
For an introduction to the Linux command line, see this tutorial.