Skip to content
Follow
Ubuntu Linux

How to Install KVM on Ubuntu 24.04

Richard
Written by
Richard
Dec 16, 2024 Updated Sep 15, 2026 3 min read
How to Install KVM on Ubuntu 24.04
How to Install KVM on Ubuntu 24.04

KVM (Kernel-based Virtual Machine, a built-in tool that turns Linux into a hypervisor) lets Ubuntu 24.04 run multiple virtual machines right on your hardware. This native setup uses the Linux kernel itself to run separate operating systems efficiently and securely without needing extra software like VirtualBox or VMware.

Advertisement

Manage your virtual computers through graphical tools like virt-manager or command-line utilities like virt-install. You get full access to hardware acceleration and direct resource control for every virtual machine you create.

⚡ Quick Answer

Install KVM by first checking CPU compatibility with `sudo apt install cpu-checker` and `sudo kvm-ok`. Then, install the necessary packages using `sudo apt install qemu-kvm virt-manager libvirt-clients bridge-utils libvirt-daemon-system virtinst`. Finally, add your user to the libvirt and kvm groups with `sudo usermod -aG libvirt $USER` and `sudo usermod -aG kvm $USER`.

Advertisement

Check KVM Support on Ubuntu

Checking KVM support on Ubuntu requires a processor with hardware virtualization and the cpu-checker tool to run the kvm-ok command. This confirms whether your system can run virtual machines before you install KVM Ubuntu 20.04 or newer versions.

Run the commands below to install the verification tool and check your CPU compatibility.

🐧Bash / Shell
sudo apt install cpu-checker
sudo kvm-ok

A successful check will display ‘KVM acceleration can be used.’

💻Code
INFO: /dev/kvm exists
KVM acceleration can be used

If KVM isn’t compatible with your system, you’ll see a message that reads:

Advertisement
💻Code
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

The message above indicates that KVM cannot run on your system.

Install KVM Packages

Installing KVM packages on Ubuntu needs the apt install command to get qemu-kvm, virt-manager, libvirt-clients, bridge-utils, libvirt-daemon-system, and virtinst. These tools set up the core hypervisor and graphical interface you need to manage virtual machines after you install KVM Ubuntu 20.04 or later.

🐧Bash / Shell
sudo update
sudo apt install qemu-kvm virt-manager libvirt-clients bridge-utils libvirt-daemon-system virtinst

After installing the KVM modules, run the commands below to start them and enable automatic startup when your system boots.

🐧Bash / Shell
sudo systemctl start libvirtd
sudo systemctl enable libvirtd

Add a User to libvirt and KVM Groups

Managing virtual machines efficiently requires adding your user account to the special 'libvirt' and 'kvm' groups on Ubuntu.

Advertisement

Run the command below to add your account to these groups.

🐧Bash / Shell
sudo usermod -aG libvirt $USER
sudo usermod -aG kvm $USER

Create New VMs

Creating new VMs on Ubuntu uses the Virtual Machine Manager application to guide you through setting up an operating system. You open the tool, connect to your local server, click New Virtual Machine, and follow the setup wizard to finish your installation.

First, connect to the server, then create a new machine by clicking 'New Virtual Machine'.

KVM desktop dashboard
KVM desktop dashboard

Next, choose how you want to install the guest machine. You can use local ISO media (disk image files) or install it via a network or PXE boot (preboot execution environment for network booting).

Advertisement
KVM installation wizard interface for creating a VM
KVM installation wizard interface for creating a VM

Once you've selected the OS file, configure a local disk, system memory, and additional hardware settings.

KVM installation wizard showing RAM allocation settings
KVM installation wizard showing RAM allocation settings

Boot the VM to install Ubuntu when finished.

KVM installation wizard boot options for virtual machines
KVM installation wizard boot options for virtual machines

That completes the installation process.

Conclusion:

  • KVM provides an efficient and powerful virtualization solution for Ubuntu 20.04 users.
  • It allows creating and managing multiple virtual machines, leveraging the Linux kernel's capabilities.
  • Users can choose from various installation sources, including local ISOs and network installations.
  • Adding user accounts to the appropriate groups ensures smooth management of virtual machines.
  • With tools like virt-manager, users can easily configure and monitor their virtual environments.
  • KVM is a robust alternative for users unable to utilize VirtualBox or VMware, emphasizing performance and integration with Linux systems.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

📚 Related Tutorials

How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04
How to Enable Automatic Do Not Disturb Scheduling in Windows 11
Windows How to Enable Automatic Do Not Disturb Scheduling in Windows 11

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *