LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-30-2007, 06:34 AM   #1
Rohan_mk1
LQ Newbie
 
Registered: Aug 2004
Posts: 27

Rep: Reputation: 15
X forwarding (DISPLAY variable)


Hi

I'm using ssh to log in to a server and I run programs like bittorrent on it to save my own resources.
I'd like to leave the program up and running while turning off my home box.

The first problem I ran into is:
How to switch the X display the application is using so that the application starts/stops showing up on my screen while it's running? I will need it to "resume" viewing the app.

Another problem:
How to prevent it from stopping after I close the ssh session (daemonize it)? I guess it has to be disconnected from the sshd together with the shell, but how to do it?

I'd appreciate any help.
 
Old 07-30-2007, 08:45 AM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
An easy way to do this is to run a vncserver on your server. Mine starts one when it boots, so it's always sitting there, waiting for me to connect.

You could ssh to the server and start a vncserver:
user@localhost$ ssh remoteserver
user@remoteserver$ vncserver :1 -geometry 1024x768 -depth 24
then logout of the server, and reconnect with vnc:
user@localhost$ vncviewer remoteserver:1

Your remote desktop appears in a window on your local machine.
Start any programs you like
You can close this vncserver window at any time, and the connection will be lost, but the server will continue to run your remote desktop and programs.

To reconnect at any time just
user@localhost$ vncviewer remoteserver:1
as before.

If the server is running all the time, you'll only need to restart the vncserver if it is rebooted.

Last edited by tredegar; 07-30-2007 at 08:48 AM.
 
Old 07-30-2007, 09:25 AM   #3
Rohan_mk1
LQ Newbie
 
Registered: Aug 2004
Posts: 27

Original Poster
Rep: Reputation: 15
I've been considering running a vnc server, but I think it's not flexible enough and takes up too much bandwidth, especially when I'm goin to log in from outside the internal network.
It's going to be a multi-user service, so I want this to be as easy to manage and lightweight as possible, so vnc is out of competition.
Thanks, anyway.
 
Old 07-30-2007, 10:17 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
OK.
Have you considered screen ?
 
Old 07-30-2007, 02:03 PM   #5
Rohan_mk1
LQ Newbie
 
Registered: Aug 2004
Posts: 27

Original Poster
Rep: Reputation: 15
I've just read the screen docs and this would look like the solution, but it doesn't work quite well with X apps - it closes my testing application together with the ssh connection.

I suppose I have to open a temporary X session on the server to "park" those running processes until I reattach them.
I know that altering DISPLAY is possible in screen, but I don't know how to do it. I don't know how to get the X display number (gdm running constantly on the server) or how to create another X display...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DISPLAY variable value behind firewall atifali Linux - General 1 02-26-2006 08:11 AM
Problem withChanging DISPLAY environment variable to display on someone else's screen wantsri Linux - Networking 1 10-25-2005 11:14 AM
Tcl Error no display name and no DISPLAY environment variable thinkgeek Programming 5 07-06-2005 10:24 PM
set DISPLAY variable W1pEout[64] Linux - Software 4 01-07-2004 09:41 AM
About setting DISPLAY variable Rex_chaos Linux - General 4 09-29-2003 01:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration