The next step is to configure gdm to indicate how to execute Xephyr.sh (the wrapper script). The call includes a couple of parameters (display and xauthority) that will be converted to environment variables . The other pair of parameters are the physical addresses of the input devices, that will be converted to the event numbers to be used as keyboard and mouse events.
# cp /etc/gdm/gdm.conf /etc/gdm/gdm.conf.bak
# vi /etc/gdm/gdm.conf
Only the servers section of the gdm.conf file is shown
command=/usr/bin/X -ac -br
command=/usr/sbin/Xephyr.sh -display :0.0 -xauthority /var/lib/gdm/:0.Xauth -fullscreen -kbdphys isa0060/serio0/input0 -mousephys isa0060/serio1/input0 -use-evdev
command=/usr/sbin/Xephyr.sh -display :0.1 -xauthority /var/lib/gdm/:0.Xauth -fullscreen -kbdphys usb-0000:00:1d.1-1/input0 -mousephys usb-0000:00:1d.1-2/input0 -use-evdev
Notice theat the command lines have been split for better readability.
Right now, you already have a multiseat computer. If you start the graphic mode, you will see the two monitors showing the gdm login screen.
# /etc/init.d/gdm start
In this moment there is only one problem remaining: To be able to obtain a proper configuration of the keyboards.
According to messages in several forums on Internet, evdev seems to have some problems still waiting to be patched related to keyboard configuration. Some options are ignored, some others can lead to a fully missconfigured keyboard (no one key mapping to the correct one). After many hours looking for information, and dozens of trial-error tests with setxkbmap, we finally achieved to obtain a correct keyboard configuration.
The best solution is to create a keyboard configuration file for every Xephyr session (change the layout according to your particular locale):
# vi /etc/X11/xkb/X1-config.keyboard
model = "pc105"
keycodes = "evdev"
layout = "es"
# cp /etc/X11/xkb/X1-config.keyboard /etc/X11/xkb/X2-config.keyboard
Do never include this line rules = "evdev" in the Xn-config.keyboard file. Every test we did (and we did really lots of tests!) having such line present, the result was a useless keyboard with no correct keys at all!
Update (4-May-2007): Since we are using a Xephyr compiled on another distribution, there seem to be an issue with the directories, and some configuration files can not be found. Including these additional lines, you can avoid all the keyboard related problems:
# ln -s /usr/share/X11/xkb /usr/lib/X11/xkb
# cp /etc/X11/xkb/X*.keyboard /usr/lib/X11/xkb
# cp `which xkbcomp` /usr/lib/X11/xkb
# mkdir /usr/lib/X11/xkb/compiled
Launch again the gdm, and have a coffee break. Your new toy is ready to play with!
(continues on step VI...)