Disconnect/reconnect to applications running on a remote X server

Problem: Run a program remotely, let the program continue to run even if your network connection goes down.

Solution: let Xpra manage a virtual X server, start your program as a client to that X server. Connect to Xpra to connect to the program.

Theory: programs are clients to a X server, which renders their windows on a "canvas". This "canvas" can be virtual, in which case it is only rendered at demand. When connecting remotely, you run a program that is a client to your local x-server, and this program (xpra) forwards the rendering commands from the remote (virtual) X server to the local (real) X server, which in the end renders the image.

Start a server and an application

locally

XDG_RUNTIME_DIR=/tmp xpra start-desktop :100 —start-child=openbox —exit-with-children=yes —sync-xvfb=150 —pixel-depth=16 —speaker=disabled —microphone=disabled —opengl=no —av-sync=no —terminate-children=yes —pulseaudio=no —mmap=no —mdns=no

Attach to a running server

xpra attach ssh://hansekbrand.se/

Stop a running server

xpra stop ssh://hansekbrand.se/

"This command attaches to a running xpra server, and requests that it terminates immediately. This generally causes any applications using that server to terminate as well."

Run a single application "seamless" mode

xpra —dpi=180 attach ssh://hansekbrand.se:19840 or xpra —dpi=180 attach ssh://gpu-monster

comments powered by Disqus


Back to the index

Blog roll

R-bloggers, Debian Weekly
Valid XHTML 1.0 Strict [Valid RSS] Valid CSS! Emacs Muse Last modified: februari 16, 2025