Ssh – X11 forwarding to Mac does not work

macintoshsshUbuntux11xforwarding

I'm running a Ubuntu server in VMWare. And I would like to forward the X11 from the Ubuntu guest to the Mac host.

I've installed XQuartz 2.7.9 (xorg-server 1.17.4) on the Mac host.

And SSH forwarding on the Ubuntu is enabled.

Then I tried the following in iTerm:

%> echo $DISPLAY
/private/tmp/com.apple.launchd.mjxVyILVrR/org.macosforge.xquartz:0
%> ssh -X root@xxxx
# echo $DISPLAY

# gnome-terminal
Unable to init server: Could not connect: Connection refused
Failed to parse arguments: Cannot open display

$DISPLAY is empty, and X11 forwarding is not working.

Any ideas?

Best Answer

Try running ssh -Y root@xxxx in xterm inside XQuartz instead of from iTerm. Does that work?