Trying to use any snap package, I run into following issue:
$ gimp
cannot create user data directory: /local/home/user/snap/gimp/40: Read-only file system
(Gimp is just an example).
I have my $HOME
in /local/home/$USER/
(I cannot change this!) and found that people have the same issue on the snap-store forum:
https://forum.snapcraft.io/t/how-can-i-use-snap-when-i-dont-use-home-user/3352 and https://bugs.launchpad.net/snapcraft/+bug/1620771
In this thread, people say /home
is hard-coded in snap
and they suggest to use a bind-mount to solve this.
What I tried:
$ sudo mount --bind $HOME /home/$USER
ls
correctly lists the content of my $HOME
$ ls /home/$USER
I also added the additional home dir to /etc/apparmor.d/tunables/home.d/my-homes
:
$ cat /etc/apparmor.d/tunables/home.d/my-homes
@{HOMEDIRS}+=/local/home/
and to /var/lib/snapd/apparmor/snap-confine/my-homes
:
$ cat /var/lib/snapd/apparmor/snap-confine/my-homes
mount options=(rw rbind) @{HOMEDIRS}/ -> /tmp/snap.rootfs_*/home/,
Running the snap again with bind-mount AND as well as OR changing files, the same error occurs as before.
How can I solve this ?
$ snap list gimp
Name Version Rev Tracking Developer Notes
gimp 2.10.0 40 stable snapcrafters -
$ snap --version
snap 2.32.9
snapd 2.32.9
series 16
ubuntu 16.04
kernel 4.4.0-127-generic
ln -s /local/home/username /home/username
) – Videonauth May 25 '18 at 11:33