X Window System


The X Window System is a windowing system for bitmap displays, common on Unix-like operating systems.
X originated as part of Project Athena at Massachusetts Institute of Technology in 1984. The X protocol has been at version 11 since September 1987. The X.Org Foundation leads the X project, with the current reference implementation, X.Org Server, available as free and open-source software under the MIT License and similar permissive licenses.

Purpose and abilities

X is an architecture-independent system for remote graphical user interfaces and input device capabilities. Each person using a networked terminal has the ability to interact with the display with any type of user input device.
In its standard distribution it is a complete, albeit simple, display and interface solution which delivers a standard toolkit and protocol stack for building graphical user interfaces on most Unix-like operating systems and OpenVMS, and has been ported to many other contemporary general purpose operating systems.
X provides the basic framework, or primitives, for building such GUI environments: drawing and moving windows on the display and interacting with a mouse, keyboard or touchscreen. X does not mandate the user interface; individual client programs handle this. Programs may use X's graphical abilities with no user interface. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces.
Unlike most earlier display protocols, X was specifically designed to be used over network connections rather than on an integral or attached display device. X features network transparency, which means an X program running on a computer somewhere on a network can display its user interface on an X server running on some other computer on the network. The X server is typically the provider of graphics resources and keyboard/mouse events to X clients, meaning that the X server is usually running on the computer in front of a human user, while the X client applications run anywhere on the network and communicate with the user's computer to request the rendering of graphics content and receive events from input devices including keyboards and mice.
The fact that the term "server" is applied to the software in front of the user is often surprising to users accustomed to their programs being clients to services on remote computers. Here, rather than a remote database being the resource for a local app, the user's graphic display and input devices become resources made available by the local X server to both local and remotely hosted X client programs who need to share the user's graphics and input devices to communicate with the user.
X's network protocol is based on X command primitives. This approach allows both 2D and 3D operations by an X client application which might be running on a different computer to still be fully accelerated on the X server's display. For example, in classic OpenGL, display lists containing large numbers of objects could be constructed and stored entirely in the X server by a remote X client program, and each then rendered by sending a single glCallList across the network.
X provides no native support for audio; several projects exist to fill this niche, some also providing transparent network support.

Software architecture

X uses a client–server model: an X server communicates with various client programs. The server accepts requests for graphical output and sends back user input. The server may function as:
  • an application displaying to a window of another display system
  • a system program controlling the video output of a PC
  • a dedicated piece of hardware
This client–server terminologythe user's terminal being the server and the applications being the clientsoften confuses new X users, because the terms appear reversed. But X takes the perspective of the application, rather than that of the end-user: X provides display and I/O services to applications, so it is a server; applications use these services, thus they are clients.
The communication protocol between server and client operates network-transparently: the client and server may run on the same machine or on different ones, possibly with different architectures and operating systems. A client and server can even communicate securely over the Internet by tunneling the connection over an encrypted network session.
An X client itself may emulate an X server by providing display services to other clients. This is known as "X nesting". Open-source clients such as Xnest and Xephyr support such X nesting.

Remote desktop

To run an X client application on a remote machine, the user may do the following:
  • on the local machine, open a terminal window
  • use command to connect to the remote machine
  • request a local display/input service
The remote X client application will then make a connection to the user's local X server, providing display and input to the user.
Alternatively, the local machine may run a small program that connects to the remote machine and starts the client application.
Practical examples of remote clients include:
  • administering a remote machine graphically
  • using a client application to join with large numbers of other terminal users in collaborative workgroups
  • running a computationally intensive simulation on a remote machine and displaying the results on a local desktop machine
  • running graphical software on several machines at once, controlled by a single display, keyboard and mouse

    User interfaces

X primarily defines protocol and graphics primitivesit deliberately contains no specification for application user-interface design, such as button, menu, or window title-bar styles. Instead, application softwaresuch as window managers, GUI widget toolkits and desktop environments, or application-specific graphical user interfacesdefine and provide such details. As a result, there is no typical X interface and several different desktop environments have become popular among users.
A window manager controls the placement and appearance of application windows. This may result in desktop interfaces reminiscent of those of Microsoft Windows or of the Apple Macintosh or have radically different controls. Some interfaces such as Sugar or ChromeOS eschew the desktop metaphor altogether, simplifying their interfaces for specialized applications. Window managers range in sophistication and complexity from the bare-bones to the more comprehensive desktop environments such as Enlightenment and even to application-specific window managers for vertical markets such as point-of-sale.
Many users use X with a desktop environment, which, aside from the window manager, includes various applications using a consistent user interface. Popular desktop environments include GNOME, KDE Plasma and Xfce. The UNIX 98 standard environment is the Common Desktop Environment. The freedesktop.org initiative addresses interoperability between desktops and the components needed for a competitive X desktop.

Implementations

The X.Org implementation is the canonical implementation of X. Owing to liberal licensing, a number of variations, both free and open source and proprietary, have appeared. Commercial Unix vendors have tended to take the reference implementation and adapt it for their hardware, usually customizing it and adding proprietary extensions.
Until 2004, XFree86 provided the most common X variant on free Unix-like systems. XFree86 started as a port of X to 386-compatible PCs and, by the end of the 1990s, had become the greatest source of technical innovation in X and the de facto standard of X development. Since 2004, however, the X.Org Server, a fork of XFree86, has become predominant.
While it is common to associate X with Unix, X servers also exist natively within other graphical environments. VMS Software Inc.'s OpenVMS operating system includes a version of X with Common Desktop Environment, known as DECwindows, as its standard desktop environment. Apple originally ported X to macOS in the form of X11.app, but that has been deprecated in favor of the XQuartz implementation. Third-party servers under Apple's older operating systems in the 1990s, System 7, and Mac OS 8 and 9, included Apple's MacX and White Pine Software's eXodus.
Microsoft Windows is not shipped with support for X, but many third-party implementations exist, as free and open source software such as Cygwin/X, and proprietary products such as Exceed, MKS X/Server, Reflection X, X-Win32 and Xming.
There are also Java implementations of X servers. WeirdX runs on any platform supporting Swing 1.1, and will run as an applet within most browsers. The Android X Server is an open source Java implementation that runs on Android devices.
When an operating system with a native windowing system hosts X in addition, the X system can either use its own normal desktop in a separate host window or it can run rootless, meaning the X desktop is hidden and the host windowing environment manages the geometry and appearance of the hosted X windows within the host screen.

X terminals

An X terminal is a thin client that only runs an X server. This architecture became popular for building inexpensive terminal parks for many users to simultaneously use the same large computer server to execute application programs as clients of each user's X terminal. This use is very much aligned with the original intention of the MIT project.
X terminals explore the network using the X Display Manager Control Protocol to generate a list of available hosts that are allowed as clients. One of the client hosts should run an X display manager.
A limitation of X terminals and most thin clients is that they are not capable of any input or output other than the keyboard, mouse, and display. All relevant data is assumed to exist solely on the remote server, and the X terminal user has no methods available to save or load data from a local peripheral device.
Dedicated X terminals have fallen out of use; a PC or modern thin client with an X server typically provides the same functionality at the same, or lower, cost.