Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to run a GUI application on my Ubuntu computer, but it should started by a shell script on my Debian server trought SSH.

Is this possible?

share|improve this question
It seems there is a little confusion over what you are trying to do. Are you trying to run a GUI program on a remote host, but have the GUI window appear on your local host? Or are you trying to run an application locally (and have the window appear locally), but have it triggered remotely? –  pkaeding Jan 7 '11 at 6:50

3 Answers 3

Yes, this is possible. You will just need to forward X traffic through the SSH connection. For example, connect like this:

debian-computer:$ ssh -X username@ubuntu-computer

Then, just start the application from the SSH prompt. The GUI window will appear on your debian box (which you are logged into locally). All processing will be done by the remote computer (the ubuntu one).

Note that this will only work if you have an X window server running on your local computer. This will definitely be the case if you have a desktop linux/unix installation, and you can also install X servers on Mac OS and Windows, but they are not installed by default.

share|improve this answer
He wanted the server to run a GUI program on the desktop, aka the server connect to the desktop and execute the program. –  OneOfOne Jan 7 '11 at 6:45

Something like this should work:

#on your desktop 
xhost + #not secure, make sure your X isn't listening on any tcp ports.
echo 'export DISPLAY=:0; x-command-you-want &' > ~/run-command
chmod +x ~/run-command
#on your server
ssh user@desktop '~/run-command'
share|improve this answer

Thanks for your responses. In the mean time I've tried a couple other things and one of those things was to make a SSH connection to the Ubuntu computer and run a script on that machine.

On one of the first lines of that script I defined the EXPORT display. The player knows right now what display he should use..

Thanks again.

share|improve this answer
Hi. It's been a while, but maybe you still remember if you were able to start TeamViewer from ssh. I would appreciate if you could share more detail on how you did that. Thanks. –  Alexander Chertov Nov 14 '13 at 6:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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