14

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.

0

9 Answers 9

10

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.

1
  • 1
    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.
    – Greg
    Jan 15, 2014 at 15:03
4

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.

4
  • 1
    Thanks, I am aware of screen, but it is not what I'm looking for.
    – Abhinav
    Jul 15, 2009 at 13:42
  • 1
    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.
    – TREE
    Oct 28, 2009 at 17:57
  • +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). Dec 28, 2009 at 11:20
  • If you don't want to use screen, use tmux.
    – valbaca
    May 25, 2013 at 1:00
2

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.

1
  • 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 ?
    – Abhinav
    Jul 15, 2009 at 13:47
2

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.

1

As shipped? No. There used to be a "xmovex" application which would sometimes kinda do what you are asking, but it wasn't very popular and didn't work very well.

There are a couple of ways to get close to what you want:

  • run the desktop in a vnc session then connect to that from everywhere;
  • share your desktop through x11vnc;
  • look into nx and freenx.
1
  • I already /run/ two vnc sessions. I need to move xterms between them, if possible.
    – Abhinav
    Jul 15, 2009 at 13:53
1

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.

1

Have you looked into xmove?

http://en.wikipedia.org/wiki/Xmove

2
  • Abhinav, did you look into this option? I was trying to do the same thing, and I found this question while searching for xmove.
    – rplevy
    Feb 10, 2010 at 21:27
  • xmove is old and dead, NX is old but still sort of works, xpra does work
    – totaam
    Oct 10, 2013 at 8:57
0

If you only care about the command-line session inside the xterm, use screen

0

I wonder if you are looking for export display handling.

1
  • 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.
    – Abhinav
    Jul 15, 2009 at 14:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .