Installing the course packages

Video 012 of 140 in Virtualization Foundations, in the unit “Setting up your lab machine”. 3:41, with English and Hindi audio.

A lab needs many programs before it can run virtual machines. On Ubuntu, you do not install each one by hand. You install a package, which is a bundle of programs and settings that Linux installs in one step. Ubuntu uses a tool called apt to do this. This article explains what apt does when you ask for a package, and then installs the lab's virtualization packages with four commands.

What you will learn

What apt does when you ask for a package

A repository is a library of packages, kept on a server on the internet. Each repository has a list of the packages it holds and what each one contains. Your machine asks it for packages by name. Ubuntu has its own repositories, and apt knows where they are.

All of this happens for you, as long as the machine can reach the repositories on the internet.

How to install the virtualization packages

Start by refreshing the package lists. This reads each repository and updates apt's copy of the list. The word sudo runs the command as the administrator, and the command asks for your password before it goes ahead.

Refresh the package lists from every repository
sudo apt update

Next, install the virtualization group. QEMU runs virtual machines, libvirt manages them, and virtinst creates new ones.

Install QEMU, libvirt and virtinst
sudo apt install -y qemu-system-x86 qemu-utils libvirt-daemon-system virtinst

The next line adds boot firmware, cloud image tools, and the kvm-ok checker that you will use later.

Install boot firmware, cloud image tools and the kvm-ok checker
sudo apt install -y ovmf seabios cloud-image-utils guestfs-tools cpu-checker

The last line adds tools for making a setup disk, and software that provides a security chip for virtual machines.

Install the setup disk tools and the security chip software
sudo apt install -y genisoimage swtpm swtpm-tools

What to check when apt fails

Note: Installing on a production host can change what that host does. Run these installs only on the lab machine.

Install the lab packages

You need sudo rights on the lab machine and a working internet connection. Run the four commands in this order. Each one adds a set of packages to the machine.

  1. Refresh the package lists, so apt works from the latest information in each repository.

    sudo apt update

    What you should see: apt reads each repository and finishes without an error about a package list.

  2. Install the virtualization packages: QEMU runs virtual machines, libvirt manages them, and virtinst creates them.

    sudo apt install -y qemu-system-x86 qemu-utils libvirt-daemon-system virtinst

    What you should see: apt downloads and unpacks the packages, and the command returns to the prompt.

  3. Install boot firmware, cloud image tools and the kvm-ok checker.

    sudo apt install -y ovmf seabios cloud-image-utils guestfs-tools cpu-checker

    What you should see: The kvm-ok checker is now installed and ready to test KVM.

  4. Install the setup disk tools and the security chip software.

    sudo apt install -y genisoimage swtpm swtpm-tools

    What you should see: All four install commands are done, and the machine has the lab's core packages.

Terms

Package
A bundle of programs and settings that Linux installs in one step.
Repository
A server on the internet that stores packages, with a list of what each one contains.
Dependency
Another package that a package needs before it can run.
apt
The tool on Ubuntu that finds, downloads and installs packages from the repositories.

Check yourself

What is the difference between apt update and apt install?

apt update refreshes the list of what each repository offers. apt install downloads and installs the packages you name.

What does the -y flag do in an apt install command?

It answers yes to the install questions, so the command runs without stopping to ask.

What should you check before running an install?

Which machine you are on, because an install changes that machine, and a production host can behave differently afterwards.

Previous: Installing Ubuntu 24.04 LTS. Next: Is the virtualization stack working?.