I'm certain this will have been asked elsewhere, but I can't seem to word it in a way that is picking anything up.

I have a laptop next to me that I want to test my graphical (SDL) application on, as I develop. I want to start the process by executing the program via SSH.

Is this possible and, if so, how?

  • 1
    belongs to superuser May 22, 2011 at 1:48

2 Answers 2


Already figured it out, I should have held my horses. I entered export DISPLAY=':0' into my terminal (running SSH).

  • If you do ssh -X it should set the appropriate variables for you automatically.
    – El Yobo
    May 22, 2011 at 1:46
  • SSH supports X11 forwarding inherently, so if you start a ssh session with -X, then you can open X11 application over your ssh connection May 22, 2011 at 1:49
  • 2
    I don't want X forwarding, see my response to djs.
    – user80790
    May 22, 2011 at 2:38
  • That would probably be considered a display on the local machine... local to where the program is running. Anyway, now that we understand what you want, yes setting DISPLAY is the right approach. Also note that you have to be the same user as logged into X locally, or else adjust xauth settings.
    – Ben Voigt
    May 22, 2011 at 3:00

You're looking for X forwarding.

ssh -X user@host <program>
  • 1
    its -X actually (capital), -x will infact disable X11 forwarding, you might want to update your answer May 22, 2011 at 1:47
  • 3
    No I'm not, X forwarding is exactly what I don't want. I want to do all of my typing on one machine, but execute (via SSH) a command that will open a program on the remote machine.
    – user80790
    May 22, 2011 at 2:37
  • @Muu, I suggest you update your question since you didn't clearly specify you wanted to display the program remotely.
    – djs
    May 22, 2011 at 4:24

Your Answer

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