I'm brand new user in MacOSX. I'm using ssh to connect to some Linux servers. I'm trying to open a GUI locally for a process running in the remote Linux server.

So I read that I should install XQuartz which is used for the X11 in the Mac.
I installed it but when I try to start the GUI I get error that DISPLAY is not set.

Indeed when I echo DISPLAY, nothing has been set. Am I supposed to set something manually?

I also noticed that there is some command line as part of the XQuartz installation. Am I supposed to use only this command line? When I start it and echo DISPLAY I see just :0.0. How can I configure this?

I tried ssh -X to connect and additionally I also checked out the X-11 FAQ According to this something overrides my DISPLAY on the local machine. I suspect that TextMate which I installed previously does this, but I'm not sure how can I override it. What should I set? What is: /tmp/launch-Bh0fLm/:0?

  • :0.0 normally refers to the host graphics adapter. I ssh and ssh -X into my server at work (to ubuntu from ubuntu) and in both cases echo $DISPLAY returned localhost:10.0. I do frequently launch gnome apps from remote machine via ssh command line. IMHO, investigate as much as you can about remove X sessions in Mac OSX. Sorry, I don't know more.
    – Krista K
    Commented Jun 30, 2013 at 22:11
  • Have you tried using the -Y parameter for ssh. Thus, ssh -Y user@server. Once connected, you should be able to launch your GUI app from the remote shell.
    – Vihung
    Commented Sep 15, 2016 at 14:11

1 Answer 1


Try the following on your Mac OSX system:

Enable X11 Forwarding with the “X11Forwarding yes” option set in /private/etc/sshd_config for your SSH daemon's own local X11 host. This will allow the Mac OSX host to receive X11 client requests back from the remote machines (Linux) through ‘ssh‘ with the -X option set.

Then restart sshd on the Mac OSX host:

Under System Preference / Sharing pane on Mac OS X. The SSH daemon should be running on the remote machine as well!

  • 1
    The SSH daemon should be running on the remote machine as well! What do you mean?If I am connected via ssh to the remote machine then it should be already running, right?
    – Jim
    Commented Jul 11, 2013 at 20:26
  • @Jim - yes that comment means what you said. It was only meant as a reminder, but given you're connecting to the Linux boxes it's moot.
    – slm
    Commented Jul 11, 2013 at 21:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .