Running remote X Window applications locally on Mac

On Mac, install XQuartz from https://www.xquartz.org/

On remote Linux host Aorus.local, make sure:

  • $DISPLAY
1
2
$ echo $DISPLAY
localhost:10.0
  • $XAUTHORITY
1
2
3
4
5
$ echo $XAUTHORITY
/home/terrence/.Xauthority

$ ls -al /home/terrence/.Xauthority
-rw------- 1 terrence terrence 51 Jun 13 20:11 /home/terrence/.Xauthority
  • sshd_config
1
2
3
4
5
$ grep -iE 'X11Forwarding|X11UseLocalhost|XAuthLocation' /etc/ssh/sshd_config
X11Forwarding yes
X11UseLocalhost yes

$ sudo systemctl restart sshd
  • xauth
1
2
3
4
5
6
7
$ which xauth
/usr/bin/xauth

$ xauth list
Aorus/unix:10 MIT-MAGIC-COOKIE-1 27e55a1edf7347d27957e71637f99ab2

$ xauth add localhost:10 MIT-MAGIC-COOKIE-1 27e55a1edf7347d27957e71637f99ab2

Then on Mac run:

1
$ ssh -Y Aorus.local

On Aorus.local:

1
$ firefox

Contents