KVM stands for Kernel based Virtual-machine which provides capabilities to run multiple multiple hosts on a system.
dnf @virtualization bridge-utils qemu-kvm virt-manager virt-install qemu-img libvirt libvirt-python libvirt-client -y
after installing libvirt tools when accessing virsh as a normal user you will prompted for authentication.
$libvirt
==== AUTHENTICATING FOR org.libvirt.unix.manage ===
System policy prevents management of local virtualized systems
Authenticating as: cipher
Password:
==== AUTHENTICATION COMPLETE ===
To fix this issue we need to add $USER to group libvirt
#sudo usermod -aG libvirt $USER
#sudo grep libvirt /etc/group
libvirt:x:974:cipher
reload changes without logging out.
#newgrp $USER
After this you can access virsh without any authentication, but we dont see running kvm hosts here.
#virsh list --all
Id Name State
----------------------------------------------------
Add below line to .bashrc to fix the above error
echo "ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt'" >> .bashrc
export LIBVIRT_DEFAULT_URI=qemu:///system
Related Articles
How We Set Up Our KVM Hypervisor: From Bare Metal to Production-Ready VM Host
Detailed walkthrough of building a dedicated KVM/libvirt hypervisor with XFS tuning, hugepages, 10GbE tuning, and automation.
Building a Predictable KVM Infrastructure: From Chaos to Control
How to engineer a predictable KVM-based infrastructure focusing on repeatability, observability, and operational safety.
Virt-sparsify
How to use virt-sparsify to reclaim unused disk space from qcow2 VM images.