Change display of running program.

Posted on 2004-11-21
Medium Priority
Last Modified: 2013-12-27
I've managed to connect to my linux box from my PC using Cygwin. I want to be able to take over control of a runing program.
e.g. If I started xterm from the linux box, then logged in from my PC, how could I take control of that xterm session?

Also... how can I do this with normal console applications?

Preferrably looking for the simplest way of doing this, without having to install anything.
Question by:SaMuEl
LVL 10

Expert Comment

ID: 12638724
You have a couple of choices here:

If you want a GUI enviornment, you should use "VNC".  You just need to setup VNC so that it has a X11 window manager and all that.

If you want a console based environment, you should use "screen".  In this case, you would ssh into a machine and then use the proper screen arguments to "take over" an already established session running in screen.

Both of these do not require X11.  

VNC comes with it own X server.  Your session simply received screen refresh updates via the VNC client.
LVL 10

Expert Comment

ID: 12638732
Oh -- neither of these satifies your requirement of "without having to install anything".  Your distro of Linux may already come with these installed - and it may not.

You should be able to find LOTS of screen tutorials on the net.
LVL 62

Assisted Solution

gheist earned 80 total points
ID: 12640440
If you are root user you can suspend unwanted programs, that is "control".
You can dump program into core file and hijack with debuger from current state.
All is done without having to install anything, but is too complex for you.
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 20

Accepted Solution

Gns earned 212 total points
ID: 12960896
Basic answer is: "No, you cannot move a running program from one display to another". Moving between screens (a la xinerama) is another thing.

All that has been said above is true too;)

-- Glenn

Author Comment

ID: 12968694
So there's no way to route the output of one program from one X server to the next,
or the standard output of one console program, to another terminal?

Damnit linux isn't anywhere near as computer scientist friendly as people claim, it's such a simple thing I want to do.
LVL 10

Assisted Solution

Nukfror earned 208 total points
ID: 12968888
If you want to have something running under X11 at all times but want to "view" this X11 something from anywhere, you're right, *X11* can't handle this.  The operating system (Solaris, Linux, AIX, Windows, HPUX, MacOS, etc) you are running this X11 something on has *NOTHING* to with it.  Linux isn't your problem - its all about what X11 can and can not do.

From your discription really this sounds like VNC is perfect fit for what you are trying to do.  I qualify by saying I don't know what you are truely trying to accomplish or the specific problem you are trying to solve but VNC seems like a perfect candidate from this thread.
LVL 10

Expert Comment

ID: 12968892
Oh and it actually a rather complex thing you want to do because of the stateful nature of the TCP connections in use, the X11 protocol itself, and so on.  Conceptually it may seem easy ... but it ain't.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question