Install KVM/QEMU on Ubuntu 24.04 & Create a VM
Install KVM/QEMU on Ubuntu 24.04, verify hardware virtualization works, and spin up your first virtual machine with virt-install or virt-manager.
KVM (Kernel-based Virtual Machine) turns the Linux kernel into a Type-1 hypervisor, and on Ubuntu 24.04 LTS it is the fastest, most production-proven way to run virtual machines on commodity hardware. It is the same hypervisor that powers OpenStack Nova in large private clouds, so the skills you build here scale directly from a single workstation to a full data centre.
This guide walks through the whole path on Ubuntu 24.04: checking that your CPU supports hardware virtualization, installing the KVM/QEMU and libvirt stack, validating the install, and creating your first VM both from the command line with virt-install and from the graphical virt-manager. Every command is copy-paste ready.
Prerequisites
You need a 64-bit machine running Ubuntu 24.04 LTS with a CPU that supports hardware virtualization (Intel VT-x or AMD-V), a user account with sudo privileges, and a few gigabytes of free disk space for VM images. Virtualization must also be enabled in the BIOS/UEFI โ on many machines it ships disabled.
Step 1: Check hardware virtualization support
First confirm the CPU exposes virtualization extensions. A non-zero count means the flags (vmx for Intel, svm for AMD) are present:
egrep -c '(vmx|svm)' /proc/cpuinfoIf this prints 0, reboot into your BIOS/UEFI and enable Intel VT-x or AMD-V (SVM). The cleanest validation tool is kvm-ok, shipped in the cpu-checker package:
sudo apt update
sudo apt install -y cpu-checker
sudo kvm-okA healthy system reports:
INFO: /dev/kvm exists
KVM acceleration can be usedStep 2: Install the KVM/QEMU stack
Install QEMU/KVM, libvirt (the management daemon), the network bridge helper, and the tooling for creating and managing VMs:
sudo apt update
sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients \
bridge-utils virtinst virt-managerThe libvirt-daemon-system package installs and starts the libvirtd service automatically. Confirm it is running:
systemctl status libvirtd --no-pagerStep 3: Add your user to the libvirt and kvm groups
To manage VMs without sudo on every command, add your account to the relevant groups:
sudo usermod -aG libvirt,kvm $USERGroup membership only applies to new login sessions. Either log out and back in, or apply it to the current shell:
newgrp libvirtStep 4: Verify the installation
The virsh CLI is your main control surface for libvirt. List running VMs (none yet) and verify the default NAT network is active:
virsh list --all
virsh net-list --allIf the default network is not active, start it and set it to autostart so VMs get DHCP and outbound connectivity:
virsh net-start default
virsh net-autostart defaultRun a full host capability check; it should report that KVM acceleration is in use rather than slow software emulation:
virt-host-validate qemuStep 5: Create a VM from the command line with virt-install
The command-line route is ideal for servers and automation. Download an Ubuntu 24.04 cloud or server ISO into the libvirt images directory first:
sudo wget -O /var/lib/libvirt/images/ubuntu-24.04-live-server-amd64.iso \
https://releases.ubuntu.com/24.04/ubuntu-24.04.2-live-server-amd64.isoNow provision a VM with 2 vCPUs, 2 GiB RAM, and a 20 GiB qcow2 disk attached to the default NAT network:
virt-install \
--name ubuntu-test \
--memory 2048 \
--vcpus 2 \
--disk size=20,format=qcow2 \
--cdrom /var/lib/libvirt/images/ubuntu-24.04-live-server-amd64.iso \
--os-variant ubuntu24.04 \
--network network=default \
--graphics vnc \
--noautoconsoleIf --os-variant ubuntu24.04 is rejected, run osinfo-query os | grep ubuntu to find a supported variant string. The VM now exists and is booting the installer.
Step 6: Create a VM with virt-manager (GUI)
On a desktop, the Virtual Machine Manager offers a friendlier path. Launch it from your menu or with:
virt-managerClick Create a new virtual machine, choose Local install media, point it at your ISO, allocate CPU/RAM/disk, and finish. virt-manager opens a console so you can step through the OS installer interactively.
Step 7: Manage your new VM
A handful of virsh commands cover daily operation. Start, gracefully shut down, or force off a VM, and have it boot automatically with the host:
virsh start ubuntu-test
virsh shutdown ubuntu-test
virsh destroy ubuntu-test
virsh autostart ubuntu-testTo find a VM's IP address once the guest agent or DHCP lease is up:
virsh domifaddr ubuntu-testTroubleshooting and common pitfalls
A few issues trip up most newcomers:
- โ/dev/kvm does not existโ โ virtualization is disabled in BIOS/UEFI, or you are inside a VM without nested virtualization enabled.
- Permission denied on the socket โ you have not re-logged in after the
usermodstep; group membership is not yet active. - Very slow VMs โ KVM acceleration is not engaged and QEMU fell back to TCG emulation. Re-run
kvm-okandvirt-host-validateto confirm. - No network in the guest โ the default libvirt network is not started; run the
net-start/net-autostartcommands above.
Where to go next
Now that the hypervisor is running, the natural next step is driving it from the CLI. Our companion tutorial on libvirt and virsh basics covers snapshots, domain XML editing, and storage pools in depth. To back your VMs with resilient, distributed storage instead of a single local disk, see using Ceph RBD as KVM storage.
Conclusion
You now have a fully working KVM/QEMU hypervisor on Ubuntu 24.04, validated hardware acceleration, and a first VM created two different ways. KVM is exactly the open, license-free foundation that makes it a credible alternative to proprietary platforms โ it is the same hypervisor clouditiv runs in production. If you would rather not operate hypervisors, networking, and storage yourself, clouditiv runs a sovereign, ISO 27001 / BSI C5 private cloud on Ubuntu 24.04 + OpenStack 2025.2 with your data staying in Germany. Explore our VMware alternative to see how the same KVM technology scales into a managed cloud.