Quick Fix: AppArmor+Libvirt Errors in Debian, Round 2
After smooth sailing for a while after the last post on the subject, I ran into another one. Once again, I was getting errors when trying to start guests.
I was getting error messages such as these in syslog:
2023-06-20T14:14:41.858010-07:00 store libvirtd[8623]: internal error: Process exited prior to exec: libvirt: error : Cannot delete directory '/run/libvirt/qemu/4-autoserver.shm': Device or resource busy
2023-06-20T14:14:42.060935-07:00 store libvirtd[8623]: internal error: Failed to autostart VM 'autoserver': internal error: Process exited prior to exec: libvirt: error : Cannot delete directory '/run/libvirt/qemu/4-autoserver.shm': Device or resource busy
/var/log/audit/audit.log showed errors such as these:
type=AVC msg=audit(1687295681.852:196): apparmor="DENIED" operation="umount" class="mount" profile="libvirtd" name="/run/libvirt/qemu/4-autoserver.dev/" pid=9441 comm="daemon-init"
The fix is to add this to /etc/apparmor.d/abstractions/libvirt:
umount /run/libvirt/qemu/**,
Reload apparmor (systemctl reload apparmor) and try starting a guest.