Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Question:

I have a Linux server where I connect to via ssh. It works fine, and also, X-forwarding works fine (in the local network).

Now I wanted to run a server program under wine. because it's a Windows application, it doesn't run on the command line, so I have to start it via x-forwarding. So far not a problem, works wonderfully.

My problem is I connect to the target computer with X-forwarding, like this:
ssh ip.of.target.computer -X

then I start

gnome-session 

from the ssh terminal. Gnome loads and i can start the graphical server application via wine. But when I want to logout from the X-forwarding, that closes the gnome-session (and the server X-window-application)...

How can I login, start a X-window application, and then logout ssh without closing the X-application ?

share|improve this question

2 Answers 2

You could run X on the remote machine and use x11vnc to manage running apps remotely.

share|improve this answer

You might find the -N option useful:

 -N      Do not execute a remote command.  This is useful for just for‐
         warding ports (protocol version 2 only).

and/or the -T option:

 -T      Disable pseudo-tty allocation.

That way you won't get a shell prompt.

Try combining it with disown.

ssh <host> -X -N -T &
disown %<number>

where <number> is whatever number is printed in bracket after running the ssh command.

For example:

$ ssh -X -N -T myserver&
[1] 10317
$ disown %1

That will detach ssh from the shell and window, so you can close the window and ssh will keep running.

share|improve this answer
    
The bottom line is, -N is useless because the server initially is in console mode, not xorg mode. –  Quandary Jan 26 '11 at 11:08

Your Answer

 
discard

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.