Missing tmpfiles.d configuration causes startup failure on image-based systems (bootc)
Software environment
- Operating system: Fedora 42 Silverblue
- Architecture: x86_64
- kernel version: 6.17.7
- libvirt version: 11.0.0
- Hypervisor and version: QEMU/KVM 9.2.4
Description of problem
libvirt fails to start or create VMs on image-based systems (like Fedora Atomic/Silverblue using bootc container layering) because essential directories in /var (specifically /var/log/libvirt and /var/lib/libvirt) are missing at runtime.
While the libvirt-daemon-common RPM includes these paths in its file list, it does not ship a corresponding tmpfiles.d configuration. On standard package-based systems, directory creation typically relies on install-time scriptlets. However, on image-based systems where /var is populated at runtime via systemd-tmpfiles, the directories are not automatically created, causing the daemon to fail.
Steps to reproduce
- Install
libvirt-daemon-kvm(or similar) via build-time container layering (usingdnfinside a Containerfile/bootc build). - Boot into the new image.
- Attempt to start a VM.
- Observe failure in logs indicating
/var/log/libvirtdoes not exist or cannot be written to.
Additional information
This issue was originally triaged in fedora/ostree/sig#54 and filed at the request of @Siosm.
Suggested Fix
Add declarative tmpfiles.d configuration for directories created by the packages under /var to ensure they exist on boot. This likely includes:
/var/cache/libvirt
/var/lib/libvirt
/var/lib/libvirt/boot
/var/lib/libvirt/filesystems
/var/lib/libvirt/images
/var/log/libvirt