5

I'm logged into my Ubuntu 11.04 box using SSH, and I need to start a program - but it is a Windows GUI program which runs under WINE.

How can I start the program from the SSH terminal so that it opens on the desktop, and then stays open even after I log out of SSH.

slhck
236k73 gold badges639 silver badges611 bronze badges
asked Aug 22, 2011 at 3:55

3 Answers 3

3

The general way to start a graphical program from a remote machine:

  1. On the target machine run xhost +. (You'll need to do this from a terminal, or from a login script.)

  2. from a remote client, SSH into the target machine and run nohup program & where "program" is the program as you would run it if you were sitting at the target machine.

slhck
236k73 gold badges639 silver badges611 bronze badges
answered Aug 22, 2011 at 4:45
1
  • 1
    -1 (if I could) for xhost +. That is just terrible. Commented Aug 22, 2011 at 9:07
1

If you want the program forwarded to your Display connect with ssh -X.

But I guess you want to start the program on the remote display?

  1. Use screen to keep the program open.

  2. Start the program with the right user and DISPLAY variable of the running X-Session.

For example:

xterm -display :1000.0

or:

DISPLAY=:1000.0 xterm

This should work with Wine as well.

slhck
236k73 gold badges639 silver badges611 bronze badges
answered Aug 22, 2011 at 9:55
0

Make sure you have sshd set up so that it allows X11 forwarding.

Then, just start your GUI as per normal (nohup if you want it to run after you log out) and it will appear on your machine.

Edit: if you wanted this to run from an icon (see comment) then you can alias the icon command to

ssh [email protected] 'nohup MyProgram &'

Or just create a small shell script (called ~/bin/runme.sh) on the remote host with this in it:

#!/bin/sh
nohup MyProgram & 2>&1 $HOME/.nohupp.log

and invoke with

ssh [email protected] ~/bin/runme.sh
4
  • I don't want to have the program running on my remote terminal, I actually want it to start up on my server as though I had double-clicked the icon. Commented Aug 22, 2011 at 11:30
  • I am not sure I understand: you want a programme installed on a remote server to run on your desktop and not on the remote server? I have edited my answer to add a icon-like script. Commented Aug 22, 2011 at 11:36
  • No, it's not a remote server. The machine is at home and I am at work. I want to start a program on the server as though I was at home sitting in front of the computer, double-clicking the icon on the desktop, however I am not at home, I logged into the terminal via SSH. Commented Aug 22, 2011 at 13:58
  • To be clear: on your work machine (aka local) you want an icon that once clicked will start a programme on your home machine (aka remote) but display it on your work machine (aka local). You home machine (aka remote) will run the programme but you can interact with the GUI displayed on your work machine (aka local). If that is so, then change the icon to run the shh command above. Commented Aug 22, 2011 at 14:04

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.