XDM and X Terminal mini-HOWTO

Kevin Taylor

         kevin@northants.lug.org.uk
   
   Revision History
   Revision v0.03 3 July 2000 Revised by: kt
   Minor updates from first comments
   Revision v0.02 28 June 2000 Revised by: kt
   First SGML source draft from HTML source
   Revision v0.01 27 June 2000 Revised by: kt
   First HTML source draft
   
   This document describes the basic ideas for using XDM to manage X
   terminals. It is not meant to be a comprehensive discussion of all the
   features of XDM, but a gentle introduction to what XDM can to for X
   terminals.
   
   For a full discussion about the installation and configuration of X
   terminals, please refer to the 'Thin-client' HOWTO, from the Linux
   Documentation Project (see [1]Section 6).
     _________________________________________________________________
   
   Table of Contents
   1. [2]Introduction
          
        1.1. [3]Copyright Information
        1.2. [4]Disclaimer
        1.3. [5]New Versions
        1.4. [6]Credits
        1.5. [7]Feedback
        1.6. [8]To do
                
   2. [9]Basic Concepts
          
        2.1. [10]What is covered
        2.2. [11]About this document
                
   3. [12]XDM
          
        3.1. [13]What is XDM
        3.2. [14]What is an X terminal
                
   4. [15]Configuring XDM
          
        4.1. [16]Configuration Files
        4.2. [17]Configuring XDM to manage X servers
        4.3. [18]Configuring XDM for queries
        4.4. [19]Starting X
        4.5. [20]The Chooser Application
                
   5. [21]Advanced Configuration Options
          
        5.1. [22]Configuration Sets
                
   6. [23]Resources
          
1. Introduction
     _________________________________________________________________
   
1.1. Copyright Information

   This document is copyrighted (c) 2000 Kevin Taylor and is distributed
   under the terms of the Linux Documentation Project (LDP) license,
   stated below.
   
   Unless otherwise stated, Linux HOWTO documents are copyrighted by
   their respective authors. Linux HOWTO documents may be reproduced and
   distributed in whole or in part, in any medium physical or electronic,
   as long as this copyright notice is retained on all copies. Commercial
   redistribution is allowed and encouraged; however, the author would
   like to be notified of any such distributions.
   
   All translations, derivative works, or aggregate works incorporating
   any Linux HOWTO documents must be covered under this copyright notice.
   That is, you may not produce a derivative work from a HOWTO and impose
   additional restrictions on its distribution. Exceptions to these rules
   may be granted under certain conditions; please contact the Linux
   HOWTO coordinator at the address given below.
   
   In short, we wish to promote dissemination of this information through
   as many channels as possible. However, we do wish to retain copyright
   on the HOWTO documents, and would like to be notified of any plans to
   redistribute the HOWTOs.
   
   If you have any questions, please contact
   <[24]linux-howto@metalab.unc.edu>
     _________________________________________________________________
   
1.2. Disclaimer

   No liability for the contents of this documents can be accepted. Use
   the concepts, examples and other content at your own risk. As this is
   a new edition of this document, there may be errors and inaccuracies,
   that may of course be damaging to your system. Proceed with caution,
   and although this is highly unlikely, the author(s) do not take any
   responsibility for that.
   
   All copyrights are held by their by their respective owners, unless
   specifically noted otherwise. Use of a term in this document should
   not be regarded as affecting the validity of any trademark or service
   mark.
   
   Naming of particular products or brands should not be seen as
   endorsements.
   
   You are strongly recommended to take a backup of your system before
   major installation and backups at regular intervals.
     _________________________________________________________________
   
1.3. New Versions

   This is the initial release.
   
   The latest version number of this document may be obtained from
   [25]The Northants LUG, UK Project Pages .
     _________________________________________________________________
   
1.4. Credits

   Thanks go to the following people for help with information and proof
   reading of the document.
   
   Scot W Stevenson for the original X teriminal mini-howto document,
   from 1995, on which some of the material for the section on advanced
   xdm-config configurations was obtained.
   
   Members of the Northants LUG, UK for proof reading the document.
   
   The writers of the XDM, Xserver man pages and the default XDM scripts.
     _________________________________________________________________
   
1.5. Feedback

   Feedback is most certainly welcome for this document. Without your
   submissions and input, this document wouldn't exist. Please send your
   additions, comments and criticisms to the following email address :
   <[26]xdm-mini@northants.lug.org.uk>.
     _________________________________________________________________
   
1.6. To do

   I probably ought to mention some details about the following at some
   point ...
   
     * Security and authentication schemes.
     * Debugging problems with XDM.
     * Replacements for XDM - ie KDM and GDM.
     * LBX ?
       
   Any offers ?
     _________________________________________________________________
   
2. Basic Concepts
     _________________________________________________________________
   
2.1. What is covered

   This document describes the basic concepts behind using XDM (the X
   display manager) to manage X terminals and X servers, in order to
   provide 'thin-client' computing, using Linux.
   
   X (or the 'X Window System') is the windowing and graphics environment
   of choice for Unix systems. Its particular strength (and the key bit
   that we are interested in for this document) is that it separates the
   running applications (web browser, word processor, etc) from the
   actual graphics screen and input devices (mouse, keyboard, etc) via a
   network communications mechanism.
   
   Essentially, this means that you can be running an application on one
   machine, but have its input and output redirected to another machine
   via a network. This is the key feature that makes an X terminal
   possible.
   
   This document does not discuss the installation or configuration of a
   network or X on Linux. Please refer to the appropriate HOWTO documents
   from the Linux Documentation Project for more details (see [27]Section
   6).
   
   This document should be treated as a 'getting started with XDM'
   document, in that it describes the basic terms and concepts for using
   XDM and X terminals, with simple examples that provide the minimum
   amount of security.
   
   The reader is advised to consult the list of resources provided at the
   end of the document in order to proceed beyound these basic facilities
   - in particular, the configuration of the 'authentication' and
   security settings should be examined, as the examples given in this
   document utilise the least secure modes of operation.
   
   Please note - the information in this document was obtained from
   systems running Debian 2.1, SuSE 6.4, Mandrake 7.0 and RedHat 6.0.
   
   This document does not attempt to describe how to install and
   configure Linux for an X terminal. For this information, please refer
   to the 'thin-client' HOWTO document, provided as part of the Linux
   Documentation Project (see [28]Section 6).
     _________________________________________________________________
   
2.2. About this document

   This document came about because I wanted to experiment with Linux on
   a 486 PC as an X terminal to my main Linux box.
   
   After reading the man pages, specifications and current howto
   documents relating to XDM and X terminals, I ended getting really
   confused about where XDM was supposed to run and confusing XDM servers
   with X servers and the like, and so after an evening or two of
   experimentation, this document was born.
   
   Once the basic terminology has been sorted out, the documentation for
   XDM and self-documenting sample files makes very good reading - I just
   could not find a simple introduction to the basic concepts anywhere to
   get me started. Hopefully this document could prove to be a suitable
   introduction to someone in a similar position to me.
   
   Oh, and in case you are wondering, a 486dx2/66 with 16 Mb RAM makes a
   fine X terminal !
     _________________________________________________________________
   
3. XDM
     _________________________________________________________________
   
3.1. What is XDM

   Put simply, XDM (the X Display Manager) can be thought of as a
   graphical replacement for the command line 'login' prompt. In reality,
   it can actually do much more than that.
   
   Typcially, it would be started by the 'root' user (or the system
   startup scripts) on power up, and would present a user with a
   graphical login prompt. It will then manage the users X session once
   they login - ie it will initiate the running of their window manager
   and applications.
   
   This could be considered a typical 'simple local machine login'
   configuration, as may be found installed by many Linux distributions
   by default. However, XDM can also manage remote X servers and provide
   login prompts to remote 'X terminals'. In short, it is not limited to
   the local machine - it can easily manage other machines connected via
   a network.
   
   XDM is a very configurable utility and this document will only just
   'scratch the surface' of what may be acheived. This document aims to
   provide enough information to configure your X terminals and
   application servers to connect to each other. The reader is refered to
   the [29]Section 6 for further information on the topics discussed
   here.
     _________________________________________________________________
   
3.2. What is an X terminal

   This term could be used to cover various configurations, but at its
   simplest form, is a machine with a network connection, keyboard, mouse
   and monitor, configured to run the X windows system to connect to an
   application server somewhere on the network.
   
   There are several configurations of 'X terminal' with varying levels
   of functionality, ranging from completely diskless terminals to full X
   workstations.
     _________________________________________________________________
   
