Friday, September 08, 2006

Multiseat (V): gdm and xkb

(...comes from step IV)



The next step is to configure gdm to indicate how to execute Xephyr.sh (the wrapper script). The call includes a couple of parameters (display and xauthority) that will be converted to environment variables . The other pair of parameters are the physical addresses of the input devices, that will be converted to the event numbers to be used as keyboard and mouse events.


# cp /etc/gdm/gdm.conf /etc/gdm/gdm.conf.bak
# vi /etc/gdm/gdm.conf


Only the servers section of the gdm.conf file is shown

[servers]

0=Xephyr0
1=Xephyr1
2=Xephyr2

[server-Xephyr0]
name=Xephyr0
command=/usr/bin/X -ac -br
handled=false
flexible=false

[server-Xephyr1]
name=Xephyr1
command=/usr/sbin/Xephyr.sh -display :0.0 -xauthority /var/lib/gdm/:0.Xauth -fullscreen -kbdphys isa0060/serio0/input0 -mousephys isa0060/serio1/input0 -use-evdev
handled=true
flexible=false

[server-Xephyr2]
name=Xephyr2
command=/usr/sbin/Xephyr.sh -display :0.1 -xauthority /var/lib/gdm/:0.Xauth -fullscreen -kbdphys usb-0000:00:1d.1-1/input0 -mousephys usb-0000:00:1d.1-2/input0 -use-evdev
handled=true
flexible=false


Notice theat the command lines have been split for better readability.

Right now, you already have a multiseat computer. If you start the graphic mode, you will see the two monitors showing the gdm login screen.

# /etc/init.d/gdm start


In this moment there is only one problem remaining: To be able to obtain a proper configuration of the keyboards.

According to messages in several forums on Internet, evdev seems to have some problems still waiting to be patched related to keyboard configuration. Some options are ignored, some others can lead to a fully missconfigured keyboard (no one key mapping to the correct one). After many hours looking for information, and dozens of trial-error tests with setxkbmap, we finally achieved to obtain a correct keyboard configuration.

The best solution is to create a keyboard configuration file for every Xephyr session (change the layout according to your particular locale):


# vi /etc/X11/xkb/X1-config.keyboard
model = "pc105"
keycodes = "evdev"
layout = "es"


# cp /etc/X11/xkb/X1-config.keyboard /etc/X11/xkb/X2-config.keyboard


Do never include this line rules = "evdev" in the Xn-config.keyboard file. Every test we did (and we did really lots of tests!) having such line present, the result was a useless keyboard with no correct keys at all!

Update (4-May-2007): Since we are using a Xephyr compiled on another distribution, there seem to be an issue with the directories, and some configuration files can not be found. Including these additional lines, you can avoid all the keyboard related problems:

# ln -s /usr/share/X11/xkb /usr/lib/X11/xkb
# cp /etc/X11/xkb/X*.keyboard /usr/lib/X11/xkb
# cp `which xkbcomp` /usr/lib/X11/xkb
# mkdir /usr/lib/X11/xkb/compiled


Launch again the gdm, and have a coffee break. Your new toy is ready to play with!

(continues on step VI...)

20 comments:

Anonymous said...

Hi, im trying to use it, but, i have made the download of xephyr-compiled and i extract the files to /usr/ but, after this my X doent open anymore... i'm a little confuse in this part of your howto, can you help me?
thanks

josean said...

Xephyr must be extracted in /usr/local, and the wrapper must be placed in /usr/sbin

Another option, if you want your system to have the less possible non-ubuntu elements is just to install xephyr from the Ubuntu repository, and then replace just the binary by the patched one:

1.- Be sure to have the 'universe' repository enabled (see /etc/apt/sources.list)
2.- # apt-get install xserver-xephyr
3.- Download and extract the patched xephyr in /tmp
4.- Replace only /usr/local/bin/xephyr by the patched xephyr binary.

Be sure to give execution permissions to the wrapper script!

Anonymous said...

right... but im still with problem can you talk to me by mail? gtalk: fssilva@gmail.com or msn: fabiossilva@hotmail.com
thanks

Anonymous said...

hi, this tutorial its the best that i found about use multiseat on linux. ok. i have a big problem, when i try to start my X server i get a keycodes problem's all keys are wrong. i make the steps, i dont know what it's happening. i'm using Debian SID.

perti@linuxos:~$ ls /etc/X11/xkb/X*
/etc/X11/xkb/X1-config.keyboard /etc/X11/xkb/X2-config.keyboard

perti@linuxos:~$ cat /etc/X11/xkb/X1-config.keyboard
model = "pc105"
keycodes = "evdev"
layout = "es"

someone can help me please?

thanks a lot.

josean said...

Maybe you need to apply the patch 'xkb-evdev.tar.gz'. Have a look at:

http://en.wikibooks.org/wiki/Multiterminal_with_Xephyr#Layout_configuration

The tutorial in that site is based on debian (I think). So, if the patch does not work, you can try to follow such tutorial with the improvements to dynamically assign id's to events.

Anonymous said...

