Making Libvirt User-friendly in AlmaLinux

By | 2022-Jan-06

In AlmaLinux (and Red Hat Enterprise Linux, Rocky Linux, and CentOS), libvirtd defaults to the user URI. When a regular user executes virsh list, they will see only the KVM virtual machines accessible to their user and will not see those started by the system. You can change this behavior so that regular users can list and interact with virtual machines in the system URI.

  1. Add your regular user(s) to the kvm, libvirt, and qemu groups.
  2. Uncomment all lines beginning with unix_sock in /etc/libvirt/libvirtd.conf.
  3. Add the following to /etc/libvirt/libvirt.conf:

    uri_default = "qemu:///system"
  4. Create /etc/profile.d/ containing:

    export LIBVIRT_DEFAULT_URI="qemu:///system"