3.1. Some Terminology

   Before I go any further, I ought to explain the terms I will be using
   in this document. When talking about X, there is quite a lot of
   confusion over what is serving facilities to what. This is especially
   true when you are considering distributed sessions over a network
   involving X terminals. I will be using the terms described below.
   
   Diskless X terminal
          These would be a machine with no local disks, which would
          perform its boot up via a network connection to a server. This
          means obtaining the network configuration, operating system,
          system configuration and all applications from the server. Once
          booted however, this would be the same as a 'dumb X terminal'
          (see below). Typically this configuration would use a
          combination of the following network protocols in order to boot
          : BOOTP, DHCP, TFTP, etc. Refer to [30]Section 6 for some
          references that detail how to build diskless clients.
          
   Dumb X terminal
          This would be a machine that boots from its local disk into an
          operating system, and starts an 'X server' and nothing more.
          Somehow, a login prompt would be provided on the machine, to
          enable a user to login to an application server somewhere on
          the network.
          
   X Workstation
          This would be similar to a dumb X terminal, but would provide
          the option of loging on to the local machine itself, hence
          would be quite capable of becoming a standalone workstation (ie
          no network connectivity) if required.
          
   Application Server
          In the context of this document, I use the term 'application
          server' to describe a machine that will provide a running X
          session and applications (but not necessarily an actual
          graphical console login prompt and local screen and keyboard).
          
   X Server
          This is a machine with a physical console (display, keyboard,
          mouse, etc) that is able to provided these facilities as a
          service to X clients. Please refer to the X User Howto in
          [31]Section 6 for more details.
          
   X Client
          This is an application that requires the use of the X server to
          provide a display and input.
          
   Note that from the above descriptions, an X Workstation could be
   thought of as consisting of a dumb X terminal and application server
   running on a single machine.
   
   This document will be looking at the architecture of the various
   options listed above and will describe the role that xdm can play in
   configuring these setups.
     _________________________________________________________________
   
3.2. What can XDM do

   XDM is the utility that will be responsible for providing the users
   login prompt and initiating their X session. This could be a local
   session (in the case of an X workstation) or via a connection to an
   application server from a diskless or dumb X terminal.
   
   There are 2 main methods that can result with the user being presented
   with a login prompt :
   
     * X server query
     * XDM server managed
     _________________________________________________________________
   
3.2.1. X Server Query

   The communications between XDM and the actual 'X server' (the machines
   with the physical screen/keyboard/mouse/etc) are handled via XDMCP the
   'X display manager control protocol'.
   
   This permits X servers to send out queries to servers running XDM,
   basically saying 'I have someone wanting to login - someone please
   give me a login prompt'.
   
   This facility can take one of 3 forms :
   
     * Direct query : the X server contacts a named host, requesting that
       the server presents a login prompt on its display
     * Broadcast : the X server sends out a broadcast message to the
       network, and the first server running XDM that responds to the
       broadcast will be the one to present the login prompt on its
       display
     * Indirect query : the X server contacts a named host, but asks it
       which other hosts it knows about on the network. The named host
       will then present the user with a list of hosts to choose from,
       and will then go on to initiate communications with the selected
       host resulting in the selected host presenting a login prompt on
       the X servers display.
       
   There are several other processes, but these will not be described
   here - refer to the XDM and XDMCP documentation in [32]Section 6 for
   more details.
     _________________________________________________________________
   
3.2.2. XDM Server Managed

   If you have a set of machines (eg diskless or dumb X terminals) that
   just end up running an X server, all designed to provide a login
   prompt to a single application server, then it is possible to
   configure XDM on the application server to connect back to each X
   server and present its login prompt on each display automatically.
   
   In this mode of operation, the configuration file 'Xservers' lists
   each machine (including the local display, if required) to which XDM
   should connect, to display its login prompt.
   
   This configuration, when used with no remote X servers listed in the
   configuration, is the typical configuration used for a X workstation,
   in order to present a user with a graphical login to the local machine
   he is working on.
   
   Note this assumes that the access control on the X server is such that
   the application server XDM is able to connect back to the appropriate
   display.
     _________________________________________________________________
   
4. Configuring XDM

   This section covers what needs to be configured for XDM to perform the
   functions described so far in this document.
   
   In each case, the configuration described is the minimum necessary to
   accomplish each goal. In most cases this means that the configuration
   is also the least secure. Please refer to some of the additional
   documentation listed in [33]Section 6 for additional information about
   securing XDM and X terminals.
     _________________________________________________________________
   
4.1. Configuration Files

   This describes the following scheme of XDM configuration files :
   
     * xdm-config
     * Xaccess
     * Xservers
     * Xresources
       
   This will be found in (Debian 2.1. Mandrake 7.0.2, RedHat 6.2) :
      /etc/X11/xdm

   or (SuSE 6.4) :
      /usr/X11R6/lib/X11/xdm

   xdm-config
          Defines the locations of the other configuration files and the
          basic access permissions. For all distributions considered for
          this document, the file names were as listed here (but
          sometimes the locations varied).
          
          This also defines the scripts to be run for the various state
          transitions for an X session, ie on startup, etc. You should
          not need to change these, as most distributions would appear to
          come with this pre-configured for you.
          
   Xaccess
          Determines which machines can connect to XDM on this machine -
          ie from which other machines on the network we are accepting
          XDMCP queries.
          
   Xservers
          Contains a list of machines that XDM will connect to, to
          provide a login prompt, automatically - ie those machines
          already running an X server, but would like this machine to
          provide the login prompt.
          
   Xresources
          Details of the X properties used by the XDM widgets (eg size of
          the login 'box', colours, bitmap backgrounds, etc).
     _________________________________________________________________
   
