XDM: The basic concept:
xdm is a "display manager", providing X login windows to
users. The traditional use of xdm is to provide a graphical login on
the local display on an X11 workstation, so that the user does not
need to start up X "by hand".
However, xdm can also provide graphical X11 logins to
remote machines, such as NCD Xterminals. The only requirement is that
the remote machine speak X. To accomplish this, they use the X11
Display Manager Control Protocol, or XDMCP.
What we are describing here is configuring a cheap PC to act just
like one of these Xterminals.
There are two distinct methods of using XDMCP, the "direct
query", in which the X terminal directly requests a login window on
a workstation, and the "indirect query", in which the X terminal
contacts a "chooser server", which presents the X terminal with a
menu of machines to log into. I'll discuss both of these in turn.
(If you don't care about the details, feel free to skip to the
Setup section now.
Direct XDMCP Queries
The figure below shows a simple direct XDMCP setup, in which the
machine xterminal is requesting a login window on
xdmserver (for simplicity, we'll be using these same hostnames in all the
direct XDMCP examples).

Figure 1. A direct XDMCP connection.
The process works as follows:
- The X terminal contacts the XDM server via the XDMCP
protocol
- If the X terminal is authorized to connect to the XDMCP server,
the XDM server starts up a login window which displays on the X
terminal.
- A user logs in to the XDM server through the X terminal. All X
programs the user runs in this session will be displayed on the X terminal.
Indirect XDMCP Queries
In an indirect XDMCP query, the X terminal is configured to
contact a specially configured machine, the "Chooser Server" (called
chooserserver in this example), which is configured to
present a list of machines (in this example, workstation1
and workstation2) to the X terminal from which the user can
select which machine to log into.
The basic technique is shown in the figure below:

Figure 2. An indirect XDMCP connection.
The process for an indirect XDMCP query is similar to a direct query:
- The X terminal contacts the chooser server via an indirect XDMCP
request
- If the X terminal is authorized to connect to the chooser server,
the chooser server starts up a "chooser window", which presents
a list of available machines on the X
terminal.
- A user selects a machine from the chooser list. The chooser
server directs the X terminal to directly connect to selected
workstation via XDMCP
- From this point on, the connect looks exactly like a direct
XDMCP connection.
This all becomes more clear when we do an example.