Tuesday, February 19, 2008

Multiseat computer with Ubuntu 8.04

The goal of this guide is to achieve a multiseat (also called multiterminal) computer so that more than one user can work simultaneously with the computer.

Update (20090619): New tutorial for Multiseat in Ubuntu 9.04 available




In our particular case, we want to obtain a computer for two users, and as a constraint we want to use only one video card. Obviously the card will be a multihead one.

Our hardware can be considered as a low cost PC: The computer is equiped with a Pentium 4 at 3GHz, 512MB of RAM and a 80GB hard sisk. The video card is a Radeon X300 PCIe by ATI with two outputs (VGA and DVI). On the DVI output we have a DVI to VGA converter so we can connect two simple VGA monitors.

What to do step by step:

1.- Install the latest available version of Ubuntu 8.04 on your hard disk. We started the first prototype with the alfa 2 version and several of the problems that we encountered have been already fixed.

2.- After the installation do a package update to be sure that your system has the latest available packages.

One of the main changes in the multihead configuration is the use of xrandr. First of all you must plug the two monitors to your graphic card and obtain your configuration details. Read carefully the instructions of xrandr. The video out connections (VGA, DVI) are referenced with different names depending on your card manufacturer.


# xrandr -q
Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 2560 x 1024
VGA-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 337mm x 270mm
1280x1024 60.0*+ 75.0 59.9
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3
640x480 75.0 72.8 60.0
720x400 70.1
DVI-0 connected 1280x1024+1280+0 (normal left inverted right x axis y axis) 337mm x 270mm
1280x1024 60.0*+ 75.0 59.9
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3
640x480 75.0 72.8 60.0
720x400 70.1
S-video disconnected (normal left inverted right x axis y axis)


Once you have this information, you can modify your /etc/X11/xorg.conf file. It is very advisable to make a backup of the original (working) configuration file.

This is the xorg.conf for the prototype here presented:


# xorg.conf (X.Org X Window System server configuration file)

Section "Module"
Load "dri"
Load "drm"
Load "glx"
EndSection

Section "DRI"
Mode 0666
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

Section "InputDevice"
Identifier "Keyboard-base"
Driver "kbd"
# Option "Device" "/dev/null"
Option "XkbRules" "xorg"
Option "XkbModel" "evdev"
Option "XkbLayout" "es"
EndSection

Section "InputDevice"
Identifier "Mouse-base"
Driver "mouse"
Option "Device" "/dev/null"
EndSection

Section "Device"
Identifier "Card0"
BoardName "ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)]"
Driver "ati"
BusID "PCI:1:0:0"
Option "Monitor-VGA-0" "Mon-VGA"
Option "Monitor-DVI-0" "Mon-DVI"
EndSection

Section "Monitor"
Identifier "Mon-VGA"
Option "DPMS"
EndSection

Section "Monitor"
Identifier "Mon-DVI"
Option "DPMS"
Option "RightOf" "Mon-VGA"
EndSection

Section "Screen"
Identifier "Screen-base"
Device "Card0"
Monitor "Mon-VGA"
DefaultDepth 24
Subsection "Display"
Depth 24
Modes "1280x1024" "1024x768"
Virtual 2560 1024
EndSubSection
EndSection

Section "ServerFlags"
# Even if mouse detection fails, X will start
Option "AllowMouseOpenFail" "yes"

# VT switching is disabled
Option "DontVTSwitch" "yes"

# X restart (Ctrl+Alt+Backspace) is disabled
Option "DontZap" "yes"
EndSection


The lines ...

Option "Monitor-VGA-0" "Mon-VGA"
Option "Monitor-DVI-0" "Mon-DVI"

... are to indicate which monitor is connected to each of the card video outputs.

You can eliminate some lines, such as those related to acceleration (dri, glx). As we will use Xephyr, the final result will not have 3D acceleration. In our case, that does not matter because the PC will be used on an office environment, mainly for administrative tasks.

The line ...

Virtual 2560 1024

... on the screen section is like a kind of bounding box containing the two monitor. As you can see, we have two 1280x1024 monitors in a side by side configuration.

If you restart the X system, you will have a big desktop across the two monitors.

Update (20080508): Comment out the "/dev/null" option in the mouse section. In the final configuration you will not need the base mouse anymore, but this line in this moment will let your desktop without mouse support.


Section "InputDevice"
Identifier "Mouse-base"
Driver "mouse"
-> Option "Device" "/dev/null"
EndSection


>> step II >>

17 comments:

Anonymous said...

Hey Josean,

Many thanks for getting onto the 8.04 guide! Can't wait for the next steps that include any Xephyr-related and GDM-related configurations :-).

If there are any people here that are having problems with getting the next XRandR dualhead to work with 8.04, here are two extra links with more info that might help:

(1) http://www.intellinuxgraphics.org/dualhead.html
(2) http://www.thinkwiki.org/wiki/Xorg_RandR_1.2

...Now for us to sit tight for the Xephyr and GDM configuration needed for 8.04 multiseat... :)

Cheers!

Anonymous said...

Hmm! My Ubuntu 8.04 (Hardy Heron) machine isn't loading GDM nor X.org anymore (and neither can I switch to a VT), I think an update might have broken it.

Hope this hasn't happened to you either Josean.

josean said...

...Hope this hasn't happened to you either Josean...

Do not worry. I have had a lot of problems in gdm / gnome, such as a bug in gnome-session (alfa 2) and then updates which lead my system to a non consistent state due to different versions between gdm components.

Right now, everything is working properly and the system seems to be stable. I am just eliminating unnecessary code to show the simplest solution. The code will be published as soon as possible.

Anonymous said...

There is an easier free way to do this using Userful Multiplier:

http://userful.com/free-2-user

It automatically deals with GDM, config issues, keyboard assignment, etc.

josean said...

The advantage of the proposed solution is that you only need to use open source software. You do not have to depend any more on closed third party products.

Anonymous said...

I am using a nVidia GeForce 6200 card with two outputs. I can't get RandR 1.2 to work. I make the changes according to your xorg.conf (but with my configuration) but only one window gets invoke.

My output is:


lspci | grep VGA
02:00.0 VGA compatible controller: nVidia Corporation NV44 [GeForce 6200 LE] (rev a1)


May I use nVidia here -or- is there another way to do Multiseat with Ubuntu 8.04 for those using nVidia?

Fernando said...

Thanks for this nice tutorial!

I got multiseat working in a Toshiba Satellite a205-s5804. So my LCD is widescreen but my VGA nop, then you can use xrandr to readjust screen if having troubles with xorg.conf

#!/bin/sh
# /usr/sbin/Xephyr-login.sh

XAUTHORITY=/var/lib/gdm/:0.Xauth
DISPLAY=:0 /usr/bin/xrandr --output LVDS --mode 1280x800 --right-of VGA --output VGA --mode 1280x1024
sleep 3
XAUTHORITY=/var/lib/gdm/:0.Xauth
XEP=$(xwininfo -root -children -display :0 | grep "Xephyr on :1" --max-count=1)
echo XEP ${XEP} >> /tmp/logXephyr
set -- ${XEP}
XAUTHORITY=/var/lib/gdm/:0.Xauth
DISPLAY=:0 wmctrl -i -r $1 -e 0,1280,0,-1,-1
/usr/lib/gdm/gdmlogin
# /usr/lib/gdm/gdmgreeter

Blessings!

--
develCuy , a drupaler at Perú

Wouter said...

Fist of all: thanks for this excellent article, everything is working perfectly here, and it's nice to save a little power too!

Some advice on a problem I encountered: (and maybe someone else too :-)) if during the setup X starts but the screen stays black: take a look at your /usr/local and see if there are things left from the previous custom Xephyr installation used in the pre 8.04 tutorial! (Simply test by moving /usr/local to /usr/local.not and restart.)

Anonymous said...

Hey,

I use the same setup with Xgl (Package xserver-xgl) instead of Xephyr in order to have acceleration working. Good results.

For keyboard, I use Jori's method as described here: http://research.edm.uhasselt.be/~jori/page/index.php?n=Misc.DualSeatX

Does Xephyr have any advantage over Xgl?

josean said...

The main advantage of the Xephyr method is that you only need packages coming from the official distribution.

You can update your system without need to recompile packages. Your system will be maintained just as any other standard Ubuntu install.

I am also interested on the Xgl method. I have been doing some tests, but I am experiencing problems related to the Xorg server. I have been unable to obtain a working system so far, but I have intentions to keep on doing tests.

Anonymous said...

You're right about the non-deb package requirement. I had to build xevdevserver externally (but used checkinstall to convert it to a deb package before installation). I hope someone will add evdev capabilities to Xgl just like Xephyr's, so that key-injection hacks won't be needed.

By the way, did you run into any power-saving (DPMS) issues with your multiseat, or does Xephyr pass events back to the main X server to prevent freezing? I ran into issues with the Xgl solution and had to hack around a bit.

And while we're at it, are you able to have separate power-saving for each seat? How?

Anonymous said...

Hi, great article. I followed your instructions and I got my multiseat computer running with ubuntu 8.04 (except the mousewheel, tried compiling xephyr with several pi->nButtons numbers but did not succeed. anyway I'm still very happy with all this)

However keyboard and mouse do not work in ubuntu 8.10. What has changed between these two versions?

josean said...

I intend to test the multiseat system on Ubuntu 8.10 in just a few days. I have no information related to multiseat in Ubuntu 8.10 so far.

aneolf said...

Hola Josean.

Antes de meterme en harina, queria preguntarte si este método funcionaria también para Ubuntu 8.04 AMD64.

Anonymous said...

Same problem here with Ubuntu 8.10. Two gdm-greeters, no keyboard/mouse.

Anonymous said...

great guide to start installing ubuntu on my computer. thanks.

http://www.oracledba.in said...

i like this