Change display of running program.

Posted on 2004-11-21
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

    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

    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 61

    Assisted Solution

    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.
    LVL 20

    Accepted Solution

    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
    LVL 2

    Author Comment

    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

    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

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
    I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    6 Experts available now in Live!

    Get 1:1 Help Now