can I move a running application from one X session to another?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
can I move a running application from one X session to another?
I frequently access my home computer throughout the day in two ways: either locally, or remotely using nxserver/nxclient. As one user, I have two concurrent X-windows sessions running, possibly with different applications running in each. Is it possible to move a running application from one session to the other? That is, I want all the active windows related to the app to disappear from one desktop, and open on the other.
Until someone proves me wrong, I will have to say it is not possible. Looking under the hood a little bit reveals the reason. Your applications are X clients. As such, they have TCP connections to their respective X servers, and each X server is running on a different host. Even if the TCP connection could somehow be seamlessly broken and transferred to another process on another host, there is still the matter of the X server's 'state'. That is, the X server remembers things about the condition of the windows an their content, as part of its function. This would be things like the size, decoration, tiling and overlap of windows, and of course the overall content in general. For there to be some kind of hand-off between X servers, all of this information would have to be transferred from one X server to another, even across hosts. I am certain that there is no such provision or service provided by the X protocol.
What you are asking for is something that I'm sure many of us have wished for. It would be nice if some industrious person or group could come up with an extension to X that would allow such a procedure.
One thing that is possible, which is somewhat akin to your wish, and may address part of your requirement, is the 'sharing' of text-based applications across multiple hosts. This can be done with the GNU screen utility, which is probably already installed on your distro. You can run screen, and within screen start up a text-mode application, or just a shell. You can then login from elsewhere, and from a shell, re-connect to the existing screen session. You can even have multiple users connected concurrently to a single screen session, if you configure screen appropriately. It is beyond the scope of a LQ thread to explain all of the details, and sadly, the usual recommendation to 'man screen' will result in a bewildering array of commands and switches explained in confusing language. The good news is that the basic functionality usually works fairly simply and right out of the box.
--- rod.
The only way I can imagine that this will work is if you run your x clients on a remote server via vpn or something like that. I am no expert in that kind of things so you'll have to investigate yourself. I mostly use text apps, and the few graphical apps that I use are not critical and can be closed and restarted at any time without problem.
... I found this thread, and subsequently found the solution that met my needs in xpra.
I'm running it on 64-bit Ubuntu 9.10 and all seems good. From my (brief) initial efforts it appears that one needs to point an application at the virtual display (xpra concept, AFAICT) when starting it, but after that, I was able to leave a GUI app running, quit the ssh session from my Mac, then log in again and re-acquire the app's GUI again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.