Skip to content
Follow
Ubuntu Linux

How to Install KVM on Ubuntu 24.04

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

Installing KVM on Ubuntu 24.04 turns your computer into a system that can run other operating systems inside virtual machines. KVM, which stands for Kernel-based Virtual Machine, is a way for Linux to handle virtualization directly. It uses your computer’s own Linux kernel to act as a hypervisor, the software that lets you run separate operating systems, called guest machines, on your hardware. This means virtual machines run efficiently, securely, and get updates right from Ubuntu 24.04.

You would pick KVM if you want a powerful virtualization tool built straight into your Ubuntu system, offering an alternative to programs like VirtualBox or VMware. After setting it up, you can use easy graphical tools like virt-manager or command-line tools like virt-install to manage your virtual computers.

⚡ 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

Your computer’s processor must support KVM to install it on Ubuntu. Check if your system is ready for virtual machines by installing the cpu-checker tool and running the ‘kvm-ok’ command. This check confirms your hardware is compatible for running virtual machines.

To check, run the commands below to install a tool that verifies 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. 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:

💻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

Once your system’s KVM support is confirmed, it’s time to install the necessary software packages on Ubuntu. This includes the core KVM software and tools like virt-manager for managing your virtual machines. You can get these packages using the ‘apt install’ command with the list of required software.

🐧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

To manage your virtual machines easily, you’ll need to add your user account to the special ‘libvirt’ and ‘kvm’ groups on Ubuntu.

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

Once KVM is set up on your Ubuntu system, you can start creating your first virtual machine. Open the virtual machine manager tool and select ‘New Virtual Machine’. The tool will guide you through the steps to choose how you want to install a new operating system on your virtual computer.

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 network or PXE boot (preboot execution environment).

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 (meaning 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 *