Setting up the X Display Manager on NetBSD/mac68k

Motivation

With the advent of the K Desktop Environment's kdm, Gnome's gdm, and the associated out-of-the-box, ready-to-use setups, configuration of xdm seems to have become something of a lost art. Nevertheless, for small machines like 68K Macintoshes, xdm and a vanilla window manager like twm, icewm or fvwm v1 do still provide the most efficient work environment.

What else to read

The canonical source of knowledge about proper care and feeding of the X Display Manager xdm(1) is the manpage. Unfortunately, the NetBSD web manpages do not include X11 manpages; a copy of the NetBSD 3.0 xdm manpage is here. Yes, it's that long.

Obviously, it will help a lot if you can find your way through a POSIX shell script, and have a rough idea of X11 ressources. Apart from the occasional helpful web page (for a few links see below), searching old usenet postings in the comp.windows.x hierarchy with groups.google.com could be a good idea.

My setup

But since a proper Unix manpage is terse and a bit dry, I decided to put up the commented xdm configuration of my Macintosh Quadra 700 to give an example of what can be tweaked.

Note:    Before you replace your xdm setup in part with the files provided here, make sure you have a backup of the original files.

Older NetBSD systems have the xdm configuration files under /usr/X11R6/lib/X11/xdm/. On newer systems, the X11 setup has been moved to /etc/X11/. With something like

xdm=YES                 xdm_flags="-config /etc/X11/xdm/xdm-config"

in /etc/rc.conf, you can point xdm to a non-default config file which then holds modified paths to all of xdm's setup.

If you want to work with the example, it is probably easiest to just download the tarball.

So, what is here?

> ls -la xdm-scripts
total 204
drwxr-xr-x  3 hauke  users    512 May 28 19:25 .
drwxr-xr-x  4 hauke  users    512 May 28 19:22 ..
drwxr-xr-x  2 hauke  users    512 May 28 19:24 CVS
-rw-r--r--  1 hauke  users    528 May 28 19:24 Makefile
-rw-r--r--  1 hauke  users  64268 May 28 19:22 NetBSD.xpm
-rw-r--r--  1 hauke  users  60270 May 28 19:22 NetBSDbw.xpm
-rw-r--r--  1 hauke  users  63567 May 28 19:22 NetBSDinv.xpm
-rw-r--r--  1 hauke  users   4671 May 28 19:24 Xresources
-rw-r--r--  1 hauke  users   3391 May 28 19:24 Xresources.global
-rw-r--r--  1 hauke  users   3033 May 28 19:24 Xsession.sh
-rw-r--r--  1 hauke  users    226 May 28 19:24 Xsetup_0.sh
-rw-r--r--  1 hauke  users   1301 May 28 19:24 xdm-config
>

Makefile

The enclosed BSD Makefile takes care of installing all the bits in the proper places with the proper permissions.

NetBSD{,bw,inv}.xpm

The X11 pixmap files NetBSD.xpm, NetBSDbw.xpm, NetBSDinv.xpm replace the generic X11 pixmaps in the xdm greeter for older NetBSD releases. Unlike at least some versions of the original NetBSD pixmaps, they are properly set up for eight bit displays. A screenshot of the modified login screen is here - it was made with xwd(1).

Xresources

The xdm Xresources file gets processed by cpp(1), the C preprocessor, and contains standard X11 resources. It is modeled after Olaf Seibert's post on the NetBSD current-users list. It reverts the pseudo-3D look of the current XFree86 xdm to the older flat look which is more appropriate to the limited depth, greyscale display of 68k Macs.

Xresources.global

Xresources.global is an X11 resource file with application-specific settings. If you want to try it out, copy the file manually to /etc/X11/Xresources; it is sourced by the Xsession.sh script.

Xsession.sh

Xsession.sh (installed chmod +x as Xsession) is a shell script that xdm executes on behalf of the user who has just logged in successfully. It sets up the X11 session, and finally starts up a window manager.

The detailed sequence of events:

  1. Set up logging to ~/.xsession-errors
  2. Provide an XTerm for failsafe mode
  3. Set up various variables that point to config files. Usually, there is a system-wide default file as well as a user specific one. They are
  4. Set up the XAPPLRESDIR environment variable if xpkgwedge package is installed
  5. Set up the keyboard mapping according to the xmodmap files provided
  6. Merge in the X resources with xrdb(1)
  7. Set the X desktop colour
  8. Start xscreensaver, if available
  9. Set up ssh-agent with ssh-askpass prompt, if you have any ssh keys around
  10. Exec either the user's .xinit file (see an example), or start xconsole, and an xterm.
  11. Start the user's window manager, or twm. Quitting the window manager terminates the session.
  12. After the session, remove the ssh-agent.

Xsetup_0.sh

Xsetup_0.sh (installed chmod +x as Xsetup_0) is run as root for per-display pre-login setup. In addition to start xconsole, we enable access to the display from localhost. You could also start xscreensaver here.

xdm-config

xdm-config is the xdm master config file that has the paths to all the other files that xdm uses. The example file sets a few things explicitely to take care of older installations where the xdm default paths point to /usr/X11R6/lib/X11/xdm/.

Serving remote X clients

network xdmp access

TBD

rsh access

/etc/X0.hosts and /etc/hosts.equiv

ssh X11 port forwarding

TBD

Related links



Hauke Fath <hauke (at) Espresso.Rhein-Neckar.DE>