imochoa / dotfiles

collection of the setting that I like as well as some scripts to automate the post-install setup process
MIT License
0 stars 0 forks source link

if encrypting a dual hdd setup, make sure to tell apparmor where the new homes can be #52

Open imochoa opened 4 years ago

imochoa commented 4 years ago

I was finally able to fix this by running "sudo dpkg-reconfigure apparmor" and then specifying /home/DOMAIN/ as an additional user home directory! Now apparmor allows snap applications to access home directory!

imochoa commented 4 years ago

https://askubuntu.com/questions/930437/permission-denied-error-when-running-apps-installed-as-snap-packages-ubuntu-17

I ran into this because my home directory is symlinked from /home/$USER to another mount point. I fixed it with the suggestion from: https://bugs.launchpad.net/snapcraft/+bug/1620771

In short, you need to add your non-standard home directory to apparmor's HOMEDIRS variable:

$ sudo dpkg-reconfigure apparmor
or: create a file in /etc/apparmor.d/tunables/home.d/ that points to your home directory's mount point:

@{HOMEDIRS}+=/mnt/hdd/.home/
Then, just for good measure, you should delete apparmor's cache and reboot:

$ sudo rm -f /etc/apparmor.d/cache/* /var/cache/apparmor/snap.*

sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/*

sudo reboot
imochoa commented 4 years ago

https://forum.snapcraft.io/t/how-can-i-use-snap-when-i-dont-use-home-user/3352

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:

/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/,

sudo apparmor_parser -r /etc/apparmor.d/snap-confine