These days two things need to happen:
- the snaps need to be able to write to your home
- snap-confine needs to be able to perform mounts
For ‘1’, you can use the dpkg-reconfigure method or simply drop a file into /etc/apparmor.d/tunables/home.d. Eg, create /etc/apparmor.d/tunables/home.d/my-homes
:
# set to parent directory of your user's directories. Eg, if user's dir is /foo/bar/USER,
# set this to /foo/bar/
@{HOMEDIRS}+=/foo/bar/
Once you’ve done that, reload all the profiles with this:
$ sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/*
For ‘2’, with a recent stable core image, you can add apparmor rules to /var/lib/snapd/apparmor/snap-confine. Eg, create /var/lib/snapd/apparmor/snap-confine/my-homes
with:
# home directories are in /foo/bar, not /home
mount options=(rw rbind) /foo/bar/ -> /tmp/snap.rootfs_*/home/,
Then reload the snap-confine policy with:
$ sudo apparmor_parser -r /etc/apparmor.d/*snap-confine*
These settings will be remembered after this. The snap-confine directory was implemented recently for NFS home and it is planned that snapd will use this to handle alternate homes too.