What made X Windows so special

April 18, 2011

I recently read an Ars Technica article on the history of Linux graphics, which contained the bald-faced line:

What made X so special, of course, is legendary. X was the first graphical interface to embrace a networked, distributed solution. [...]

Wrong. This is one of X's attributes, but it is not what made X special and successful. As I have touched on before, what made X so special is that it did not suck, it was portable, and oh yeah, it was free. That it was network transparent was a nice feature, but it was not the dominant way that X was used in many environments (especially because this network transparency required a lot of work and special magic to make work in practice; it only became 'transparent' to real people when ssh came along and handled all of that behind the scenes).

In the mid 1980s when it first came out, using X meant that you could have the same interface and run the same programs on your Vaxes, your Suns, and various other systems. More to the point, you and your graduate students could write your graphical programs once, not once for every different sort of Unix workstation that you might have. You could do this for free, and the result worked okay and performed decently.

(With a bit of work you could write the same program so that it worked on workstations with a wide variety of display capabilities, too, all the way from black and white through various sorts of colour displays.)

No vendor system could offer anything close to these advantages. All they could offer, sometimes, was more GUI widgets, and not infrequently they got very important core features subtly or blatantly wrong.

(You could make a strong case that X succeeded because its authors spent so much effort making a very good terminal emulator, but that's another entry.)

Sidebar: why remote X is not so transparent in practice

There are two troublesome parts of starting X programs remotely; they need to know the correct display to use, and they need permission to access the display. Because of how X chose to work, handling either of these requires some programming.

Telling programs which display to use is somewhat complicated because your local setting for $DISPLAY generally won't work for remote programs; in most X environments, it doesn't have the machine name in it. So you have to transform it before passing it to the remote machine. This transformation is not difficult, but something has to do it (either the user by hand, or a script that someone writes for them).

Giving programs permission is much more complicated. Generally you need to transfer a specific 'magic cookie' to the remote machine and then combine it with the right name for your display in the process of loading it into an authorization storage. In theory you can do this by hand; in practice, no, it has to be automated with a script and for added annoyance the script needs to run commands remotely on the target machine.

You could create a script environment that enabled you to do things like 'not-ssh yonge.cs xterm' (as I've discussed, I did), but it was not a simple script. And it didn't work in as many environments as ssh works today.


Comments on this page:

From 76.113.53.175 at 2011-04-18 03:12:39:

This is not how I remember the network transparency. In reality you logged in using xdm and that pretty much did everything automagically, except perhaps the sound. Even workstation users did not have much trouble. They used rsh and knew what a hostname was, so DISPLAY=foo:0 was nothing much to talk about. They also solved the xauth|rsh xauth problem with xhost +. Maybe for a perfectionist like you it was a hell on a stick to automate the "correct" way to use network transparency, but the masses never concerned themselves with small things like that.

From 174.152.66.221 at 2011-04-18 07:51:23:

I also think you're giving the network-transparency aspect short shrift.

X's network transparency meant that you could build X terminals; basically, thin-ish clients that would connect to some local server for xdm - you'd then run your window manager and an initial xterm or two on that server, and rsh over to other servers on the network.

$DISPLAY would follow you, because rsh would carry environment variables from one machine to another. Permission was dealt with by doing "xhost +servername", or very occasionally "xhost +". Network transparency was vitally important in academic environments, and winning there meant winning the UNIX world.

By the time magic cookies came around and got to be the popular, standard thing to do, X was already solidly established as the way to do UNIX GUIs.

You imagine network transparency as cumbersome because you're imagining an environment where you don't automatically heavily trust every other person on the network. If you're willing to be amazingly insecure, network transparency isn't cumbersome at all.

By cks at 2011-04-18 10:27:36:

Network transparency, xdm, and X terminals were important later on in X's life, but they were not what made it a success initially (partly because when X started, no one had any X terminals). Xdm in general is a special case, because it is a captive environment between the server and the client; the magic it uses is not something that can be reused when you want to connect to a second machine as well.

(Similarly, in the early days of X I'm pretty certain that no common version of rsh passed your $DISPLAY environment variable to the remote end.)

My experience with 'xhost +<host>' (or 'xhost +') was that a number of programs (some of them important ones for me) refused to work or work well if it was enabled. It's also not something that you could really tell people in a general academic environment without a lot of caveats about giving bored graduate students access to their session. And even with 'xhost +<host>' that's an extra step (two, if you're going to remove the permissions after you're done).

(Let's not even think about undergrad students.)

You could work around all of these issues. But the early days of X were nowhere near 'transparent' in the sense that it is today, where you can do 'ssh remote xterm' and have it all just magically work. Multi-step sequences are not transparent this way.

Written on 18 April 2011.
« The ultimate (for now) answer for our ZFS ARC size problem
A difference between Python 'structs' and C structs »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Mon Apr 18 00:12:51 2011
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.