Files
configpolicy/roles/vmhost/files/vm-autostart.service
Dustin C. Hatch 4df047cf76 r/vmhost: Disable DynamicUsers for vm-autostart
_libvirt_ has gone full Polkit, which doesn't work with systemd dynamic
users.  So, we have to run `vm-autostart` as root (with no special
OS-level privileges) in order for Polkit to authorize the connection to
the daemon socket.
2025-07-28 18:18:35 -05:00

43 lines
871 B
Desktop File

[Unit]
Description=Start virtual machines
After=libvirt.service
After=network-online.target
Wants=network-online.target
RequiresMountsFor=/var/lib/libvirt/images
[Service]
Type=oneshot
RemainAfterExit=yes
Environment=LIBVIRT_DEFAULT_URI=qemu:///system
ExecStart=/usr/local/libexec/vm-autostart.sh
Restart=on-failure
CapabilityBoundingSet=
DeviceAllow=
DevicePolicy=closed
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
PrivateDevices=yes
PrivateUsers=yes
PrivateTmp=yes
ProcSubset=pid
ProtectClock=yes
ProtectControlGroups=yes
ProtectHome=yes
ProtectHostname=yes
ProtectKernelLogs=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
ProtectProc=invisible
ProtectSystem=strict
RestrictAddressFamilies=
RestrictNamespaces=yes
RestrictRealtime=yes
RestrictSUIDSGID=yes
SystemCallArchitectures=native
UMask=0027
[Install]
WantedBy=multi-user.target