Creating your first virtual machine
Virtual Machines (VMs) are a way to run a computer inside your computer. Often with cloud computing these computers are running on a server somewhere far away in a data center. In this activity, you're going to install a VM on your own machine using free tools.
Learning Objectives
- Understand what a virtual machine is
- Be able to explain concepts of virtualization, including hypervisors, and host and guest operating systems
- Be able to install and interact with a virtual machine on your computer
Installing the Hypervisor
A hypervisor is a program running on a computer that allows it to take the physical resources (e.g., storage and memory) of a host machine and divide them up between multiple guest operating systems. You can think of it like splitting one computer into a bunch of smaller computers. We're going to take your host operating system (likely either Windows or macOS) and install a guest Linux operating system in a virtual machine.
There will be two different paths for installing this VM - one for Windows and Intel Macs, and a separate one for Apple Silicon (M1/2/3) Macs. Make sure to follow the instructions appropriate to your computer. If you are unsure which version is right for you, ask.
Installing VirtualBox (Windows and Intel Macs)
- Go to https://www.virtualbox.org/wiki/Downloads
- Download and install the version appropriate for your computer (Windows or Intel Mac)
- Download Ubuntu Desktop from the Ubuntu website: https://ubuntu.com/download/desktop
- Open VirtualBox and create a new virtual machine by clicking the New button
- Give it a useful name like "Ubuntu", then select the ISO image for Ubuntu Desktop that you downloaded. Check the box to "Skip Unattended Installation."
- On the Hardware tab, give the VM 4096MB of Base Memory, and 2 Processors. (you can do less, but it will make things run slower)
- Create a Virtual Hard Disk that is at least 15GB (preferably 20 if you have the space for it).
- Click Finish and the virtual machine installation will begin. Continue with "Installing Ubuntu" below
Installing UTM (Apple Silicon M1/2/3/4 Macs)
- You can choose to install UTM from the download at https://mac.getutm.app/ or by paying $9.99 on the Mac App Store. They are the same version; the App Store version just allows auto updates and allows you to support the UTM project.
- You can download Ubuntu Server for ARM from the Ubuntu project website (https://ubuntu.com/download/server/arm).
- Once the download is complete, follow the instructions on the UTM website (https://docs.getutm.app/guides/ubuntu/) to create a new virtual machine.
- Allocate at least 15GB of drive space (20 or more if you have the space for it), 4GB of RAM, and 2 CPU cores.
- If you see a blank screen after the VM reboots, you may need to open the VM settings and remove the ISO file as described in Step 9.
Installing Ubuntu
Ubuntu is a version of the GNU/Linux operating system. If you've never installed an operating system, this will be a fun new experience.
- In the menu that opens up once you start running, select "Try or install Ubuntu"
- Through the installation menu, you can use tab to navigate between options, space to toggle options, and Enter/Return to select. You are safe to select the default options for everything (and select a language that works for you).
- When prompted, choose a username and password that you will remember.
- If asked at any point in the installation if you want Ubuntu Pro, you can select "Skip for now."
- Once the installation is finished, restart the virtual machine (you don't need to restart your host machine)
- If you installed Ubuntu Server for ARM (on an Apple Silicon Mac), after installing and booting the VM, you'll need to install Ubuntu Desktop to get the nice desktop things like a point-and-click interface. See the UTM guide (https://docs.getutm.app/guides/ubuntu/#installing-ubuntu-desktop) for instructions.
Once you're through the installation and have installed Ubuntu Desktop, starting up your VM should present you with a login screen, then show you something like this: