Thursday, July 26, 2007

How I made my linux Multiseat X setup using faketty

I haven't updated my blog in a long time, but I decided to post my multiseat setup using faketty, hoping it's useful to someone.

My setup is pretty simple (only two heads), but I wasn't able to get it to work using userful [1], and I had various keyboard troubles using evdev.

Hardware:
Pentium III 800mhz
256Mb RAM
nVidia Geforce 2 MX 400 (nv driver)
S3 Virge DX (s3virge driver)

Software:
Ubuntu Linux 6.10
(Should work with 7.04; faketty 0.06 doesn't compile with linux >= 2.6.22, so you will have problems under 7.10)

I pretty much followed the wikibooks faketty guide [2], except for the xorg probe stuff, I didn't need it. If you hack you own xorg.conf (like I did), don't forget to include
Option          "CorePointer"
on each mouse.

For reference, you'll find my xorg.conf and gdm.conf at the end of this post.

The problem with faketty is that /dev symlinks go away each boot, and the ftty's also like to change once in a while.

So I did a script, called findkeyb.sh, that runs every boot before gdm and sets up the symlinks:

#!/bin/bash

# This script finds keyboards and sets up the tty symlinks for use with
# multiseat and faketty

# how many keyboards are there
QT_TEC=`cat /proc/bus/input/devices | grep Keyboard -A 3 | grep -v Name \
| grep -v "Sys" | grep -v "\-\-" | grep input0 -A 1 | grep -v "\-\-" \
| grep -v "input" | wc -l`

echo "$QT_TEC keyboards:"
cat /proc/bus/input/devices | grep Keyboard -A 3 | grep -v Name | grep -v "Sys" \
| grep -v "\-\-" | grep input0 -A 1 | grep -v "\-\-" \
| grep -v "input" | awk '{print $4;}'

echo "$QT_TEC keyboards:" > /findkeyb.log
cat /proc/bus/input/devices | grep Keyboard -A 3 | grep -v Name | grep -v "Sys" \
| grep -v "\-\-" | grep input0 -A 1 | grep -v "\-\-" | grep -v "input" \
| awk '{print $4;}' >> /findkeyb.log

TEC=`cat /proc/bus/input/devices | grep Keyboard -A 3 | grep -v Name \
| grep -v "Sys" | grep -v "\-\-" | grep input0 -A 1 | grep -v "\-\-" \
| grep -v "input" | awk '{print $4;}'`

COUNTER=50
for i in $TEC; do
rm -f /dev/tty$COUNTER
ln -s /dev/$i /dev/tty$COUNTER
let COUNTER=COUNTER+1
done

I added symlinks to this script to /etc/rc.2, rc3.d, rc4.d and rc5.d (ugly ugly hack, heh).
ln -sf  /etc/rc.2/S11keyb
ln -sf /etc/rc.3/S11keyb
ln -sf /etc/rc.4/S11keyb
ln -sf /etc/rc.5/S11keyb

Hope this helps, and soon someone comes up with an easier way to set up multiseat.

Links:
[1] Userful Desktop Multiplier / Desktop Server
[2] http://en.wikibooks.org/wiki/Multiterminal_with_faketty
[3] Faketty 0.06
[4] Other faketty versions and multiseat patches

Files:
xorg.conf
findkeyb.sh
gdm.conf
faketty-0.06.tar.bz2

Multiseat links not related to my setup (but might be useful):

MULTILINUX
netpatia (ubuntu)
Multiterminal with Xephyr - Wikibooks, collection of open-content textbooks
HOWTO Multiseat X - Gentoo Linux Wiki
Multiseat X Under X11R6.9/7.0 - Chris Tyler's Blog
Build a Six-headed, Six-user Linux System
Multiseat Linux - One computer, multiple monitors, mice, and keyboards - Linux Agora Forums
Multiseat - Wikipedia, the free encyclopedia
BeTwin 2000/XP
Slashdot | Multiple Desktop Users on a Single Machine?
http://en.wikibooks.org/wiki/Multiterminal_with_Xnest

2 comments:

z12 said...

X.org 7.0 starts to deal with this issue, but the support is patch at best. Here's a discussion of the problems: http://lists.freedesktop.org/archives/xorg/2005-December/011475.html

Userful's multi-seat approach is different from and better than X's approach. And as a result it "just works" and supports all video cards supported by X, and can be configured quickly and easily. Userful virtualizes a single instance of X to support multiple users. Other multi-seat approaches start separate instances of X (one for each user). The separate instance approach has the following limitations:

1. They don't support using both heads on consumer dual head cards. The hardware cost savings alone of using dual-head single chip cards instead of single chip single head cards or very expensive dual chip dual head cards can easily exceed a hundred dollars per head, in addition to enabling you to fit more users on the limited number of PCI slots in your motherboard. 2. They are very finicky about the graphics cards and chipsets supported. 3. They are less resource efficient (each instance of X imposes a RAM and CPU overhead).

Userful's approach also offers easy configuration, and a bunch of other benefits.

Userful has been deploying multi-station Linux since early 2002 and developed some GPL'd kernel patches to help make multi-station work. Eventually they switched approaches because of the difficulties listed above.

Userful's Desktop Multiplier package also includes some graphical install and configuration tools, cross distro testing and quality assurance, and builds RPM/DEB packages to make installation and removal on supported distros comparatively effortless.

Userful also builds some other layers on top like easy graphical configuration.

Ivo Anjo said...

Well, the previous comment is obviously semi-spam, but userful *is* an interesting option (one that I clearly state didn't work for my setup).

Anyway, if anyone is still reading this, you might want to take a look at https://fedoraproject.org/wiki/Features/Multiseat .