This article will outline how to setup the KVM hypervisor on Ubuntu 22.04.
Since KVM is part of Linux, it installs natively, enabling a straightforward user experience and smooth integration.
QEMU is a free and open-source machine emulator and virtualizer. It enables your host machine to run a variety of guest operating systems.
Install Required Packages
Update your system.
sudo apt update
Check if virtualization is enabled.
egrep -c '(vmx|svm)' /proc/cpuinfo
If the result of the above command is greater than
0, then virtualization should be enabled. If not, then you can attempt to enable virtualization in the BIOS settings.
To verify if KVM virtualization is enabled run the following command:
Install the cpu-checker package if you don’t have it already.
sudo apt install -y cpu-checker
Run the command below to install KVM and additional virtualization packages on Ubuntu 22.04.
sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils
Breakdown of packages to be installed:
- qemu-kvm – An opensource emulator and virtualization package that provides hardware emulation.
- virt-manager – A Qt-based graphical interface for managing virtual machines via the libvirt daemon.
- libvirt-daemon-system – A package that provides configuration files required to run the libvirt daemon.
- virtinst – A set of command-line utilities for provisioning and modifying virtual machines.
- libvirt-clients – A set of client-side libraries and APIs for managing and controlling virtual machines & hypervisors from the command line.
- bridge-utils – A set of tools for creating and managing bridge devices.
Enable and start the Libvirt daemon.
sudo systemctl enable --now libvirtd
sudo systemctl start libvirtd
Confirm that the virtualization daemon is running as shown.
sudo systemctl status libvirtd
Add the currently logged-in user to the kvm and libvirt groups so that they can create and manage virtual machines.
sudo usermod -aG kvm $USER
sudo usermod -aG libvirt $USER
To apply this change, you need to log out and log back again.
Create a Network Bridge 
If you plan to access the KVM virtual machines from outside your local system, follow these instructions to create a network bridge. This allows the virtual machines to be accessible by other hosts on the network.
Otherwise, you can use the existing NAT settings.
This setup requires the use of the Network Manager Text User Interface tool.
To launch the Network Manager Text User Interface tool use the following command,
Follow these instructions:
- Deactivate the WIFI network (if it exists).
Activate a connection.
- Select the Wi-Fi network.
- Create a new Bridge
Edit a connection.
- Select the type of connection you wish to create:
- The default name is
Ethernetto add as slave to this bridge connection.
Ethernet Connection 1has been added as slave to the bridge connection.
- Remove Direct Wired Connection
Edit a connection
Wired Connection 1under
- Are you sure you want to delete the connection
Wired Connection 1?
You should now be able to select the bridged connection for your virtual machine network interface.
To verify the bridge was created, use the
This command should list the
nm-bridge we created above.
It should also display the ethernet connection under
Create a VM