OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
apps-services high common DISPUTE

Fix virt-manager failing to connect to qemu:///system

archomarchyendeavouroscachyosmanjarolibvirtkvmqemuhyprlandpolkit
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

Most of this is right: polkit gating of the qemu:///system RW socket, the libvirt group having password-less access, the org.libvirt.unix.manage polkit action id, the package names (libvirt, qemu-desktop, virt-manager, dnsmasq, iptables-nft, edk2-ovmf all exist), and the libvirt-qemu group (Arch's libvirt does ship /usr/lib/sysusers.d/libvirt-qemu.conf, so that chown target is real). Three problems. (1) The polkit-agent instruction writes exec-once = ... into ~/.config/hypr/hyprland.conf, which Hyprland 0.55+ and Omarchy 4 no longer read (config is hyprland.lua). (2) Libvirt is mid-migration to modular daemons: virtqemud.service/.socket, virtnetworkd, virtstoraged etc. all ship in Arch's libvirt package and are the direction upstream is taking (monolithic libvirtd is slated for removal), and mixing the two setups is a known way to end up with a half-working stack. (3) virtlogd is socket-activated and pulled in by the daemon, so enabling virtlogd.service is unnecessary. Minor: chown -R $USER:libvirt-qemu alone does not fix 'search permissions' when $HOME is mode 0700, since the QEMU user still cannot traverse it.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Members of the libvirt group can define and start VMs with arbitrary host device and disk passthrough. It is close to root-equivalent. A reboot may be required before polkit-based authentication behaves correctly. Permission changes to system directories under /usr or /var/lib/libvirt are lost on package update.

Symptom

virt-manager shows the connection as "Not Connected" and errors with authentication unavailable: no polkit agent available or Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied. sudo virsh list --all works fine.

Cause

The qemu:///system RW socket is protected by polkit (the default unix_sock_auth on Arch since libvirt pulls in polkit). Without group membership or a running polkit authentication agent, the connection is refused.

Fix

Install the stack as written, then pick **one** daemon model and do not mix them:


sudo pacman -S libvirt qemu-desktop virt-manager dnsmasq iptables-nft edk2-ovmf
# modular daemons (the direction upstream is going):
sudo systemctl enable --now virtqemud.socket virtnetworkd.socket virtstoraged.socket
# ...OR the monolithic daemon, if that is what your system already uses:
sudo systemctl enable --now libvirtd.socket

Do not enable virtlogd.service by hand. It is socket-activated. Check what you are already running with systemctl list-units 'virt*' 'libvirtd*' before changing anything.

Group membership (sudo usermod -aG libvirt $USER, then log out and back in) and the /etc/polkit-1/rules.d/50-libvirt.rules snippet are correct as written.

For the polkit agent: Omarchy already runs one (pgrep -af polkit), so check before adding anything. If you do need to start one and you are on Hyprland 0.55+ / Omarchy 4, the config is Lua, not hyprland.conf: add it to ~/.config/hypr/autostart.lua (o.launch_on_start("/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1")), or better install hyprpolkitagent and enable its user unit. Only pre-0.55 Hyprland takes the exec-once = line.

For 'doesn't have search permissions': moving the image into /var/lib/libvirt/images + sudo virsh pool-refresh default is the reliable fix. If you keep it under $HOME, chown is not enough on a 0700 home. Grant traversal explicitly, e.g. sudo setfacl -m u:libvirt-qemu:x /home/$USER (and on each parent directory) plus read access on the image.

Verify

virsh -c qemu:///system list --all works as your normal user, and virt-manager shows "QEMU/KVM" connected. id -nG includes libvirt.

Sources

libvirt-virt-manager-permission-denied