Xorg multiseat

From ArchWiki
Revision as of 12:37, 12 November 2007 by RedShift (Talk | contribs) (New page: ==What is multiseat?== Multiseat is a certain setup where multiple users work simultaineously on one computer. This is achieved by having two monitors, two keyboards and two mouses. ==Req...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

What is multiseat?

Multiseat is a certain setup where multiple users work simultaineously on one computer. This is achieved by having two monitors, two keyboards and two mouses.

Requirements

Keyboards and mouses

Any standard PS/2 or USB keyboards will suffice. Same thing for mouses.

Graphics hardware

For the best possible result you'll need two graphics cards. I used an nVidia FX5500 AGP and an nVidia 6200 PCI. It is possible to use only one videocard which has dual heads (like most nvidia cards will have), but this has some limitations: you have to use Xephyr on the second monitor which seems quite a messy solution from what I've read, and for optimal usage both screens need the same resolution.

Processors and memory

If you really are working with two users on the same computer, I'd at least recommend a dual-core processor and plenty of RAM.

Software

You'll need Xorg with the drivers for your graphics card (according to some sources, the closed source nvidia driver works better than the open source nv driver for this) and the evdev (xf86-input-evdev)

Some X knowledge

If you know how X works this will be alot easier. I recommend generating a clean configuration with xorgconfig that works with a single screen. Read through this xorg configuration and make yourself familiar.

Definitions

For this article to be clear, I'll be using the following definitions:

  • screen: A screen is something Xorg can display its stuff on.
  • monitor: A physical monitor you're now sitting in front of.
  • server layout: a definition of which screen, keyboard, mouse to use.

Tips and tricks

  • Set up ssh on your computer, so you can ssh to the machine from another computer (such as a laptop). This is very usefull because you'll probably will run in X not responding anymore or not giving you picture at all.
  • If everything seems to be set up correctly, but for some reason you always get a black picture without a cursor, try setting the first initialized card in the BIOS to be the PCI card one.
  • Finding out which keyboard and mouse is which: open a terminal and use cat to find out. For example, cat /dev/input/mouse1. If you then move your mouse and you see all weird things happening than that is the mouse you're moving. Same goes for keyboards, which are called eventN.
  • Try a basic configuration first. Don't start with the fancy stuff yet, get a very basic Xorg working first.

About evdev

evdev is an Xorg driver which can make use of the kernel event devices, which you can find in /dev/input.

Setting up Xorg

The logic behind this is that you have two server layouts, each assigned with their own keyboard, mouse, video card and monitor.

First of all, we'll start with the basics of setting up Xorg

Section "Module"
    Load        "dbe"   # Double buffer extension

    SubSection  "extmod"
      Option    "omit xfree86-dga"   # don't initialise the DGA extension
    EndSubSection

    Load        "type1"
    Load        "speedo"
    Load        "freetype"
#    Load        "xtt"

        Load       "glx"

EndSection


Section "Files"

    RgbPath     "/usr/share/X11/rgb"


    FontPath    "/usr/share/fonts/misc"
    FontPath    "/usr/share/fonts/75dpi"
    FontPath    "/usr/share/fonts/100dpi"
    FontPath    "/usr/share/fonts/TTF"
    FontPath    "/usr/share/fonts/Type1"
    FontPath    "/usr/share/fonts/msfonts"
    FontPath    "/usr/share/fonts/misc2"
    FontPath    "/usr/share/fonts/local"
    FontPath    "/usr/local/share/fonts"
EndSection

Section "ServerFlags"
        # Option        "DontZap"  # Disable ctrl alt backspace
        Option  "AllowMouseOpenFail"    "true" # Xorg will otherwise not start if it can't find a mouse to use.
        # Option        "DefaultServerLayout"   "alltogether"  # Not really needed when using a login manager
        Option  "Xinerama"      "0"   # Disable xinerama
EndSection

This is some basic Xorg stuff every config needs.

Next, I'll be defining the input devices to use

Section "InputDevice"
        Identifier      "keyboard0"
        Driver          "evdev"
        Option          "Device"                "/dev/input/event1"
        Option          "XkbModel"              "evdev"
        Option          "XkbLayout"             "be"
EndSection

This section defines my first keyboard, called keyboard0. As you can seen it uses the evdev driver. /dev/input/event1 corresponds with the keyboard connected to the PS/2 port of my computer. Create a section like this for each keyboard you have. Don't forget to modify the identifier ofcourse. Keep the identifier simple and match it with the other names. This keyboard0 will be used for screen0 together with mouse0.

Section "InputDevice"
        Identifier      "mouse0"
        Driver          "mouse"
        Option          "Protocol"              "IMPS/2"
        Option          "Device"                "/dev/input/mouse2"
EndSection

This section defines my first mouse, called mouse0. This uses the regular mouse driver. /dev/input/mouse2 corresponds with the mouse connected to the PS/2 port of my computer. Create a section like this for each mouse you have.

Graphics card

Now we'll set up the graphics card for each screen.

Section "Device"
        Identifier      "nvidia0"
        Driver          "nvidia"
        Option          "NoLogo"                "1"  # Remove nvidia branding at startup
        BusId           "PCI:1:0:0"
EndSection

This section defines my first graphics card, called nvidia0. This uses the closed source nvidia driver. Take a close look at the BusID. This option specifies which hardware card to use. You can find out the BusId's with lspci. However, you'll soon find out this doesn't always match. That's because lspci displays the device address in decimal form. Xorg however uses hexadecimal form. So you'll need to convert your address from decimal form to hexadecimal. Thus a device address of 0:10:0 in lspci would become 0:0a:0 in xorg.conf.

Create a section like this for every graphics card you have.

Screens

Here's how we define a screen.

Section "Screen"
        Identifier              "screen0"
        Device                  "nvidia0"
        Monitor                 "l1730s"
        DefaultDepth    24
        Option                  "DPI"   "100x100"

        Subsection "Display"
                Depth   24
                Modes   "1280x1024"     "1024x768"
        EndSubsection

EndSection

This section defines my first screen, called screen0. Pay close attention to the "monitor" option. For easy recognition I called it the model of my monitor.

Monitors

Here's how we define a monitor

Section "Monitor"
        Identifier      "l1730s"
        HorizSync       30-93
        VertRefresh     60
        Option          "dpms"
EndSection

This section defines my first monitor, l1730s. Pay close attention to the identifier.

Serverlayout

Here's the fun stuff. This is how everything is added up.

Section "ServerLayout"
        Identifier      "seat0"
        Screen                                  "screen0"               0       0
        InputDevice     "mouse0"        "CorePointer"
        InputDevice     "keyboard0"     "CoreKeyboard"
EndSection

This is my first seat, called seat0. Here I tell Xorg for the server layout called "seat0" to use my screen0, which is attachted to nvidia0, using keyboard0 and mouse0.