4.2. Configuring XDM to manage X servers

   An entry must be placed in the Xservers file for each X server that
   XDM will be presenting a login prompt on. This could include the local
   machine and/or a list of remote machines.
   
   Example
      # First the local host
      :0 local /usr/bin/X11/X vt7
      #
      # Then the remote hosts
      emma:0 foreign
      alex:0 foreign

   This will start XDM on the local machine and also present a login
   screen on the X servers running on the hosts 'emma' and 'alex'
   (assuming that permissions have been setup on 'emma' and 'alex' such
   that this machine is permitted to connect to the running X servers).
   
   Note that it is possible to specify the host and display (:0, :1, etc)
   if required, for example, if you are running multiple X servers on a
   single machine, etc.
     _________________________________________________________________
   
4.3. Configuring XDM for queries

   The file Xaccess determines which hosts may query XDM on this machine,
   in order to be presented with a login prompt.
   
   Example
      # First line for direct queries
      *
      # Following line for indirect queries
      * CHOOSER BROADCAST

   This means that any host may connect to XDM directly (the first '*').
   The 'CHOOSER' line specifies which hosts can connect to XDM using
   indirect queries - in this case, any host may query this machine for a
   list of hosts to connect to (the second '*' line).
   
   'BROADCAST' means that the 'chooser' application on this machine will
   obtain its list of available servers (that will also be running XDM)
   via network broadcast queries. I will talk about the 'chooser' later.
   
   It is possible to place specific host names in these entries (and
   there are also other indirect queries possible, without using the
   chooser) but this is not described here (refer to [34]Section 6 for
   some links to more information).
     _________________________________________________________________
   
4.4. Starting X

   The way you start the X server itself, will depend upon how you want
   it to interact with XDM locally and remotely.
   
   X Workstation : XDM and local X server
          XDM will normally start X automatically for you and XDM will
          usually be configured to run as part of the startup process
          (via the init scripts).
          
   X Terminal : Remote XDM
          Just start X with no clients, with access permissions such that
          the remote XDM is able to connect when it starts up. The
          following will start X with no access control :
          
          /usr/X11R6/bin/X -ac


   X Terminal : Query a remote XDM
          Recall there are 3 modes for queries : direct, indirect and
          broadcast (direct for a single host, broadcast for the first
          host that replies or indirect for a list of hosts) :
          
          /usr/X11R6/bin/X -query the.remote.host
          /usr/X11R6/bin/X -broadcast
          /usr/X11R6/bin/X -indirect the.remote.host


   In each case, X will probably have to be started as root, and could be
   configured to be started up via the init scripts, if X is required
   automatically on startup.
     _________________________________________________________________
   
4.5. The Chooser Application

   When XDM receives an indirect query, and assuming that the option has
   been specified in Xaccess for the 'chooser' application, it can
   provide the user with a list of other XDM managed servers that it
   knows about.
   
   In this mode of operation, instead of the normal XDM login prompt, the
   user will be given the 'chooser' widget, which will provide a list of
   detected hosts on the network.
   
   When I first tried the use the chooser, I found that the Xresources
   files that came with my SuSE and Debian systems, specified a size for
   the chooser widget that was too big for the screens ... The following
   line from the Xresources file fixed that :
      Chooser*geometry:      700x500+300+200

   The chooser will obtain its lists of host by one of two methods :
   
     * Broadcast Query : In this mode a request is broadcast over the
       network, and a list is built up from the replies received from
       other application servers running XDM.
     * Explicit Listing : It is possible to provide a list of hosts for
       the chooser in the Xaccess file, as follows :
       
        %hostlist      emma alex liam
        *              CHOOSER %hostlist


       This will mean that the hosts emma, alex and liam will all be
       listed as available (presumably even if one of the machines is
       down ? Need to check this ...)
     _________________________________________________________________
   
5. Advanced Configuration Options
     _________________________________________________________________
   
