Polkit agent + libvirt group (fixes virt-manager connection failure) #4

Merged
yuri merged 7 commits from fix/polkit-agent-libvirt into main 2026-10-27 15:28:59 +01:00
Showing only changes of commit eacceee296 - Show all commits
+4 -14
View File
@@ -82,24 +82,14 @@ write_x11_session() {
# Common login-time plumbing every Wayland compositor wants on a bare install.
install_session_prereqs() {
# polkit-kde ships the agent AND its /etc/xdg/autostart .desktop itself —
# no manual wiring needed. (polkit-gnome is orphaned, EPEL-only: not on F44,
# which is why the first attempt failed with "No match for argument".)
install_packages \
xdg-desktop-portal \
polkit \
polkit-gnome \
polkit-kde \
pipewire \
pipewire-pulseaudio \
wireplumber
# A bare compositor (niri, MangoWC, Hyprland) has NO polkit agent: without
# one, anything needing privilege elevation (virt-manager's libvirt access,
# disks, network settings) fails with "no polkit agent available to
# authenticate". Autostart it for every graphical session via the XDG
# autostart dir the session runs.
local autostart="${XDG_AUTOSTART_DIR:-/etc/xdg/autostart}"
local desktop_src="${POLKIT_AGENT_DESKTOP:-/usr/share/applications/polkit-gnome-authentication-agent-1.desktop}"
if [[ -f "$desktop_src" ]] && [[ ! -e "$autostart/$(basename "$desktop_src")" ]]; then
info "Enabling polkit agent for compositor sessions..."
sudo mkdir -p "$autostart"
sudo ln -sf "$desktop_src" "$autostart/$(basename "$desktop_src")"
fi
}