Follow
Ubuntu Linux

How to Install KVM on Ubuntu 24.04

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

You install KVM on Ubuntu 24.04 to turn your PC into a powerful virtualization host.

KVM, short for Kernel-based Virtual Machine, is Linux’s built-in virtualization technology. It transforms your Linux kernel into a hypervisor, letting you run multiple isolated operating systems, known as guest machines, directly on your hardware.

This method leverages the performance, security, and updates of the Linux kernel itself. You’ll likely choose KVM if you need a robust solution integrated directly into Ubuntu 24.04, offering an alternative to software like VirtualBox or VMware.

Once set up, you can manage your virtual machines through user-friendly tools like virt-manager or powerful command-line utilities such as virt-install.

⚡ 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`.

Check KVM Support on Ubuntu

Not all systems can install and run the KVM modules. If you’re running a server that isn’t compatible, you won’t be able to use KVM on it.

To check, run the commands below to install a tool that checks your CPU’s compatibility with KVM on Ubuntu Linux.

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

After running the commands above, check your CPU compatibility with KVM. If KVM is compatible, you should see the message 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:

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

The message above indicates that you can’t run KVM.

Install KVM Packages

If the CPU check passes, run the commands below to install the KVM packages. These packages enable full virtualization functionality on Ubuntu through the Linux kernel.

🐧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 them to begin automatically when your system boots.

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

Add a User to libvirt and KVM Groups

When you install KVM on Ubuntu, you should also add your user account to the libvirt and KVM groups. This allows you to create and manage virtual machines on your system.

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

Now that your server is configured, open the KVM virtual machine manager and create a new virtual guest machine.

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 or install it via network or PXE boot.

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

Once you’ve selected the OS file, you’ll configure a local disk, system memory, and other settings.

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

When you’re done, boot the VM to install Ubuntu.

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

That should do it!

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.

Does the Ubuntu server support KVM?

Unlike VMware or VirtualBox, KVM is a Type 1 hypervisor. This means it runs directly on the hardware with minimal overhead. This guide covers installing and verifying a working KVM stack on Ubuntu Server.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 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

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

Leave a Comment

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