Remote X11 on OS X

I thought I’d blog this just in case someone else is having problems using XQuartz on OS X as a server to remote X11 applications (i.e. using ssh -X somehost).

At first this works but after some time (20 minutes, to be exact) you’ll get “can’t open display: localhost:10.0” errors when applications attempt to connect to the X server. This is because the X forwarding is “untrusted” and that has a 20 minute timeout. There are two solution here: increase the X11 timeout (the maximum is 596 hours) or enable trusted forwarding.

It’s probably only best to enable trusted forwarding if you’re connecting to machines you, well, trust. The option is ForwardX11Trusted yes and this can be set globally in /etc/ssh_config or per host in ~/.ssh/config.

2 thoughts on “Remote X11 on OS X”

  1. I believe you can also use ssh -Y somehost. Or perhaps ssh -XY somehost, I don’t know how those two options stack.

    I never understood the difference between regular and trusted X11 forwarding before. I see that ‘man ssh_config’ tells me ForwardX11Trusted has a Debian-specific default of “yes”.

  2. 1st of all thanks for the tips!

    2nd, I’ve tried using also ssh -Y user@remote but over time the problem arises. This has started happening more frequently since OS X 10.7… In fact I think there’s possibly a different default setting/behaviour in XquartZ over the old ‘Apple-made’

Comments are closed.