Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

9 Answers

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.

share|improve this answer
1  
Thanks, I am aware of screen, but it is not what I'm looking for. –  Abhinav Jul 15 '09 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 '09 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). –  James Polley Dec 28 '09 at 11:20
    
If you don't want to use screen, use tmux. –  valbaca May 25 '13 at 1:00
add comment

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.

share|improve this answer
    
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 at 15:03
add comment

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.

share|improve this answer
    
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 '09 at 13:47
add comment

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.
share|improve this answer
    
I already /run/ two vnc sessions. I need to move xterms between them, if possible. –  Abhinav Jul 15 '09 at 13:53
add comment

Have you looked into xmove?

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

share|improve this answer
    
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 '10 at 21:27
    
xmove is old and dead, NX is old but still sort of works, xpra does work –  totaam Oct 10 '13 at 8:57
add comment

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

I wonder if you are looking for export display handling.

share|improve this answer
    
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 '09 at 14:00
add comment

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|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.