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
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.
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.0or:
DISPLAY=:1000.0 xtermThis 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 '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.logand invoke with
ssh ~/bin/runme.sh 4