Latest update.
I decided to do some debugging, I learned how to get some logs from sshd as well as adding `LogLevel DEBUG` to /etc/ssh/sshd_config.
What I've learned is that if I `ssh -X <ip-mac-pro>` from my linux box and then execute `xclock` I get the following logs:
wink@Winks-iMac-Pro gitk % sudo log stream --level debug 2>&1 | grep 'X11'
2023-0 ... sshd: debug1: channel 1: new [X11 inet listener]
2023-0 ... sshd: debug1: channel 2: new [X11 inet listener ...
2023-0 ... ContextStoreAgent: (LaunchServices) [com.apple. ...
2023-0 ... ContextStoreAgent: (LaunchServices) [com.apple. ...
2023-0 ... sshd: debug1: X11 connection requested.
2023-0 ... sshd: debug1: channel 3: new [X11 connection fr ...
2023-0 ... sshd: debug1: channel 3: free: X11 connection f ...
2023-0 ... ContextStoreAgent: (LaunchServices) [com.apple.
2023-0 ... ContextStoreAgent: (LaunchServices) [com.apple.
But if I do execute `gitk` I get:
wink@Winks-iMac-Pro gitk % sudo log stream --level debug 2>&1 | grep 'X11'
2023-0 ... sshd: debug1: channel 1: new [X11 inet listener]
2023-0 ... sshd: debug1: channel 2: new [X11 inet listener]
2023-0 ... ContextStoreAgent: (LaunchServices) [com.apple.l ...
2023-0 ... ContextStoreAgent: (LaunchServices) [com.apple.l ...
2023-0 ... runningboardd: (RunningBoard) [com.apple.running ...
2023-0 ... System Events: (LaunchServices) [com.apple.launc ...
2023-0 ... System Events: (LaunchServices) [com.apple.launc ...
2023-0 ... System Events: (LaunchServices) [com.apple.launc ...
2023-0 ... System Events: (LaunchServices) [com.apple.launc ...
2023-0 ... System Events: (LaunchServices) [com.apple.launc ...
2023-0 ... System Events: (LaunchServices) [com.apple.launc ...
2023-0 ... runningboardd: (RunningBoard) [com.apple.running ...
2023-0 ... runningboardd: (RunningBoard) [com.apple.running ...
2023-0 ... runningboardd: (RunningBoard) [com.apple.running ...
2023-0 ... X11.bin: (HIToolbox) [com.apple.HIToolbox:MBHeig ...
2023-0 ... X11.bin: (HIToolbox) [com.apple.HIToolbox:MBHeig ...
2023-0 ... X11.bin: (HIToolbox) [com.apple.HIToolbox:MBHeig ...
2023-0 ... X11.bin: (HIToolbox) [com.apple.HIToolbox:MBHeig ...
2023-0 ... X11.bin: (LaunchServices) [com.apple.launchservi ...
2023-0 ... X11.bin: (HIServices) [com.apple.hiservices:proc ..
2023-0 ... runningboardd: (RunningBoard) [com.apple.running ...
2023-0 ... loginwindow: (LaunchServices) [com.apple.launchs ...
2023-0 ... runningboardd: (RunningBoard) [com.apple.running ...
2023-0 ... runningboardd: (RunningBoard) [com.apple.running ...
2023-0 ... X11.bin: (HIToolbox) [com.apple.HIToolbox:MBHeig ...
2023-0 ... X11.bin: (HIToolbox) [com.apple.HIToolbox:MBHeig ...
2023-0 ... ContextStoreAgent: (LaunchServices) [com.apple.l ...
2023-0 ... ContextStoreAgent: (LaunchServices) [com.apple.l ...
2023-0 ... loginwindow: (LaunchServices) [com.apple.launchs ...
2023-0 ... runningboardd: (RunningBoard) [com.apple.running ...
When executing `xclock` I see the gui on the linux box, but when I execute `gitk` I see the gui on the Mac! Also, when looking at the logs notice that there are 5 that the that have `sshd: ` when executing `xclock` but only 2 lines when executing `gitk`. The three missing lines, less the preamble, are:
sshd: debug1: X11 connection requested.
sshd: debug1: channel 3: new [X11 connection from ::1 port 49578]
sshd: debug1: channel 3: free: X11 connection from ::1 port 49578, nchannels 4
I cloned the openssh source code and used `rg` to search for 'connection requested' and I found:
wink@Winks-iMac-Pro ssh % rg 'connection requested'
channels.c
1655: debug("X11 connection requested.");
If we look at what routine that `debug` line is in, we see:
/* This is our fake X11 server socket. */
static void
channel_post_x11_listener(struct ssh *ssh, Channel *c)
{
Channel *nc;
struct sockaddr_storage addr;
int r, newsock, oerrno, remote_port;
socklen_t addrlen;
char buf[16384], *remote_ipaddr;
if ((c->io_ready & SSH_CHAN_IO_SOCK_R) == 0)
return;
debug("X11 connection requested.");
So I "know" that for some reason `gitk` didn't get connected to the "face X11 server" of sshd. So next step is to learn why `channel_post_x11_listener()` didn't get called.
Any clues would be appreciated :)