X11 Forwarding using SSH

Since this is a problem people running snaps over X11 will continue to run into, perhaps you could include the suggestions in your OP so people don’t need to read the entire thread? Apparently, according to ogra via snapcraft irc:

no, linking wont help … that would allow to break out of the sandbox snaps use apparmr to confine disk/filesystem access … apparmor does not allow to follow symlinks

The answer for Ubuntu 22.04 was

$ tail -2 ~/.bashrc
##added 2023.01.04 from https://forum.snapcraft.io/t/x11-forwarding-using-ssh/2381
export XAUTHORITY="$HOME/.Xauthority"