Multiseat Configuration/evdev

From Wikibooks, open books for an open world
Jump to navigation Jump to search

This page teaches how a Multiterminal with evdev works and how to do it. This method eliminates the use of kernel patch, and then, configures w:multiterminals using evdev protocol.

Operating System[edit | edit source]

Debian Sarge (but you can easily use other Linux distributions)

Hardware[edit | edit source]

Video Adapters:

  • 4 SiS graphic cards (you can also use other video-cards, but it doesn't always work with other combinations of cards)

Input devices:

  • 1 PS/2 keyboard
  • 1 PS/2 mouse
  • 3 USB keyboards
  • 3 USB mice

Make sure your kernel is compiled with the evdev module.

You also need to install udev, which provides a dynamic /dev directory refreshed with the currently available devices.

apt-get install udev

The udev system requires kernel 2.6.12 or higher.

Installing the SiS driver[edit | edit source]

1. Add this line to the file /etc/apt/sources.list: ./

2. Update the package information database and install the x-driver-sis package:

apt-get update
apt-get install x-driver-sis

Hotplug[edit | edit source]

Install the hotplug package:

apt-get update
apt-get install hotplug

Input devices[edit | edit source]

Before proceeding, we need to make sure that the input devices (keyboards and mice) were properly detected. Read the contents of /proc/bus/input/devices, a file with details about devices detected by the kernel. A sample from this file is shown below. Only two fields are of interest to us: the device names, contained in lines beginning with “N: Name=”, and the physical address, shown in lines beginning with “P: Phys”.

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
H: Handlers=kbd event0
B: EV=120013
B: KEY=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7

I: Bus=0011 Vendor=0002 Product=0005 Version=0000
N: Name="ImPS/2 Generic Wheel Mouse"
P: Phys=isa0060/serio1/input0
H: Handlers=mouse0 event1
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103

I: Bus=0003 Vendor=0a81 Product=0101 Version=0110
N: Name="CHESEN USB Keyboard"
P: Phys=usb-0000:00:10.2-1/input0
H: Handlers=kbd event2
B: EV=120003
B: KEY=10000 7 ff87207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: LED=7

I: Bus=0003 Vendor=0a81 Product=0101 Version=0110
N: Name="CHESEN USB Keyboard"
P: Phys=usb-0000:00:10.2-1/input1
H: Handlers=kbd event3
B: EV=3
B: KEY=1f 0 20000 3878 d801d101 1e0000 0 0 0

I: Bus=0003 Vendor=04fc Product=0013 Version=06b0
N: Name="USB OpticalWheel Mouse"
P: Phys=usb-0000:00:10.2-2/input0
H: Handlers=mouse1 event4
B: EV=7
B: KEY=70000 0 0 0 0 0 0 0 0
B: REL=103

Note that the file seems to show the presence of three keyboards, even though on the measured system there are only two. The reason for the additional device is that many USB keyboards include special keys (such as multimedia control or Internet shortcut keys), which are detected by the kernel as belonging to a secondary keyboard. Secondary keyboards have a physical address ending in “input1”. We will deal only with the primary keyboards, the addresses of which end in “input0”. Therefore, the section about the secondary keyboard with the physical address “usb-0000:00:10.2-1/input1” will be ignored.

XOrg server[edit | edit source]

The next step is installing the XOrg server.

1. Backup and remove the file /etc/init.d/xfree-common. 2. Add the following lines to /etc/apt/sources.list:

deb sarge main
deb-src sarge main

3. Install the xserver-xorg package:

apt-get update
apt-get install xserver-xorg
apt-get upgrade

XOrg server configuration[edit | edit source]

xorg.conf[edit | edit source]

This configuration will be used when the multiterminal is running. The file will have additional sections according to the number of terminals. For each terminal, we'll create mouse, keyboard, graphics device, monitor, screen, and layout sections. For example, in a multiterminal with four terminals, the file will have four mouse sections, four keyboard sections, and so on.

The “Identifier” values are not mandatory. They may be changed to anything, as long as the names are consistent in the whole file.

The physical address (“Dev Phys” option) can be obtained from the file /proc/bus/input/devices, as explained before.

Below there's a sample for each kind of section.

Section "InputDevice"
        Identifier      "Generic Keyboard 0"
        Driver          "kbd"

        # Change the value of the "Dev Phys" option to the physical
        # address of the corresponding keyboard, found in the file
        # /proc/bus/input/devices .
        Option          "Protocol"      "evdev"
        Option          "Dev Phys"      "isa0060/serio0/input0"

        # Configure your keyboard as usual
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc104"
        Option          "XkbLayout"     "us"
        Option          "CoreKeyboard"

Section "InputDevice"
        Identifier      "Configured Mouse 0"
        Driver          "mouse"

        # Change the value of the "Dev Phys" option to the physical
        # address of the corresponding mouse, found in the file
        # /proc/bus/input/devices .
        Option          "Protocol"      "evdev"
        Option          "Dev Phys"      "isa0060/serio1/input0"

        # All mice should have "CorePointer"
        Option          "CorePointer"
        Option          "ZAxisMapping"          "4 5"

Section "Device"
        Identifier      "Generic Device 0"
        Driver          "sis"
        Screen          0

        # All cards must have an explicit BusID.  The addresses may be
        # obtained with "lspci | grep VGA".  Be careful with the
        # values, since lscpi displays hexadecimal addresses and XOrg
        # expects decimal.  For conversion, use
        # "echo $((0xVALOR_HEXADECIMAL))".
        BusID           "PCI:1:0:0"

        # This option disables VGA and VBE calls on IRQ 10, to avoid
        # calls for a card interfering with the others.  See also the
        # file "xorg.conf.probe".
        Option          "NoInt10"       "Yes"

        # This SiS driver options prevent problems when switching
        # virtual terminals or finishing the X server.
        Option          "RestoreBySetMode"      "no"


# These are default values.  Configure your monitors as usual.
Section "Monitor"
        Identifier      "Generic Monitor 0"
        HorizSync       30-60
        VertRefresh     50-75
        Option          "DPMS"

# The screen configuration is also illustrative, change it to your
# preference.
Section "Screen"
        Identifier      "Default Screen 0"
        Device          "Generic Device 0"
        Monitor         "Generic Monitor 0"
        DefaultDepth    24
        SubSection "Display"
        Depth           24
                Modes           "1024x768" "800x600" "640x480"

Section "ServerLayout"
        # The Identifier value will be used in the command-line call.
        Identifier      "Layout0"
        Screen          "Default Screen 0"
        InputDevice     "Generic Keyboard 0"
        InputDevice     "Configured Mouse 0"

        Option          "SingleCard"

xorg.conf.probe[edit | edit source]

Besides the standard xorg.conf we'll need another configuration file, xorg.conf.probe. While the multiterminal is running, we disable interruptions on channel 10 (IRQ 10) to avoid VGA (and VESA VBE) calls to a board interfering with the others. However, without these calls the secondary boards are not initialized. To solve this problem, during system startup the XOrg server will be run with the xorg.conf.probe file. It will probe for these cards with IRQ 10 calls active during the test, thus initializing them.

To create your xorg.conf.probe, take the xorg.conf as a base, remove the sections related to the primary graphic card (which is initialized by the BIOS when the computer turns on) and toggle all NoInt10 options to "No". A single layout will be enough, as long as it includes all secondary cards. To illustrate, below are some sections of the xorg.conf.probe file derived from the previous xorg.conf:

# In all Device (graphics card) sections, toggle NoInt10 to:
        Option          "NoInt10"               "no"

# Declare only one layout, and without the "SingleCard" option.
# All the secondary screens should be present.  Their position
# (LeftOf, etc.) is not significant, nor the input devices.

Section "ServerLayout"
        Identifier      "probe"
        Screen          "Default Screen 1"
        Screen          "Default Screen 2"   LeftOf  "Default Screen 1"
        Screen          "Default Screen 3"   LeftOf  "Default Screen 2"
        InputDevice     "Generic Keyboard 1"
        InputDevice     "Configured Mouse 1"

To run the probe we provide the xorg-multiterminal script. It runs the X server in probeonly mode (check for video adapters and exit), using the xorg.conf.probe as the configuration file. As explained before, this step initializates the secondary video cards. The file contents are:


[[ -f "$file" ]] && /usr/X11R6/bin/X -config "$file" -probeonly 2>/dev/null

Save it with the executable bit set and configure the startup system to run the script. On Debian, the path should be /etc/init.d/xorg-multiterminal, and there are two ways of configuring the system:

  • Through the update-rc.d command. This works for both users of the default Debian init system (sysv-rc) and users of the file-rc package.
update-rc.d xorg-multiterminal start 70 S .
  • Manually:

On a Debian system with the default init system, create a symbolic link:

ln -s /etc/init.d/xorg-multiterminal /etc/rcS.d/S70xorg-multiterminal

On a Debian system with the file-rc package, add the following line in an appropriate place of the /etc/init.d/runlevel.conf file:

70        -        S        /etc/init.d/xorg-multiterminal

GDM[edit | edit source]

The last step is configuring the login manager to start all the X servers. We will configure only GDM. Other login managers such as XDM and KDM may be configured in a similar manner.

The “[servers]” section of the /etc/gdm/gdm.conf file should have multiple entries, as in the following four-terminal example:


The name of the servers are arbitrary. A section must be added for each one, with the content as shown below:

name=Standard server
command=/usr/X11R6/bin/X -br -audit 0 -layout Layout0 :0 vt7 -sharevts

name=Standard server
command=/usr/X11R6/bin/X -br -audit 0 -layout Layout1 :1 vt8 -sharevts

name=Standard server
command=/usr/X11R6/bin/X -br -audit 0 -layout Layout2 :2 vt9 -sharevts

name=Standard server
command=/usr/X11R6/bin/X -br -audit 0 -layout Layout3 :3 vt10 -sharevts

Troubleshooting[edit | edit source]

Problems when starting the multiterminal will be logged in the files /var/log/Xorg.*.log. Each terminal's X server will create its own log file.