Once we have modified the xorg.conf file and we have a big desktop in the two monitors, the next thing is to configure gdm to launch the two Xephyr sessions.
Previously, you will need to obtain the information related to the input events on your system. The way of referencing the events has been recently modified. Now, the operating system allows you to access the events via their paths, and on some systems, via their names. The script wrapper to launch Xephyr it is now simpler compared to the previous version. It is not necessary any more to match the events with the physical locations (as we did through /proc/bus/input/devices)
You must obtain the path-based symbolic links to the events corresponding to your keyboards and mouses. In our particular case, whe have two USB keyboards, one USB mouse and one PS/2 mouse.
# ls -la /dev/input/by-path/ | grep event | grep kbd
lrwxrwxrwx 1 root root 9 2008-02-20 09:49 pci-0000:00:1d.2-usb-0:1:1.0-event-kbd -> ../event5
lrwxrwxrwx 1 root root 9 2008-02-20 09:49 pci-0000:00:1d.2-usb-0:2:1.0-event-kbd -> ../event6
# ls -la /dev/input/by-path/ | grep event | grep mouse
lrwxrwxrwx 1 root root 9 2008-02-20 09:49 pci-0000:00:1d.3-usb-0:1:1.0-event-mouse -> ../event8
lrwxrwxrwx 1 root root 9 2008-02-20 09:49 platform-i8042-serio-1-event-mouse -> ../event2
The invocation of the Xephyr wrapper in the (/etc/gdm/gdm.conf) file will be something like this (remember to do a backup of your files before doing any modification!):
# ****************************************************************************
# Modificaciones multiseat (20080109)
0=Xephyr0
1=Xephyr1
2=Xephyr2
[server-Xephyr0]
name=Xephyr0
command=/usr/bin/X -br -dpms -s 0
handled=false
flexible=false
[server-Xephyr1]
name=Xephyr1
command=/usr/sbin/Xephyr-path.sh -display :0 -br -xauthority /var/lib/gdm/:0.Xauth -screen 1280x1024 -kbdpath pci-0000:00:1d.2-usb-0:2:1.0-event-kbd -mousepath platform-i8042-serio-1-event-mouse
handled=true
flexible=false
[server-Xephyr2]
name=Xephyr2
command=/usr/sbin/Xephyr-path.sh -display :0 -br -xauthority /var/lib/gdm/:0.Xauth -screen 1280x1024+1280+0 -kbdpath pci-0000:00:1d.2-usb-0:1:1.0-event-kbd -mousepath pci-0000:00:1d.3-usb-0:1:1.0-event-mouse
handled=true
flexible=false
# ****************************************************************************
Notice that the Xepyr wrapper is called Xephyr-path.sh (just to remark the modification). If you prefer to reference the devices by its name instead of the path, obtain the names in a similar way (have a look at /dev/input/by-name/) and do the necessary modifications on the wrapper.
Since the previous version, xserver-xephyr has been modified so the script is slightly different from the old one. Place the script somewhere in your computer (and remember to give it execution permissions) so it can be invoked when gdm starts. In our prototype, the wrapper is placed at /usr/sbin/Xephyr-path.sh
#!/bin/bash
# 20080109..20080221 - josean
# http://netpatia.blogspot.com/
trap "" usr1
XEPHYR=/usr/bin/Xephyr
args=()
while [ ! -z "$1" ]; do
if [[ "$1" == "-xauthority" ]]; then
shift
if [ ! -z "$1" ]; then
export XAUTHORITY="$1"
fi
elif [[ "$1" == "-display" ]]; then
shift
if [ ! -z "$1" ]; then
export DISPLAY="$1"
fi
elif [[ "$1" == "-kbdpath" ]]; then
shift
if [ ! -z "$1" ]; then
args=("${args[@]}" "-keybd")
args=("${args[@]}" "evdev,,device=/dev/input/by-path/$1,xkbrules=xorg,xkbmodel=evdev,xkblayout=es")
fi
elif [[ "$1" == "-mousepath" ]]; then
shift
if [ ! -z "$1" ]; then
args=("${args[@]}" "-mouse")
args=("${args[@]}" "evdev,,device=/dev/input/by-path/$1,WHEELRelativeAxisButtons 6 7")
fi
else
args=("${args[@]}" "$1")
echo "+++ args $1 +++" >> /tmp/logXephyr
fi
shift
done
echo $XEPHYR -ac "${args[@]}" >> /tmp/logXephyr
exec $XEPHYR -ac "${args[@]}"
Notice the changes, mainly in the options passed to the evdev driver for mouse and keyboard.
Another significant change on the wrapper script is the removal of the line...
elif ! expr match $1 'vt[0-9][0-9]*' >/dev/null; then
...from the 6.06 version. Now, the parameters related to virtual terminals are not filtered, so they are passed in the final invocation. In our prototype, the two seats share the same vt (vt9) and this seems to be no problem at all. If you have more seats or you experience some problem, maybe you will need to filter the vt parameters in the final Xephyr call.
Currently, the mouse wheel (vertical scroll) is not working. The option WHEELRelativeAxisButtons is just to try to get it working, but without success at the moment. Unfortunately there is not much documentation about evdev and its options. If somebody achieves to manage the mouse wheel, feedback is welcome.
The good news is that the keyboard mapping seems to work properly. After dozens of trials with parameters (keyboard layouts, mapping, geometry), an updated package of xserver-xephyr was published some days ago. The new package corrected a bug in the path locations where evdev was looking for keyboard definition files. Now everything works perfect, you just have to choose the language layout for your keyboard (Spanish in our example).
If you test the system at this stage, you will probably see just only one login window. There is still a couple of things to do before your system is ready to use.
>> step (III) >>