<div dir="ltr"><div>Package: virtinst</div><div>Version: 1:3.2.0-3</div><div><br></div><div>Package: apparmor<br>Version: 3.0.3-6<br></div><div><br></div><div>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:</div><div><br></div><div> Could not open '/var/lib/libvirt/qemu/nvram/test_VARS.fd': Permission denied</div><div><br></div><div>Steps to reproduce:</div><div><br></div><div>Create a VM:</div><div><br></div><div>root@debian:~# 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 > /tmp/test1.xml</div><div><br></div><div>Edit the VM configuration to enable automatic UEFI boot by changing the <os> like follows:<br></div><div><pre class="gmail-literal-block">- <os></pre></div><div><pre class="gmail-literal-block">+ <os firmware='efi'></pre></div><div><br></div><div>Define the VM:</div><div><br></div><div>root@debian:~# virsh define /tmp/test1.xml </div><div><br></div><div>Start VM installation:</div><div><br></div><div>root@debian:~#  virt-install --connect qemu:///system --reinstall test --wait -1 --noautoconsole --cdrom /var/lib/libvirt/novell.iso --autostart<br>WARNING  No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.<br><br>Starting install...<br>ERROR    internal error: process exited while connecting to monitor: 2022-02-23T15:27:44.497553Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/test_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}: Could not open '/var/lib/libvirt/qemu/nvram/test_VARS.fd': Permission denied<br>Domain installation does not appear to have been successful.<br>If it was, you can restart your domain by running:<br>  virsh --connect qemu:///system start test<br>otherwise, please restart your installation.<br></div></div>