Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm using X11 forwarding over ssh to run Linux apps on my Windows box, and when the network drops the lose everything that was running. Is there anything similar to screen for X11?

share|improve this question
Clarify. Why not just use screen? Or XVNC? You run screen on the Linux machine and when your network drops, reconnect and use screen -DR to reattach the session. –  nix Apr 4 '11 at 19:34
@nix Will that work for X apps? –  Michael Mrozek Apr 4 '11 at 19:44
@nix I don't think screen works for gui apps. –  Abdullah Jibaly Apr 4 '11 at 19:51
Of course, screen would require running from an xterm. –  nix Apr 4 '11 at 20:02
add comment

2 Answers

Xpra claims to be exactly that:

So basically it's screen for remote X apps.

I haven't used it in a while, but it worked pretty well when I tried it. You start the server on the remote machine:

[remote] $ xpra start :13

Then you attach to the server from your local machine:

[local] $ xpra attach ssh:remote:13

And now anything displayed on X display 13 on the remote machine will appear locally:

[remote] $ DISPLAY=:13 xeyes
share|improve this answer
There's also WinSwitch, which at a glance looks like it integrates xpra and other related software. –  Gilles Apr 4 '11 at 19:55
add comment

You're looking for VNC. The principle somewhat is similar to screen: you run a VNC server (the backgound SCREEN process), and a VNC client (the foreground screen process). The VNC server is an X server, so you can run X applications in it.

Run a VNC server on the Linux box and a client on the Windows box. You have several implementations to choose from; one possibility is TightVNC. TightVNC is in many Linux distributions (if it's not in yours, either install it or pick a different implementation), and there's a Windows client.

If your two machines aren't very close on the network — if there's a firewall or a risk of eavesdropper between them — you'll need to tunnel the VNC traffic through ssh. Have ssh forward the local port 5900 to the remote port 5900 (5900 corresponds to the display :0, use 5901 for `:1, etc.).

share|improve this answer
add comment

Your Answer


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.