Installing Ubuntu 22.04 on VirtualBox
Ubuntu has a special place in my heart. It was the first Linux distribution I ever installed. Someone gave me an old fat Toshiba laptop, and since it was running the ancient Windows Vista and thus was practically useless, I followed a guide to flash Ubuntu. With it, I self-hosted a personal website that I never got to production because I spent all my time designing a loading screen. But I digress.
Ubuntu is a well-known Linux distribution based off Debian. Due to its popularity, it’s useful as a starting point for understanding virtualization. Although I installed Ubuntu here, this serves as a model for any VirtualBox operating system because so much is the same.
Virtualization and VirtualBox
Virtualization, in a nutshell, is the process of using software to fake hardware. Through virtualization, a computer can allocate a fraction of its resources, like RAM and CPU, to virtual machines which behave as though they are real computers, hence the term “virtual.”
In virtualization-land, virtual machines are called guests and the machine that is running them is called the host. This is easy to remember if you think of virtual machines as parasites. They are guests which leech the resources from a host device.
With those definitions out of the way, VirtualBox is a powerful open-source (free!) application to virtualize. Alright, enough theory!
Getting Started
I had VirtualBox installed from a while back, so all I needed to do to get started was to ensure it was up-to-date. You can download it for your OS here.
Installing a virtual operating system, like building a computer, requires a few parts. Since we’re working virtually, however, we start with the “soul,” or the disc that holds the OS’s code, since it can take a while to download.
The Ubuntu website provides a download page with ISO files, which are exactly what VirtualBox needs. I chose the latest version of Ubuntu desktop (at the time of this writing, Ubuntu 22.04 LTS). Depending on when you read this, the LTS version might not be the latest one. Choose LTS if you’re concerned about longer-term stability and support.
It’s time for a challenge. Depending on your WiFi speed, if you feel confident, you should be able to finish the following steps before the download finishes. I excused myself from this, however, because I had to take screenshots for this article.
After opening VirtualBox and clicking on the blue badge-shaped “New” button, there are two ways to set up a virtual machine: guided and advanced. Whichever option you choose will not affect your ability to follow along. I chose guided.
If you name your VM like I did (Ubuntu 22.0 Desktop), VirtualBox will intelligently select its type and version. Make sure your settings match the ones of the ISO you downloaded. For the remaining screens, I stuck with the recommended defaults. To make your VM run smoother, increase its RAM if you can afford to.
After the first screens of set up, I navigated to Settings > Storage and virtually inserted the disk by attaching the ISO file, which, in your case, should be just downloaded by now if you finished the challenge in time. I didn’t know, however, that if I had just clicked “Start,” VirtualBox would have prompted me to insert the ISO anyway.
When I started the VM, a setup screen appeared.
After a few minutes, it booted up. Then, the install screen appeared, where I chose to “Install Ubuntu.” And since its virtual disk was empty, I selected “Erase disk and install Ubuntu.” The rest of the defaults I left alone, since everything was self-explanatory.
And we’re done! On the next boot, I detached the Ubuntu ISO disk because the machine didn’t need it anymore. This is how the fully-installed desktop finally looked:
After all this, your question might be “why would anyone ever find this useful?” Obviously, running a computer in a computer is less efficient. It also does not absolutely secure your host machine from specialized attacks on the guest operating system.
Nevertheless, virtual machines are useful abstractions because they allow people, to a certain degree, to try different operating systems without fully installing them onto hardware or even run multiple systems at once. Back-end developers will be familiar with technologies like Vagrant and Docker which aim to isolate systems from each other. Finally, for the security engineer, virtual machines are a convenient way to set up a device to test attacking on. There are a host of other uses. Ubuntu is just a starting point!
Virtual machines are a computing analogue to dreams. They are abstract and often transient, but they leave their mark on the world nonetheless.