random hint(s): multiple distinct display managers on distinct virtual terminals

Michael Paoli Michael.Paoli@cal.berkeley.edu
Thu, 11 Mar 2004 22:26:57 -0800


Anyway, someone was asking about multiple distinct display managers on
distinct virtual terminals and such at yesterday's BAD meeting.  I
actually have this configured on my laptop.  Relevant configuration
was also asked about.

Anyway, here's a terse hint on essential elements I use for my
configuration to do that:

(  
    cd /etc && {
        fgrep -h 'vt' X11/xdm/Xservers gdm/gdm.conf kde2/kdm/Xservers
        fgrep -h 'HEED_DEFAULT_DISPLAY_MANAGER=' init.d/[xgk]dm
    } |
    grep -v '^[     ]*#'
)  
:0 local /usr/X11R6/bin/X vt5 -dpi 125 -nolisten tcp
1=Standard vt6 -dpi 125
:2 local /usr/X11R6/bin/X :2 vt7 -dpi 125
HEED_DEFAULT_DISPLAY_MANAGER=false
HEED_DEFAULT_DISPLAY_MANAGER=false
HEED_DEFAULT_DISPLAY_MANAGER=false

The not-so-terse commentary on the above:
The stuff between and including the parenthesis is a bit of bash shell
script that shows the relevant configuration lines (the whitespace 
between the otherwise adjacent square brackets consists of precisely one
space character and one tab character).
What follows immediately below it is the output when I run that, showing
the relevant configuration lines.
Most notably in the configuration:
each display manager / X server must use:
distinct and non-conflicting virtual terminals (e.g. vt5, vt6, vt7)
distinct and non-conflicting X display devices (0, 1, 2, etc.,
corresponding to DISPLAY=:0.0, DISPLAY=:1.0, DISPLAY=:2.0, etc.)
One can have any given display manager on multiple virtual terminals,
but one can't have more than any one display manager that's active
configured to use any given virtual terminal (i.e. the X server that's
launched by the display manager shouldn't be fighting some other X
server for the same virtual terminal).
Also for each X server running on any given virtual terminal, it must
use a distinct display number (typically these are assigned starting
with 0 and can run up through 63*); this includes not only X servers
started via display managers (e.g. xdm, gdm, kdm), but also those
used by ssh sessions with X forwarding enabled (by default ssh starts
with DISPLAY:10.0 and goes up from there), and those
started via startx or xinit (so for example, when I launch yet another X
server interactively, I'm typically doing:
startx -- :3 &
as I already have DISPLAYs 0 through 2 in use by [xgk]dm; note also that
if one uses startx or xinit to launch an X server, it'll grab the first 
available (not in use) virtual terminal).
All the display managers, possibly excepting whichever one is set as
default, need the
HEED_DEFAULT_DISPLAY_MANAGER=false
setting, otherwise
the scripts basically do "Oh, the default display manager isn't 
configured to be me, so I'll therefore not start up" for each display
manager other than the one that is configured to be the default display
manager.

LINUX has up to 63 virtual consoles.  It's quite rare for more
than 12 to be used in most typical configurations. (see:
man console).

Don't forget about getty and similar login processes, and which virtual
terminal's they're configured to use (see /etc/inittab typically, and
man init).

*per RFC 1700 anyway.  For some stuff, higher DISPLAY numbers seem to
work okay, but I'm not certain how advisable that may be and/or how
compatible it may be with anything and everything else that may be
involved (and isn't 64 distinct X server DISPLAY numbers (those
correspond to input device set (keyboard and mouse), not output display
devices (output DISPLAY devices are the number after the . and are  
unique per input set)) enough for most any given single instance of the
operating system?)