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
%> 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?

  • Post verbose log from the ssh -X -vvv root@xxxx to see what is going on there. – Jakuje Sep 23 '16 at 6:49
  • Make sure you have xauth installed at both sides, try adding the -Y flag to the ssh command – Tim Fletcher Sep 23 '16 at 7:54
  • @TimFletcher /usr/bin/xauth: file /root/.Xauthority does not exist, weird. It actually exists with permission 0600 – daisy Sep 23 '16 at 10:12
  • Could there be restrictions on xforwarding for root? – Tim Fletcher Sep 23 '16 at 10:35

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


open /etc/ssh/sshd_config in remote system and set X11Forwarding yes . Then restart ssh service and try again

  • It's already enabled .. – daisy Sep 23 '16 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.