"Detach" and "Reattach" xterms across X sessions?

11,064

Solution 1

I know this post is old but...

http://xpra.org/ Xpra is 'screen for X'

...Crazy how many people seemed to have answered without actually reading your question. Xpra will not only let you move applications from one display to another on any machine, it will allow you to totally shut disconnect the apps from any real display and then re-attach later.

Solution 2

Not quite what you've asked for, but screen may do what you want.

This shares at the shell level rather than the X-window level, so you could have two xterms (on different Xservers, so long as they were on the same box), running screen -x, which would show the same sh sessions.

This wouldn't work for non-terminal things.

EDIT: xpra is probably what you want.

Solution 3

You can use screen within an xterm. This is a program that allows you to attach and detach terminal sessions. So you would start an xterm, start screen within the xterm, and use the xterm as normal. To move the session, you would detach from the session within screen and exit the xterm. Start up another xterm somewhere else, and reattach to the existing screen session.

If you want to do it with any X program, you can use NX. It works like screen, in that you are able to detach/attach to a X server. It also understands the X11 protocol, so it does a good job at speeding up X over slow networks.

Solution 4

CryoPID used to be able to move GTK+ applications (like gnome-terminal) between X servers. It's been unmaintained for a while, so it might not work at the moment, but some people have picked it up and started working on it again.

Solution 5

No. Out of the box X does not have this facility. If you want to do this the best way is to use XVNC which is an x server that renders to a VNC virtual frame buffer. Then you can connect to your X session using a VNC client.

Share:
11,064

Related videos on Youtube

Lukasz
Author by

Lukasz

Updated on September 17, 2022

Comments

  • Lukasz
    Lukasz over 1 year

    Is there a way to save/detach an xterm (or another window), and reopen/load/reattach it on a different X session on the same machine ?

    What I'm trying to achieve is "move" running xterms between two VNC sessions running on a machine.

    No, I'm not looking for screen :)

    I do not want to use screen, because then I will need to use a separate screen session for each xterm. Using multiple tabs in screen does not work fine for my case, as I need to look at multiple xterms at once - not switch between the tabs.

    NX is another option which came up, but it requires privileges on the server to install the s/w. I am looking for some solution using X, or some option in one of the window managers directly. fvwm / xfce / gnome would be good, but other WMs having this facility are welcome too.

  • Lukasz
    Lukasz almost 15 years
    Thanks, I am aware of screen, but it is not what I'm looking for.
  • Lukasz
    Lukasz almost 15 years
    Thanks for the pointer to NX, but I don't have privileges to install s/w on the servers. Is there anything built into any of the window managers, or X itself which can be used ?
  • Lukasz
    Lukasz almost 15 years
    I already /run/ two vnc sessions. I need to move xterms between them, if possible.
  • Lukasz
    Lukasz almost 15 years
    As I understand, export display will spawn the window on a particular display. I want to change the display while the spawned process is running.
  • TREE
    TREE over 14 years
    With screen you can actually have different xterms with different terminals. Just use screen -x and switch each xterm to it's own screen. One xterm can have screen 1, another screen 2, etc. This could all be scripted, too... "xterm -e screen -x -p 1 &" etc.
  • James Polley
    James Polley over 14 years
    +1 for screen. You said that "I do not want to use screen, because then I will need to use a separate screen session for each xterm. " - but you can share the same screen session with all your xterms (using screen -x to reattach, as TREE said), and each xterm can look at the same screen window (if that's what you want), or a different screen window inside each xterm (if that's what you want; it's not clear from your original question).
  • rplevy
    rplevy about 14 years
    Abhinav, did you look into this option? I was trying to do the same thing, and I found this question while searching for xmove.
  • valbaca
    valbaca almost 11 years
    If you don't want to use screen, use tmux.
  • totaam
    totaam over 10 years
    xmove is old and dead, NX is old but still sort of works, xpra does work
  • J Cooper
    J Cooper over 10 years
    I just became aware of xpra, and remembered about this question. Thought I was going to get a decent answer to it after all this time. Oh well, have an upvote.