<div dir="auto">Hello Michal, thank you for the reply!<div dir="auto"><br></div><div dir="auto">I've carefully tested everything you suggested, thanks.</div><div dir="auto"><br></div><div dir="auto">I set dynamic_ownership=0 and use these hooks during the live build for permissions. (I googled a lot, and apparently libvirt needs the images to be executable too)<br></div><div dir="auto"><br></div><div dir="auto"><span style="background-color:rgb(255,255,255)">chown -R libvirt-qemu:kvm  /var/lib/libvirt/images</span></div><div dir="auto"><span style="background-color:rgb(255,255,255)">chmod -R g+rwx /var/lib/libvirt/images</span></div><div dir="auto"><br></div>Booting the live debian iso everything works in virt-manager, but again, after clicking "run", a copy of the vm image is created in /run/live/overlay/rw/var/lib/libvirt/images and only then does the VM start.<div dir="auto"><br></div><div dir="auto">Either it's still being chowned or chmodded somehow, or it's something else, but I can't stop this copy being made.</div><div dir="auto"><br></div><div dir="auto">Interestingly, when I boot the Live debian iso and then copy the images into /var/lib/libvirt/images from my USB stick, the VM starts immediately without creating any copies in the /run/live.... directory. So my guess is that maybe the squashfs could be the issue?</div><div dir="auto"><br></div><div dir="auto">Editing the XML</div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif"><source file='/var/lib/libvirt/images/</span><span style="font-family:sans-serif">vm1.qcow2'></span><br style="font-family:sans-serif"><span style="font-family:sans-serif">      <seclabel relabel='no'/></span><br style="font-family:sans-serif"><span style="font-family:sans-serif">    </source></span></div><div dir="auto"><font face="sans-serif"><br></font></div><div dir="auto"><font face="sans-serif">This results in an error:</font></div><div dir="auto"><font face="sans-serif">Unsupported Configuration:</font></div><div dir="auto"><font face="sans-serif">Security driver model 'null' not available</font></div><div dir="auto"><font face="sans-serif"><br></font></div><div dir="auto"><font face="sans-serif">Here I tried setting security_driver=none in qemu.conf but same error after.</font></div><div dir="auto"><font face="sans-serif"><br></font></div><div dir="auto"><div dir="auto"></devices></div><div dir="auto">    <seclabel type='none'/></div><div dir="auto">  </domain></div><div dir="auto"><br></div><div dir="auto">This also returns an Error but I'm still googling to understand it properly.</div></div><div dir="auto"><br></div><div dir="auto"><font face="sans-serif">XML document failed to validate against schema</font></div><div dir="auto"><font face="sans-serif">Unable to validate doc against /usr/share/libvirt/schemas/domain.rng</font></div><div dir="auto"><font face="sans-serif">Invalid element relabel  for element seclabel</font></div><div dir="auto"><font face="sans-serif">Extra element seclabel in interleave</font></div><div dir="auto"><font face="sans-serif">Element domain failed to validate content</font></div><div dir="auto"><font face="sans-serif"><br></font></div><div dir="auto"><font face="sans-serif">Thanks again so much for your helo, I've been messing with this for weeks now and it's killing me.<br></font><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Tue, Nov 23, 2021, 9:43 PM Michal Prívozník <<a href="mailto:mprivozn@redhat.com">mprivozn@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11/23/21 17:25, Elias Mobery wrote:<br>
> <br>
> Hi everyone!<br>
> <br>
> I've built a Debian Live ISO with packages qemu and libvirt to run a VM<br>
> in the live environment.<br>
> <br>
> The guest images are placed in  /var/lib/libvirt/images and 2GB each.<br>
> <br>
> Everything works great, except for one issue.<br>
> <br>
> When starting a VM, libvirt automatically issues a chown command to the<br>
> images, changing ownership.<br>
> <br>
> This results in a copy of the images being created in<br>
> /run/live/overlay/rw/var/lib/libvirt/images<br>
> <br>
> I don't want these copies to be made but can't stop it.<br>
> <br>
> I've tried editing qemu.conf user/group, dynamic ownership etc. without<br>
> any luck.<br>
> <br>
> Is there a way to STOP libvirt from changing the ownership of these images?<br>
> <br>
> <br>
<br>
Setting dynamic_ownership=0 in qemu.conf is the way to go (don't forget<br>
to restart the daemon after you made the change).<br>
<br>
Alternatively, you can set <seclabel/> either for whole domain or<br>
individual disks, e.g. like this:<br>
<br>
  <disk type='file' device='disk'><br>
    <driver name='qemu' type='qcow2'/><br>
    <source file='/var/lib/libvirt/images/vm1.qcow2'><br>
      <seclabel relabel='no'/><br>
    </source><br>
  </disk><br>
<br>
or for whole domain:<br>
<br>
    ...<br>
    </devices><br>
    <seclabel type='none'/><br>
  </domain><br>
<br>
I'm not sure what your setup is, but if chown() is a problem then what<br>
if guest tries to write onto its disk? Wouldn't that create a copy in<br>
overlay?<br>
<br>
Michal<br>
<br>
</blockquote></div></div></div>