[SOLVED] Gnome Box - Box setup failed

Message
Author
User avatar
Buck Fankers
Posts: 770
Joined: Sat Mar 10, 2018 8:06 pm

Re: Gnome Box - Box setup failed

#11 Post by Buck Fankers »

Head_on_a_Stick wrote: Sun Dec 22, 2019 10:00 am Change the "Exec=" line to this:

Code: Select all

Exec=sh -c "XDG_DATA_HOME='data' gnome-boxes"
Then move your disk images to the new location and log out & back in again.
I'm afraid I will have to bug you again, I lost count what all I tried to do over last few days, nothing works, gnome-boxes always defaults installing images into ~/.local/share/gnome-boxes/images. My system:

Code: Select all

/home/mx/    <- user
~/.local/share/gnome-boxes/images   <- where images gets installed
/media/data/   <- data partition on the same disk as MX
/media/data/gnome-boxes/images/   <- desired location for installed images
I followed your steps, copied and edited desktop file as you suggested, editing: /home/mx/.local/share/applications/org.gnome.Boxes.desktop so execution line is now:

Code: Select all

Exec=sh -c "XDG_DATA_HOME='/media/data' gnome-boxes"
exactly how you see it here I copy/paste the line.

I'm running boxes with this command in terminal:

XDG_DATA_HOME='/media/data' gnome-boxes
or
gnome-boxes
or I run it by clicking desktop file, I even entered: Exec=sh -c "XDG_DATA_HOME='/media/data' gnome-boxes" into deskop file that is located on the desktop, so it matches with the one located in: /home/mx/.local/share/applications/

I edited fstab and tried (one at a time) these two lines, although I'm not sure I'm doing it correctly?

Code: Select all

~/.local/share/gnome-boxes/images	/media/data/gnome-boxes/images	ext4	defaults,nosuid,nodev,relatime	0	0
/home/mx/.local/share/gnome-boxes/images/	/media/data/gnome-boxes/images	ext4	defaults,nosuid,nodev,relatime	0	0
Whole data partition is already entered (and I'm the owner) as:

Code: Select all

UUID=eea17d6d-7afd-45ae-88b9-e470916c46d7	/media/data	ext4	defaults,nosuid,nodev,relatime	0	0
Thunar sees /media/data/gnome-boxes/images but clicking on it does nothing and right clicking on it and selecting 'mount' yields error:

Code: Select all

 Failed to mount "images".
mount: /media/data/gnome-boxes/images: operation permitted for root only
I do have ownership of /media/data partition and all it's subfolders, including /media/data/gnome-boxes/images:

Being desperate I tried

Code: Select all

sudo chown $USER:$USER /media/data/gnome-boxes/images
but as expected, does not change anything.

I can't recall what else I tried, but nothing works. Gnome-boxes always install image into ~/.local/share/gnome-boxes/images. My home is installed inside root (meaning no separate home partition) if this changes anything and my free space is limited, so i would like to be able to install all images into data folder on the same disk. Too bad, gnome-boxes don't have menu settings where you can just define default installation path.

Anyway, do you (or anyone else) happen to have any other idea, what I could also try?

User avatar
Head_on_a_Stick
Posts: 919
Joined: Sun Mar 17, 2019 3:37 pm

Re: Gnome Box - Box setup failed

#12 Post by Head_on_a_Stick »

Buck Fankers wrote: Sat Jan 11, 2020 2:02 pm gnome-boxes always defaults installing images into ~/.local/share/gnome-boxes/images.
Perhaps the location is hard-coded so setting XDG_DATA_HOME won't change it. Which would be a shame.
Buck Fankers wrote: Sat Jan 11, 2020 2:02 pm I edited fstab and tried (one at a time) these two lines, although I'm not sure I'm doing it correctly?

Code: Select all

~/.local/share/gnome-boxes/images	/media/data/gnome-boxes/images	ext4	defaults,nosuid,nodev,relatime	0	0
/home/mx/.local/share/gnome-boxes/images/	/media/data/gnome-boxes/images	ext4	defaults,nosuid,nodev,relatime	0	0
No, the first field should identify the partition so try something like

Code: Select all

UUID=$uuid /home/mx/.local/share/gnome-boxes/images ext4 defaults 0 2
Replace $uuid with the actual UUID of the partition.

Then attempt to mount the partition:

Code: Select all

sudo mount ~/.local/share/gnome-boxes/images
Check if it worked with

Code: Select all

grep gnome-boxes /proc/self/mounts
If all is good then correct the on-disk ownership:

Code: Select all

sudo chown -R ${USER}:${USER} ~/.local/share/gnome-boxes/images
That should let your normal user write to the partition.

EDIT: but that won't work if the partition is already mounted to /data, I would use a Btrfs subvolume instead in that situation.
mod note: Signature removed, please read the forum rules

User avatar
Buck Fankers
Posts: 770
Joined: Sat Mar 10, 2018 8:06 pm

Re: Gnome Box - Box setup failed

#13 Post by Buck Fankers »

Head_on_a_Stick wrote: Sat Jan 11, 2020 3:01 pm Perhaps the location is hard-coded so setting XDG_DATA_HOME won't change it. Which would be a shame.

EDIT: but that won't work if the partition is already mounted to /data, I would use a Btrfs subvolume instead in that situation.
HoaS - first let me thank you for all the help over time, I really appreciate it.

So my guess was correct, since whole partition was already mounted and accessible, I was already all set in this regard and that extra mount line I entered wrongly was not needed. Default images location may be hard-coded, although that would be surprising, but who knows...

Well, time for me to give a try to KVM/QEMU then ;-)

Post Reply

Return to “Software / Configuration”