Tuesday, April 28, 2009

GNU Screen for X

If you don't know what GNU "screen" is, use this as a primer. The most interesting bit is that it allows you to disconnect from a server, and have all of your programs continue to run until you return.

Except that it only works for terminal environments.

Something similar for graphical environments would be VNC; With most VNC servers, if you disconnect from the server, your programs continue to run even while you're not connected. Actually, servers that don't do this are the exception, rather than the rule.

There are two problems with the VNC protocol that make it not ideal, though. The first is that you have a severe trade-off between image quality and latency over low-bandwidth networks. The second is that applications served up over VNC integrate terribly with the host desktop session. VNC servers these days handle clipboard transfer well enough, but you can forget drag-and-drop or resizing your window.

The UNIX world has had this partially solved for so many years, it's ridiculous. Enter, the X Window System. On most systems, it's only used to display the output of programs running on the local computer on your local monitor. But it also allows you run Firefox on computer A and allow the Firefox window to show up on computer B, with no visible indication to the user of computer B that his program isn't running locally. If you've used Parallels or VMWare Fusion to display Windows programs on a Mac screen, you understand how valuable such a relatively seamless integration is. And the X Window System has supported this since the 1980s. That's at least twenty years, now.

What's missing is the ability to combine the remote desktop integration capabilities of X with the headless nature of GNU Screen and the detachable session nature of GNU Screen and VNC. I'll leave the question of why this is valuable as an exercise to the reader. Should be pretty easy to figure out.

(And despite the fact that they bill themselves that way, ratpoison isn't what I'm looking for. They're missing the detachable session side of things, because they're just a window manager, and not a stub/proxy X server.)

2 comments:

  1. GNU screen has been on my mind as well. I really want to devise a way to make session resumption easier for non-technical users.

    ReplyDelete
  2. I haven't tried it, but I think NoMachine NX might be able to do what you want.

    BTW: It's funny that you mention VNC being slow and suggest X as a fast alternative. Depending on the application, VNC can be considerably faster than X. VNC's latency is roughly proportional to the amount of pixels that have changed on-screen, while X's latency can vary wildly. Some apps try to load a bunch of pixmaps up-front, for example, which can lead to annoyingly long load times.

    ReplyDelete