11

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?

2
  • 1
    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, 2011 at 6:50
  • @pkaeding well if there are two interpretations, both useful, then you can answer for both. Do you know? Already somebody has commented asking re one of those interpretations " Alexander wrote " 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." <--- So, if you knew and answered for both, it might've helped him and others.
    – barlop
    Apr 20, 2015 at 13:52

4 Answers 4

4

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'
3

This works for me once I'm ssh'd in:

export DISPLAY=:0; nohup iceweasel &>/dev/null &
0

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.

1
  • 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, 2011 at 6:45
0

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.

1
  • 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. Nov 14, 2013 at 6:19

You must log in to answer this question.

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