Install KVM on Ubuntu 24.04
Source: Dev.to
Check CPU virtualization support
lscpu | grep -E 'vmx|svm'
If the output contains vmx (Intel) or svm (AMD), your CPU supports virtualization.
Optional: Verify with cpu-checker
sudo apt update
sudo apt install -y cpu-checker
kvm-ok
You should see “/dev/kvm exists” and “KVM acceleration can be used”.
If no virtualization support is reported, enable it in your BIOS/UEFI and reboot into Ubuntu.
Install KVM, QEMU, libvirt, and networking tools
sudo apt update
sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils virtinst
This installs the KVM hypervisor, QEMU, the libvirt daemon, and utilities for creating and managing virtual machines.
Enable and start the libvirt daemon
sudo systemctl enable --now libvirtd
sudo systemctl status libvirtd
The status should show the service as active (running) with no errors.
Add your user to the required groups
sudo adduser $USER kvm
sudo adduser $USER libvirt
Log out and log back in (or reboot) for the new group memberships to take effect.
Optional: Install a graphical interface (Virt‑Manager)
sudo apt install -y virt-manager
- Launch from the app menu (“Virtual Machine Manager”) or run
virt-managerin a terminal. - Click Create a new virtual machine, select your ISO, configure RAM/CPU/disk, and finish the wizard.
Optional: Install GNOME Boxes
sudo apt-get install -y gnome-boxes
- Open GNOME Boxes from the app menu.
- Click the + button in the top‑left corner to create a new VM from an ISO file or download a ready‑to‑run guest OS.