5.1. Configuration Sets

   The xdm-config file provides a rich set of options, when it comes to
   defined scripts and other configuration files. In many cases, the
   defaults provided with your distribution should be fine, but for those
   of you who want more ...
   
   The names of the startup scripts and configuration files used by XDM
   are determined by a series of statements in the top-level xdm-config
   file. This permits you to configure a different set of files for
   different X servers and X terminals, with different abilities.
   
   For example, say you are using XDM to manage your local display, but
   also want it to accept queries from other X terminals on the network.
   It is possible to specify a different Xresources file for each of
   these cases, by using the following 2 lines in xdm-config :
      DisplayManager._0.resources            /etc/X11/xdm/Xres_0
      DisplayManager*resources               /etc/X11/xdm/Xresources

   This will use Xres_0 for the local display (_0 is the XDM way of
   saying :0) and Xresources for everything else (the '*').
   
   Note that XDM configuration files use the terminology host_0, where
   you would normally use host:0, to designate 'display 0 on host'.
   
   Similarly, if you wanted a particular resource file for a specific
   host, you would use an entry like the following :
      DisplayManager.host_0.resources       /etc/X11/xdm/Xres_host_0

   If you look over your default xdm-config file, you will probably find
   that it has been setup so that your local X server has different files
   to the remote ones anyway, as different things must be performed on
   startup and reset of the server. My debian file has the following for
   local servers :
      DisplayManager._0.resources:    /etc/X11/xdm/Xresources_0
      DisplayManager._0.setup:        /etc/X11/xdm/Xsetup_0
      DisplayManager._0.startup:      /etc/X11/xdm/Xstartup_0
      DisplayManager._0.reset:        /etc/X11/xdm/Xreset_0

   and the following for remote servers :
      DisplayManager*resources:       /etc/X11/xdm/Xresources
      DisplayManager*setup:           /etc/X11/xdm/Xsetup
      DisplayManager*startup:         /etc/X11/xdm/Xstartup
      DisplayManager*reset:           /etc/X11/xdm/Xreset
     _________________________________________________________________
   
6. Resources

   This section lists some resources that have been consulted in order to
   construct this document and which provide further details to the
   concepts described.
   
   The X Window System
          
          + X User Howto (from the [35]LDP)
          + Man pages : X (main concepts), Xserver (X server concepts)
          + X FAQ (on [36]www.x.org)
            
   Thin-clients/X terminals
          
          + Thin-client Howto Document (from the [37]LDP)
          + Diskless Howto Document (from the [38]LDP)
          + [39]X terminal pages
            
   XDM
          
          + Man pages : xdm

References

   1. XDM-Xterm.html#RESOURCES
   2. XDM-Xterm.html#INTRO
   3. XDM-Xterm.html#COPYRIGHT
   4. XDM-Xterm.html#DISCLAIMER
   5. XDM-Xterm.html#NEWVERSIONS
   6. XDM-Xterm.html#CREDITS
   7. XDM-Xterm.html#FEEDBACK
   8. XDM-Xterm.html#TODO
   9. XDM-Xterm.html#BASICS
  10. XDM-Xterm.html#COVERAGE
  11. XDM-Xterm.html#ABOUT
  12. XDM-Xterm.html#XDM
  13. XDM-Xterm.html#XDM-WHAT
  14. XDM-Xterm.html#XDM-XTERM
  15. XDM-Xterm.html#CONFIG
  16. XDM-Xterm.html#CONFIG-FILES
  17. XDM-Xterm.html#XDM-XSERV
  18. XDM-Xterm.html#XDM-QUERIES
  19. XDM-Xterm.html#XDM-STARTX
  20. XDM-Xterm.html#XDM-CHOOSER
  21. XDM-Xterm.html#XDM-ADVCONFIG
  22. XDM-Xterm.html#ADV-CONFIGSETS
  23. XDM-Xterm.html#RESOURCES
  24. mailto:linux-howto@metalab.unc.edu
  25. http://www.northants.lug.org.uk/projects/xdm-mini/
  26. mailto:xdm-mini@northants.lug.org.uk
  27. XDM-Xterm.html#RESOURCES
  28. XDM-Xterm.html#RESOURCES
  29. XDM-Xterm.html#RESOURCES
  30. XDM-Xterm.html#RESOURCES
  31. XDM-Xterm.html#RESOURCES
  32. XDM-Xterm.html#RESOURCES
  33. XDM-Xterm.html#RESOURCES
  34. XDM-Xterm.html#RESOURCES
  35. http://www.linuxdoc.org/
  36. http://www.x.org/
  37. http://www.linuxdoc.org/
  38. http://www.linuxdoc.org/
  39. http://dns.solucorp.qc.ca/xterminals