Linutronix / elbe

Embedded Linux Build Environment
https://elbe-rfs.org
GNU General Public License v3.0
170 stars 59 forks source link

libvirt.libvirtError: Cannot access storage file #370

Closed yegorich closed 1 year ago

yegorich commented 1 year ago

On Ubuntu 22.04.1 LTS I get the following error when creating initvm:

libvirt: Storage Driver error : Cannot access storage file '/home/user/elbe/initvm/initvm.img' (as uid:64055, gid:108): Permission denied

I have fixed it via editing /etc/libvirt/qemu.conf and setting user to myself. This article provides background info.

Can this issue be fixed in elbe code?

bgermann commented 1 year ago

@a-darwish Is this the bug that you reported to me some days ago?

bgermann commented 1 year ago

It is already in the documentation that you have to add the elbe running user to the libvirt group.

yegorich commented 1 year ago

@bgermann do you mean this command?

adduser <youruser> libvirt

This was already done. But it is not enough.

bgermann commented 1 year ago

The quickstart doc also says: adduser <youruser> libvirt-qemu

yegorich commented 1 year ago

No, this doesn't help. AFAIK, you don't have to add a user to libvirt-qemu. Only kvm and libvirt groups matter.

yegorich commented 1 year ago

This issue seems to have something to do with the newer libvirt version (new security policy). See this thread.

I ended up adding read permissions to libvirt-qemu user to my home folder. Looks like specifying such permissions for initvm folder alone, is not enough.