Exercise: KVM Installation and Check

Preparing the Host for Virtualization

A hands-on exercise to install the KVM/QEMU virtualization packages on Fedora and verify that the host system’s hardware supports virtualization extensions.
Author

Chuck Nelson

Published

November 16, 2025

1 Purpose

Before you can create and run virtual machines, you must ensure your host system has the necessary hardware support and that the core virtualization software is installed. This exercise walks you through checking your CPU for virtualization extensions and installing the standard KVM/QEMU hypervisor stack and management tools on your Fedora system.

2 What You’ll Accomplish

By the end of this exercise, you will be able to:

  • Use lscpu to verify your processor supports hardware virtualization.
  • Install the KVM, QEMU, and virt-manager packages.
  • Enable and check the status of the libvirtd service, which manages VMs.

This exercise maps to the following program and course learning outcomes:

  • Course Learning Outcomes (CLOs):
    • 1. Identify hardware and basic network components: You will verify a critical CPU hardware feature (virtualization extensions) and install the software components that make up a hypervisor.

This exercise develops the following skills, which align with the O*NET SOC Code 15-1232.00 for Computer User Support Specialists.

Learning Objective O*NET KSAs Technologies Used
Verify hardware support for virtualization. Knowledge: Computers & Electronics
Skills: None
lscpu, VT-x, AMD-V
Install and enable virtualization services. Knowledge: Computers & Electronics
Skills: Systems Analysis
KVM, QEMU, libvirtd

3 Prerequisites

This exercise requires a running Fedora 42 virtual machine with sudo privileges. Note that for this exercise to succeed, your physical machine’s BIOS/UEFI must have virtualization extensions (Intel VT-x or AMD-V) enabled.

4 Step-by-Step Guide

Open a terminal window in your Fedora VM to begin.

4.1 Step 1: Check for Hardware Virtualization Support

The lscpu command displays detailed information about the CPU architecture. We can search its output for virtualization support.

  1. Run the following command:

    lscpu | grep -i 'virtualization'
  2. Analyze the Output: You should see a line that says Virtualization: followed by VT-x (for Intel) or AMD-V (for AMD). If you see this, your CPU supports hardware virtualization. If there is no output, you may need to shut down your physical machine and enable the setting in its BIOS/UEFI.

4.2 Step 2: Install Virtualization Packages

Fedora provides a package group that bundles all the necessary tools for virtualization.

  1. Run the dnf groupinstall command. The --with-optional flag is recommended to include useful tools like virt-manager.

    sudo dnf groupinstall --with-optional virtualization
  2. This will install QEMU (the machine emulator), KVM (the kernel hypervisor module), libvirt (the management library), and virt-manager (the graphical management tool).

4.3 Step 3: Start and Enable the Virtualization Service

The libvirtd service is the daemon that manages your VMs. You need to start it and enable it to launch automatically on boot.

  1. Run the systemctl command to start and enable the service:

    sudo systemctl enable --now libvirtd

    The --now flag both enables and starts the service in a single command.

4.4 Step 4: Verify the Service Status

Finally, check that the libvirtd service is running correctly.

  1. Run the status command:

    sudo systemctl status libvirtd
  2. Analyze the Output: You should see a line that says Active: active (running) in green text. This confirms that your host is now ready to create and manage virtual machines. Press q to exit the status view.

5 Reflect and Review

ImportantReflection: 3-2-1

Now that you have completed this exercise, reflect on your experience in your Microsoft Teams Student Notebook:

  • 3 key software components you installed.
  • 2 systemctl commands you used.
  • 1 question you still have about KVM or QEMU.
TipCheck on Learning

Answer these questions in your notebook to solidify your understanding:

  1. What command do you use to check if your CPU supports virtualization?
  2. What is the name of the primary service daemon that manages virtual machines on Fedora?
  3. What does the --now flag do in the systemctl enable --now command?
  4. If lscpu does not show virtualization support, what is the most likely place to fix this?
Back to top