How To Install KVM On CentOS Stream 10
Kernel-based Virtual Machine (KVM) is one of the most powerful and widely used virtualization technologies on Linux. It allows you to run multiple virtual machines efficiently using hardware-assisted virtualization.
In this guide, you will learn how to install KVM on CentOS Stream 10, configure the required services, and verify that your system is ready to run virtual machines.
What Is KVM?
KVM (Kernel-based Virtual Machine) is a Linux kernel module that turns the Linux kernel into a hypervisor. Combined with tools like QEMU and libvirt, KVM provides enterprise-grade virtualization with excellent performance.
Benefits of Using KVM
- Native Linux virtualization
- Near bare-metal performance
- Open-source and actively maintained
- Supports multiple guest operating systems
System Requirements
Before installing KVM on CentOS Stream 10, ensure your system meets the following requirements:
- CentOS Stream 10 (64-bit)
- CPU with virtualization support (Intel VT-x or AMD-V)
- Virtualization enabled in BIOS/UEFI
- Root or sudo privileges
Step 1: Verify CPU Virtualization Support
Check whether your CPU supports hardware virtualization.
lscpu | grep Virtualization
If the output shows VT-x or AMD-V, your CPU supports virtualization.
You can also verify using:
egrep -c '(vmx|svm)' /proc/cpuinfo
A value greater than 0 confirms support.
Step 2: Update the System
Always update your system before installing new packages.
sudo dnf update -y
Reboot if the kernel was updated.
Step 3: Install KVM and Virtualization Packages
Install KVM and required virtualization tools using DNF.
sudo dnf install -y qemu-kvm libvirt virt-install virt-manager bridge-utils
Package Overview
- qemu-kvm – KVM hypervisor
- libvirt – Virtualization management service
- virt-install – Command-line VM installer
- virt-manager – GUI management tool
- bridge-utils – Network bridging utilities
Step 4: Enable and Start libvirtd Service
Start and enable the libvirt daemon.
sudo systemctl enable --now libvirtd
Verify the service status:
systemctl status libvirtd
Step 5: Add User to libvirt Group
To manage virtual machines without root access:
sudo usermod -aG libvirt $(whoami)
Log out and log back in for the changes to take effect.
Step 6: Verify KVM Installation
Check whether KVM modules are loaded.
lsmod | grep kvm
Expected output includes kvm_intel or kvm_amd.
Test the KVM host configuration:
sudo virt-host-validate
All checks should return PASS.
Step 7: Configure Network Bridging (Optional)
For production environments, network bridging allows VMs to appear on the same network as the host.
Example bridge configuration using NetworkManager:
nmcli connection add type bridge ifname br0
nmcli connection add type ethernet slave-type bridge con-name br0-slave ifname eth0 master br0
Restart networking:
sudo systemctl restart NetworkManager
Step 8: Create a Virtual Machine Using CLI
Download an ISO file and create a VM using virt-install.
sudo virt-install \
--name centos-vm \
--ram 2048 \
--vcpus 2 \
--disk path=/var/lib/libvirt/images/centos-vm.qcow2,size=20 \
--os-variant centos-stream9 \
--cdrom /path/to/iso \
--network bridge=br0 \
--graphics vnc
Step 9: Manage VMs with virt-manager (GUI)
If you are using a desktop environment, launch:
virt-manager
Virt-manager provides a graphical interface to create, manage, and monitor virtual machines.
Common Troubleshooting Tips
- Ensure virtualization is enabled in BIOS
- Disable conflicting hypervisors
- Check SELinux status if VM creation fails
- Confirm firewall rules allow bridge traffic
Best Practices for KVM on CentOS Stream 10
- Keep host system minimal
- Use QCOW2 disk format
- Regularly update libvirt and QEMU
- Separate VM storage from OS disk
- Monitor resource usage
Conclusion
Installing KVM on CentOS Stream 10 provides a robust and scalable virtualization platform suitable for development, testing, and production workloads. With proper configuration, KVM delivers excellent performance and flexibility.
By following this guide, you now have a fully functional KVM virtualization environment ready to host virtual machines securely and efficiently.











