apparmor blocks VM installation when automatic UEFI firmware is set
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt |
Fix Released
|
Undecided
|
Martin Pitt | ||
libvirt (Debian) |
Fix Released
|
Unknown
|
|||
libvirt (Ubuntu) |
Fix Released
|
High
|
Martin Pitt |
Bug Description
# lsb_release -rd
Description: Ubuntu 21.10
Release: 21.10
Package: apparmor
Version: 3.0.3-0ubuntu1
Package: virtinst
Version: 1:3.2.0-3
When trying to re-install an existing VM with uefi boot set up using the
recently introduced `--reinstall` option apparmor makes the installation
fail with the following error:
Could not open '/var/lib/
Steps to reproduce:
Create a VM:
root@ubuntu:~# virt-install --connect qemu:///system --quiet --os-variant
fedora28 --memory 1024 --name test --wait -1 --disk size=1,format=qcow2
--print-xml 1 > /tmp/test1.xml
Edit the VM configuration to enable automatic UEFI boot by changing the
<os> like follows:
- <os>
+ <os firmware='efi'>
Define the VM:
root@ubuntu:~# virsh define /tmp/test1.xml
Start VM installation:
root@ubuntu:~# virt-install --connect qemu:///system --reinstall test --wait -1 --noautoconsole --cdrom /var/lib/
WARNING No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.
Starting install...
ERROR internal error: process exited while connecting to monitor: 2022-02-
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start test
otherwise, please restart your installation.
Expected behavior:
VM installation will start without apparmor error.
Actual behavior:
The above denials happen:
audit: type=1400 audit(164579687
same thing later on for "k" (locking)
audit: type=1400 audit(164579696
and stop the installation.
Changed in apparmor (Debian): | |
status: | Unknown → New |
Changed in libvirt: | |
assignee: | nobody → Martin Pitt (pitti) |
status: | New → In Progress |
affects: | apparmor (Debian) → libvirt (Debian) |
Changed in libvirt (Debian): | |
status: | New → Confirmed |
tags: | added: server-todo |
Changed in libvirt (Debian): | |
status: | Confirmed → Fix Released |
/etc/apparmor. d/abstractions/ libvirt- qemu is shipped by libvirt- daemon- system, reassigning. I can reproduce this, and I'll attempt to work on a fix. I'll update the Debian bug as well.
Complete copy&paste-able reproducer:
virt-install --connect qemu:///system --quiet --os-variant fedora28 --memory 128 --name test --wait -1 --disk size=0. 125,format= qcow2 --graphics vnc,listen= 127.0.0. 1 --graphics spice,listen= 127.0.0. 1 --print-xml 1 | sed "s/<os/& firmware='efi'/" > /tmp/test1.xml libvirt/ novell. iso libvirt/ novell. iso --autostart
virsh define /tmp/test1.xml
touch /var/lib/
virt-install --connect qemu:///system --reinstall test --wait -1 --noautoconsole --cdrom /var/lib/