Monday, March 24, 2008

Multiseat in Ubuntu 8.04 (III)

<< step (II) <<

After the previous modifications, our system is almost ready to use. Unfortunately there are still some pending details to be resolved.

The first problem is to achieve having every Xephyr screen properly placed (one display for every Xephyr). The current Xephyr version does not support the geometry parameter that most X applications include, so it is not possible to place the Xephyr window in the desired place (i.e. one Xephyr on every display).

To workaround this problem we can use some command line tools in order to place every Xephyr window just in the place where we want to have it. We will need the following packages: xwininfo, wmctrl. Install them with your favorite tool (synaptic, apt-get).

The next step is to modify the gdm.conf file in order to invoke a wrapping script when calling the gdm greeter.

In our example, we have the following script wrapper placed in /usr/sbin just as we did with the Xephyr wrapper (be sure to give the script execution permissions):


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

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


In our particular case, we have tho displays at 1280x1024. Having the display resolutions hardcoded in such a script is very awful, so consider it just as a dirty and quick workaround to have things working. Experienced bash script coders with nicer solutions are welcome :-)

As we said before, you have to modify the /etc/gdm/gdm.conf file (the gdm greeter call) in order to call this script. The script will move one of the Xephyr sessions to the right display while maintaining the other on the left display.


# The greeter for attached (non-xdmcp) logins. Change gdmlogin to gdmgreeter
# to get the new graphical greeter.
# Greeter=/usr/lib/gdm/gdmgreeter
Greeter=/usr/sbin/Xephyr-login.sh


As you can see, when the greeter is expected to be invoked, the wrapper script (including greeter invocation) is executed instead.

The last comment is about the greeter. There is something wrong about screen size detection with the default gdm greeter (gdmgreeter). It always try to start at a resolution of 1600x1200, so we had to change to the old greeter (gdmlogin) which detects properly the screen resolutions of the Xephyr sessions.

21 comments:

Marcio Torres said...

Hello, I would like to know what Xephyr you used that example, and where succeeded?. I mounted multiterminais with examples of this link ->http://www.ronaldcosta.pro.br/sistemas/wiki/index.php?title=Multiterminais_Ubuntu_7.04

josean said...

We just used the standard Xephyr coming with the distribution (8.04). The goal right now is to achieve a multiterminal without external packages and without having to patch the standard code.

Unknown said...

Hi. Just to say thanks for all your instructions on this. I'm going to be trying to make a multiseat on the final release version of 8.04, and hope you will be updating to reflect the changes in the final, as opposed to the beta here. :D

Anonymous said...

hello,
Thank you very much for your HOWTO.
i have three questions please:
1_can i have multiseat system with 6 or 8 stations with your HOWTO.
2_how about sound configuration for each station.
3-how about peripheral usb like flash disk usb for each station independantly.
thank you .

Anonymous said...

Log on and vote for a simplification of this on Ubuntu Brainstorum!

http://brainstorm.ubuntu.com/item/3442/

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...

Hi josean. I'm using your multihead setup to run an internet kiosk, however I have found some problems for which I don't have any solution yet:

1. Ctrl-C in any terminal sends both to gdm again. Very annoying.

2. -Option "DontVTSwitch" "yes"- directive in xorg.conf is ignored, I can prevent virtual ttys to run, but the key conbination that sends to them are still working.

3. Cursor keys are not working properly. I can use numpad keys if need, but pressing 'up' key has the effect of 'prnt scn'.

Are you experiencing similar problems? Hope you can give a tip on how to solve any of them.

Regards-

Anonymous said...

>3. Cursor keys are not working properly. I can use numpad keys if need, but pressing 'up' key has the effect of 'prnt scn'.

I don't have the multiterminal working entirely yet,but I did have to fix this on my machine. I used the following for my keyboard settings:

Option "XkbModel" "pc105"
Option "XkbLayout" "us"

Anonymous said...

Hola, he estado probando esta configuraciĆ³n con una tarjeta nvidia 8400 GS pero debido a la falta de compatibilidad con xrandr no he podido seguir los primeros pasos. He intentado no obstante adivinar los nombres de los monitores, con nvidia-settings pero no he conseguido resultados.

¿Es imprescindible disponer de la informaciĆ³n que proporciona xrandr?

Gracias y saludos.

Anonymous said...

Hi, great article! I wonder if it is possible to configure 2 barcode readers as well; one for each display (besides 2 mice and 2 keyboards)? Can you configure those devices in xorg.conf?

josean said...

As far as I know, barcode readers just work as keyboards and do not need a particular entry in xorg.conf

If you have any reader at hand I would suggest you just to try them with no changes.

Anonymous said...

Hi!.
Thanks por the howto.
I´ve link it to one forum where I have been asking for help and nobody can help me.
I hope it doesnt bother you.

Anonymous said...

Ups, i forgot the link.
EOL and multisear questions

Thanks a lot!

Anonymous said...

Let me know if you're interested in submitting your weblog to UbuntuWeblogs.

Anonymous said...

Hey,

The patch you use for Xephyr applies on Xorg 7.2. Since I'm using Ubuntu 8.10 I'm looking for a patch for Xorg 7.4.

Do you have it? Or can I just apply the patch of 7.2?

josean said...

I intend to test the multiseat system on Ubuntu 8.10 as soon as possible.

I hope to have the information and the answers related tto Ubuntu 8.10 in a few days.

Amitz Sekali said...

Your guide doesn't work for current debian lenny. Xephyr successfully spawned 2 sessions but it seems the sessions can't be separated by Xephyr-login.ssh . Which log should I examine to find out what's wrong?

Other than that, good work! :-) I won't even know where to start without your guide.

Anonymous said...

@Josean. Don't bother for 8.10, it's almost impossible to do it (OK, I'm not as good as you, but still).

I've tested it on 9.04 and a lot of problems have been fixed! Maybe you should invest your time in that.

Anonymous said...

Does someone has automating script(s) for setting up Linux multiseat systems with dual head graphic cards, if yes kindly share.Thanks in advance.

josean said...

Regarding the topic of multiseat on Ubuntu 8.10, I have been doing several tests without success so far.

The current version of Ubuntu (8.10) manages the input events via HAL. The goal of this change is to better manage input devices when they are hot plugged / unplugged.

No input devices definitions in xorg.conf anymore, but I still keep trying. I will let you know if I achieve some success.

Anonymous said...

If someone has automating scripts to build multiseats with dual headed VGAs to work with five(5) cards, kindly share. I have been searching for months without success.