Trying to open a GUI from a remote server using Mac but not successfully

17,860

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!

Share:
17,860

Related videos on Youtube

Jim
Author by

Jim

Updated on September 18, 2022

Comments

  • Jim
    Jim over 1 year

    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?

    • Michael James
      Michael James almost 11 years
      :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.
    • Vihung
      Vihung over 7 years
      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.
  • Jim
    Jim almost 11 years
    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?
  • slm
    slm almost 11 years
    @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.