Gnome-boxes cannot create a new image on BTRFS separate subvolume. Permission denied

Hey, I have a BTRFS subvolume for ~/.local/share/gnome-boxes/images with copy on write disabled. When run from terminal I can see the error, but basically when I click on the plus sign then choose the OS, there is Create and Customize, and non of those are responsive. Upon seeing the logs I can see that there are no permissions given, but as far as I know gnome-boxes can run without root. This is the error tracked with journalctl -f:

internal error: Child process (/usr/bin/qemu-img create -f qcow2 -o compat=0.10 /home/user/.local/share/gnome-boxes/images/ubuntu20.04 26214400K) unexpected exit status 1: qemu-img: /home/user/.local/share/gnome-boxes/images/ubuntu20.04: Could not create ‘/home/user/.local/share/gnome-boxes/images/ubuntu20.04’: Permission denied

simiarly from gnome-boxes ran from terminal, after clicking the OS that I want to proceed with:

(gnome-boxes:19099): Boxes-WARNING **: 21:42:41.530: review-page.vala:32: Box setup failed: Failed to create volume: internal error: Child process (/usr/bin/qemu-img create -f qcow2 -o compat=0.10 /home/user/.local/share/gnome-boxes/images/ubuntu20.04 26214400K) unexpected exit status 1: qemu-img: /home/user/.local/share/gnome-boxes/images/ubuntu20.04: Could not create ‘/home/user/.local/share/gnome-boxes/images/ubuntu20.04’: Permission denied

additionally it says this:

(gnome-boxes:19099): Boxes-CRITICAL **: 21:42:41.530: boxes_assistant_review_page_populate: assertion ‘machine != NULL’ failed

Thank you in advance.

1 Like

It may be SELinux but we should check the easy answer first. Can we see the output of:

ls -ld ~/.local/share/gnome-boxes/images
1 Like

drwxr-xr-x. 1 root root 0 Aug 5 18:27 /home/user/.local/share/gnome-boxes/images

You don’t have rights to write there. It is only writable by root.

1 Like

It is a subvolume, so Is it safe to change user with chown?

there is a note on: chown` always clears the setuid and setgid bits.

Yes.

That shouldn’t be a problem in this case.

1 Like

Thank you! Changed both user and group to my user account and also 775 as /gnome-boxes folder was, so now I have:

drwxrwxr-x. 1 user user 0 Dec 20 00:22 /home/user/.local/share/gnome-boxes/images/

And everything works fine. A dummy for missing this, thank you very much @dalto!

2 Likes