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.
3 Answers 3
The general way to start a graphical program from a remote machine:
On the target machine run
xhost +. (You'll need to do this from a terminal, or from a login script.)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.
-
1-1 (if I could) for xhost +. That is just terrible.Sardathrion - against SE abuse– Sardathrion - against SE abuse2011年08月22日 09:07:39 +00:00Commented Aug 22, 2011 at 9:07
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?
Use
screento keep the program open.Start the program with the right user and
DISPLAYvariable of the running X-Session.
For example:
xterm -display :1000.0
or:
DISPLAY=:1000.0 xterm
This should work with Wine as well.
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
-
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.Ozzah– Ozzah2011年08月22日 11:30:43 +00:00Commented 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.Sardathrion - against SE abuse– Sardathrion - against SE abuse2011年08月22日 11:36:43 +00:00Commented 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.Ozzah– Ozzah2011年08月22日 13:58:11 +00:00Commented 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.Sardathrion - against SE abuse– Sardathrion - against SE abuse2011年08月22日 14:04:30 +00:00Commented Aug 22, 2011 at 14:04