Hi. Thank you for the excellent article. I've been using it along with:

http://en.wikibooks.org/wiki/Multiterminal_with_Xephyr#Layout_configuration

I'm having a keyboard / keycode problem though. No matter what I do I can't seem to change the keyboard layout. Part of my problem is that I don't quite understand how everything fits together yet. I'm not quite sure what script / component is responsible for setting up the keyboard layout, so it's difficult to track down. I used the scripts / files from the wikibooks link since I'm running Debian Etch, but I was hoping you may be able to point me in the right direction.

Can I start my individual seats by hand rather than using GDM?

Any info you can give me would really be appreciated.

Anonymous said...

I've made all the steps here with fedora core 5 and all worked well except keyboard. I can login in the two monitors but the keyboard maps behave wrong...

Anonymous said...

I like your article. I have a single card (nvidia) with dual output (VGA & DVI) - like your picture. The only problem I have is the Xephyr. It doesn't take the -kbdphys option. I can't get different keypads or mice to map to the screen. Is there a different switch or option?

Anonymous said...

hi.

this is the best optión that i see!! and this is the best website that talk about that.

but the only problem.. it's that the keyboard doesnt work fine.. i try everything.. and it still wrong the keymap. i'm waiting maybe someone could make a fix or sometime like that.

i dont know a lot of gnu/linux. but i think that the problem it's that X can't read the xkb options.

any suggestion?

Anonymous said...

hi people,

the problem with the keyboard remains, does anybody have any clues ? The keyboard layout remains on US101 keys instead of ES-105 keys.

Anonymous said...

I had the same keyboard problem. It makes it a real pain to login. The Xephyr code is looking for the keyoard stuff in the wrong spot. I used some symlinks to fix the problem and point to the Xorg files. I can post the files in a couple days, when I get back to the office, if that would help.

Anonymous said...

Thank you for your answer. Can you send to me these files about the symlinks to fix the problem with the layout keyboard ? What is your email address ?

Anonymous said...

Ok - here's the quick hack I used to get the keyboard to work. (by work I mean use a pc105-us keyboard).

Create directories, files, sym links, etc:
> ln –s /usr/share/X11/xkb /usr/lib/X11/xkb
> cp `which xkbcomp` /usr/lib/X11/xkb
> mkdir /usr/lib/X11/xkb/compiled
> rm –R /usr/lib/X11/fonts/encodings
> ln –s /usr/share/fonts/X11/misc /usr/lib/X11/fonts/misc
> ln –s /usr/share/fonts/X11/75dpi /usr/lib/X11/fonts/75dpi
> ln –s /usr/share/fonts/X11/100dpi /usr/lib/X11/fonts/100dpi
> ln –s /usr/share/fonts/X11/Type1 /usr/lib/X11/fonts/Type1
> ln –s /usr/share/fonts/X11/encodings /usr/lib/X11/fonts/encodings


What I'm looking for, is Xephyr that allows GLX calls. Does anyone have that compiled? Or even better Xglx with evdev support. Anyone?

email: multiseat@arbordata.com

Anonymous said...

Hi..

the hack work fine.. but only one tip maybe is missing.. if you want to the keyboard work very good!! you have to copy Xn-config.keyboard (where n is the numbers of keyboards) to /usr/share/X11/xkb i probe it and it's work FINE with spanish keycodes and all keys work good.

now i want to know how to have 3d aceleration on one layout. because i cant see tv on tvtime :(

Anonymous said...

:~$ xset dpms force off
server does not have extension for dpms option

:~$ xset q
DPMS (Energy Star):
Server does not have the DPMS Extension


No DPMS with Xephyr? What's up? I need that badly. I have a laptop. No off button on the laptop screen! Can't have it running 100% of the time :-).

Unknown said...

Can anybody help me, i've setup the keyboard fine except for the insert that is above to delete key. when i press that particular insert a media player pop up even if im in the terminal. what should i do to make this work?

Unknown said...

Really nice guide, thanks for these great blogs entries.

Only 1 thing: I'm new to linux and you should write that the split command should be written in one line, otherwise it doesn't work, it would save me 3 hours of looking into various settings :)

thanks for this, now I can use this great linux feature.

cya

Anonymous said...

working on mandriva 2007.1 with x11-driver-input-evdev-1.1.5-1mdv2007.1.i586.rpm and for keyboard layout x11-data-xkbdata-0.8-3mdv2007.1.noarch.rpm, Xephyr and Xephyr.sh get from this blog, i follow step by step instruction from this blog and everything working nice, the keyboard layout to....I use 3 old vga pci (trident, cirrus) and one onboard savage vga...4 ps/2 keyboard and mouse with 3 ps/2 to usb converter, 4 crt monitor and amd duron 1800 mhz and ddr 512...
tanks for nice tutorial, now my internet cafe can run with low cost electricity

gentoouser said...

Hi,

Thanks for this how-to!
I've no idea how to set it up with xdm :(

Anonymous said...

Hi, I'm using Kubuntu, obviously it doesn't use the gdm.conf
which one do I edit in Kubuntu for the wrapper script?