Downloading the Ubuntu cloud image
Video 014 of 140 in Virtualization Foundations, in the unit “Setting up your lab machine”. 3:55, with English and Hindi audio.
A lab often starts its virtual machines from a ready-made disk instead of an installer. That disk is called a cloud image. This article explains what a cloud image is, why it is faster to use than an installer, and how to download the Ubuntu 24.04 image. It also shows how to confirm that the copy you have is exactly the file Ubuntu published.
What you will learn
- A cloud image is a ready-made disk with Ubuntu already installed inside it.
- It boots straight away, but it has no login for you until a setup disk gives it one.
- A checksum is a short code computed from a file. If it matches the published list, the copy is genuine.
- Keep the downloaded image as a clean master, and practise on copies of it.
What a cloud image is and why it boots faster
A cloud image is a ready-made disk. Ubuntu is already installed on it, so a virtual machine boots from it without running an installer. Installers ask questions, copy files and take a while. A cloud image skips all of that, because the work is already done.
Clouds use the same kind of image to start machines quickly. Each new machine starts from a copy of the same clean disk.
Note: A cloud image has no login for you yet. A small setup disk must give it your user name and an SSH key, which is a pair of files that lets you log in without typing a password.
How a checksum proves a download is genuine
A checksum is a short code computed from a file's contents. Change even one byte of the file, and the code changes. That makes it a quick way to confirm that a download is exactly what the publisher made.
- Choose the release with the code name noble, which is Ubuntu 24.04.
- Download the image file, and the checksum list that sits beside it. The list holds the expected code for each file.
- Compute the code of your download with the sha256sum tool, and find the matching line in the list.
- If the codes match, the file is the one Ubuntu published. If they differ, delete the file and download it again.
Download the image and check it from the terminal
First, make a folder for the images and move into it. Keeping images in one place makes them easy to find. The image is large, so check that you have enough free disk space before you start.
mkdir -p ~/lab/images && cd ~/lab/imagesNext, store the address of the release folder in a shell variable. A shell variable is a name that holds some text. The name BASE then stands for the whole address in the commands that follow.
BASE=https://cloud-images.ubuntu.com/noble/currentwget $BASE/noble-server-cloudimg-amd64.imgwget $BASE/SHA256SUMSgrep noble-server-cloudimg-amd64.img SHA256SUMS | sha256sum -c -Note: The word OK means the codes match. Anything else means the download is damaged, so download it again.
Keep the master copy clean
Treat the downloaded image as a clean master copy. Each virtual machine starts from its own copy of it, and each copy collects its own changes. When a copy goes wrong, throw it away and make a new one. The master stays clean.
Note: Never practise on the original file. Free space also runs out quickly, because images and the copies made from them take a lot of room.
Download and check the image
You need a Linux terminal, enough free disk space for a large image, and an internet connection. You will run five commands in the order shown.
Make the images folder and move into it, so that every download lands in one place.
mkdir -p ~/lab/images && cd ~/lab/imagesWhat you should see: The prompt now shows that you are inside the images folder.
Store the release folder address in BASE, so that the next commands can reuse it.
BASE=https://cloud-images.ubuntu.com/noble/currentWhat you should see: BASE now holds the address of the release folder, ready for the next two downloads.
Download the Ubuntu 24.04 cloud image. The file is large, so this can take a while.
wget $BASE/noble-server-cloudimg-amd64.imgWhat you should see: The file noble-server-cloudimg-amd64.img appears in the folder once the download finishes.
Download the checksum list from the same folder.
wget $BASE/SHA256SUMSWhat you should see: The file SHA256SUMS appears beside the image.
Compare your image with its line in the checksum list.
grep noble-server-cloudimg-amd64.img SHA256SUMS | sha256sum -c -What you should see: The output line noble-server-cloudimg-amd64.img: OK means the codes match and the file is genuine.
Terms
- Cloud image
- A ready-made disk with Ubuntu already installed, so a virtual machine boots without running an installer.
- Checksum
- A short code computed from a file's contents. Change one byte, and the code changes.
- SSH key
- A pair of files that lets you log in to a machine securely, without typing a password.
- Shell variable
- A name in the terminal that holds some text, such as an address, so you can reuse it in commands.
Check yourself
Why does a cloud image boot faster than an installer?
Ubuntu is already installed on the cloud image, so the virtual machine boots from it without asking questions or copying files.
What does the word OK mean in the checksum check?
The code of your download matches the expected code in the list, so the file is the one Ubuntu published.
What should you do if the checksum does not match?
Delete the download and download the file again, because it is damaged.
Previous: Is the virtualization stack working?. Next: Saving and restoring your lab's state.