Linux – Remotely launch a graphical program on Linux

linuxssh

Is there any way to remotely (ie, via SSH) launch a graphical program on a Linux machine? When using Putty, if I execute a command requiring X, I get "failed to open display". Note that I want the program to launch on the remote machine – so I do NOT want to forward the output to a local X server or anything like that.

I want this specifically for creating a remote-control app on Android – ie I hit a button on my phone, it opens a picture slideshow on the Linux machine.

I'm starting to feel like I may need to write my own server process to listen for these events…but if I can push them via SSH it might be simpler.

Best Answer

You have to set DISPLAY environment variable to X server you want your program to connect to.

For example xterm could be started with: DISPLAY=:0 xterm

Related Question