XFree local multi-user HOWTO

Svetoslav Slavtchev

<galia (at) st-peter.stw.uni-erlangen.de>

2003-04-18
Revision History                                                             
Revision 0.1         2003-04-18          Revised by: svetljo                 
add links to related How-To's, notes on reusing Xinerama configured XFree;   
first official release                                                       


 This How-To tries to explain the shortest way to get a working multiple
local X user capable PC system.It is not supposed to be a replacement of the
existing documentation on backstreet ruby home page, which you'll probably
need to consult for more detailed information in case of problems.

-----------------------------------------------------------------------------
Table of Contents
1. Introduction
    1.1. About backstreet ruby
    1.2. About this document
    1.3. Related Documentation
    1.4. New versions of this document
    1.5. Copyright and License
    1.6. Disclaimer
    1.7. Credits / Contributors
    1.8. Feedback
   
   
2. Before we begin
    2.1. XFree configuration files
    2.2. Reusing Xinerama configured XFree
    2.3. Binary packages
   
   
3. Installing the kernel
    3.1. Installing backstreet ruby kernel
    3.2. Notes on building your own kernel
    3.3. Creating needed device files
   
   
4. Setting up the X servers
    4.1. Installing modified X server
    4.2. Creating symbolic Links
    4.3. Using independent keyboards with XFree
    4.4. Using independent mice with XFree
    4.5. For graphic cards without DRI
    4.6. Nvidia GLX & DRI
   
   
5. Configuring display managers
    5.1. Configuring xdm and kdm
    5.2. Configuring gdm
   
   
6. Tweaking it
    6.1. Using independent sound cards
    6.2. Customizing the login screen
    6.3. 1st X server configuration file
    6.4. Number X servers started by Display managers
    6.5. Dynamically switching the number of X servers
   
   
7. Known problems
    7.1. Hardware problems
    7.2. Software problems
   
   
8. Special notes on some distributions
    8.1. Mandrake
    8.2. Red Hat
    8.3. Debian
    8.4. SuSE
    8.5. xxx specific parts/ problems/ solutions
   
   
9. Final words
A. Video compatibility list
    A.1. Graphic card pairs/ triples/ ... which work perfectly
    A.2. Graphic card pairs/ triples/ ... which work, but there are some
        glitches
   
   
B. Example configuration files
    B.1. XFree86
    B.2. Display managers
   
   
C. Scripts
    C.1. wrapper for starting X using Nvidia libGL.so
    C.2. for installing Nvidia drivers for parallel use with DRI
   
   

-----------------------------------------------------------------------------
Chapter 1. Introduction

1.1. About backstreet ruby

Backstreet ruby is a kernel patch for the linux kernel. It is a back port to
linux-2.4 of the ruby kernel tree, which is developed by the Linux Console
Project. The aim of the Linux Console developers is to enhance and reorganize
the input, the console and the framebuffer subsystems in the linux kernel, so
they can work proper independent from each other and to allow multi-desktop
operation. All this is done in the ruby kernel tree which is based on the
development linux-2.5 kernel. The new Input subsystem and the new Framebuffer
layer are already integrated in linux-2.5 kernel, but as the main developer
of the Linux Console Project James Simmons is too busy with completing the
rewrite of the framebuffer layer in linux-2.5, the multi-desktop operation
will not be integrated in the next stable linux kernel (linux-2.6).

So backstreet ruby brings to the current stable linux kernel (linux-2.4) the
enhanced input subsystem and the ability to use multiple graphic cards,
multiple keyboards independently in order to make multiple local XFree users
on a single PC system possible.

You can have multiple independent graphic cards, multiple independent mouses,
but in order multiple users to interact with the system, they do need
independent keyboards as well. Multiple independent keyboards is the feature
that linux-2.4 (and in the future linux-2.6) lacks,and this is what
backstreet ruby adds to the stable linux kernel linux-2.4.

The entire work on back porting ruby to linux-2.4 is done by Aivils Stoss. <
Aivils.Stoss (at) unibanka.lv>

Visit his web site for more information on the patch itself, on the current
status, how to build a kernel using his patch or how to build modified
XFree86 server.

You can find it here:[http://startx.times.lv/] http://startx.times.lv

There are also several mirrors

 1. in the United States
   
    [http://people.debian.org/~andreas/aivils/] http://people.debian.org/
    ~andreas/aivils/
   
 2. in Germany
   
    [http://www.schuldei.org/aivils/] http://www.schuldei.org/aivils/
   
    [http://rfhs8012.fh-regensburg.de/~sls35340/aivils/] http://
    rfhs8012.fh-regensburg.de/~sls35340/aivils/
   
 3. in the United Kingdom
   
    [http://varna.demon.co.uk/~svetlio/aivils/] http://varna.demon.co.uk/
    ~svetlio/aivils/
   

The address of the Linux Console Project is: [http://linuxconsole.sf.net]
http://linuxconsole.sf.net

-----------------------------------------------------------------------------
1.2. About this document

This document tries to explain you, how to configure your system for multiple
local XFree users using the enchanted console/input subsystem in the
backstreet ruby kernel.

Currently there are two ways of setting up multiple local XFree users:

( note : currently it is not possible to setup system for multiple console
users)

 1. Modify the kernel to ignore input from USB keyboards and add the handling
    of USB keyboards to a modified Xserver. This solution was developed by
    Miguel Freitas, visit his page on the topic [http://
    cambuca.ldhs.cetuc.puc-rio.br/multiuser/] http://
    cambuca.ldhs.cetuc.puc-rio.br/multiuser/for instructions how to setup
    such system.
   
 2. Use backstreet ruby kernel which supports independent keyboards
   

I'll concentrate on configuring a system for multiple local XFree users using
the backstreet ruby kernel, but there are parts which can be used also on a
system using Miguel Freitas solution.

Note this document is not supposed to be a replacement of the existing
documentation on the backstreet ruby home page [http://startx.times.lv/]
http://startx.times.lv, but a smaller How-To explaining the way to a working
X multi-user PC system. If you meet some problems you'll probably need to
consult the more detailed information there.

-----------------------------------------------------------------------------
1.3. Related Documentation

The Linux Console Project

[http://linuxconsole.sourceforge.net] http://linuxconsole.sourceforge.net

The backstreet ruby home page

[http://startx.times.lv/] http://startx.times.lv/

Miguel Freitas page on multiple local XFree users

[http://cambuca.ldhs.cetuc.puc-rio.br/multiuser/] http://
cambuca.ldhs.cetuc.puc-rio.br/multiuser/

Russian multiterminal project Gorinich

[http://www.ctc.msiu.ru/zg/main.html] http://www.ctc.msiu.ru/zg/main.html

Step by step instructions by Jean-Daniel Pauget

[http://disjunkt.com/dualhead/] http://disjunkt.com/dualhead/

Multi-seat XFree solution under Linux with framebuffers. by Frode Trydal.

[http://www.itsopen.net/projects/x-hack/] http://www.itsopen.net/projects/
x-hack/
-----------------------------------------------------------------------------

1.4. New versions of this document

you can find the latest version at,

[http://varna.demon.co.uk/~svetlio/ruby-contrib/how-to/
XFree_local_multi-user-HOWTO/] http://varna.demon.co.uk/~svetlio/ruby-contrib
/how-to/XFree_local_multi-user-HOWTO/
-----------------------------------------------------------------------------

1.5. Copyright and License

  This document, XFree-Local-multi-user-HOWTO, is copyrighted (c) 2003 by 
Svetoslav Slavtchev. Permission is granted to copy, distribute and/or modify
this document under the terms of the GNU Free Documentation License, Version
1.1 or any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
A copy of the license is available at [http://www.gnu.org/copyleft/fdl.html]
http://www.gnu.org/copyleft/fdl.html.

  Linux is a registered trademark of Linus Torvalds.
-----------------------------------------------------------------------------

1.6. Disclaimer

  No liability for the contents of this document can be accepted. Use the
concepts, examples and information at your own risk. There may be errors and
inaccuracies, that could be damaging to your system. Proceed with caution,
and although this is highly unlikely, the author(s) do not take any
responsibility.

  All copyrights are held by their by their respective owners, unless
specifically noted otherwise. Use of a term in this document should not be
regarded as affecting the validity of any trademark or service mark. Naming
of particular products or brands should not be seen as endorsements.
-----------------------------------------------------------------------------

1.7. Credits / Contributors

  In this document, I have the pleasure of acknowledging:

*James Simmons <jsimmons (at) transvirtual.com >
   
    for working so hard on linux console project, for developing the new
    framebuffer, VT/console subsystem
   
*Vojtech Pavlik<vojtech (at) suse.cz>
   
    for rewriting the input subsystem and working hard on the linux console
    project
   
*Aivils Stoss <Aivils.Stoss (at) unibanka.lv>
   
    for back porting ruby to linux-2.4 and providing his back port and
    experiences to the world
   

-----------------------------------------------------------------------------
1.8. Feedback

  Feedback is most certainly welcome for this document. Send your additions,
comments and criticisms to the following email address : <galia (at)
st-peter.stw.uni-erlangen.de>.
-----------------------------------------------------------------------------

Chapter 2. Before we begin

-----------------------------------------------------------------------------
2.1. XFree configuration files

You should configure each of your video cards to work properly with a single
X server. This is actually beyond the scope of this document, you should
refer to the documentation which came with your distribution, but some
general hints wont hurt.

The easiest way would be to use the same kind of monitors & video cards, you
could then configure only the first card/ monitor pair, make copies of this
configuration file for the number of video cards you have, and then only
adjust BusID "PCI:x:xx:x" field in the configuration file. You can do this
with the help of lspci, XFree86 -scanpci, or other similar distribution
specific tools.

You could use a similar approach, in case you have only monitors or video
cards of the same type.

Most modern distributions also have advanced tools for easier configuration
of Xinerama. You could use this tools to set-up the system for Xinerama and
then use this configuration file for generating the configuration files for
the different X servers. You could use an example configuration file,
replacing video card and monitor section, by the corresponding sections from
the Xinerama XFConfig-4 file.

Other useful resources:

*[http://www.tldp.org/HOWTO/XFree86-HOWTO/index.html] The Linux XFree86
    HOWTO
   
*[http://www.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/index.html]
    XFree86 Video Timings HOWTO
   
*[http://www.tldp.org/HOWTO/XWindow-Overview-HOWTO/index.html] X Window
    System Architecture Overview HOWTO
   
*[http://www.tldp.org/HOWTO/XWindow-User-HOWTO/index.html] The X Window
    User HOWTO
   

-----------------------------------------------------------------------------
2.2. Reusing Xinerama configured XFree

In case you have a system configured for Xinerama, you can easily adjust the
XFree configuration file, so you can use it for multiple users.

This will allow on you to easily switch between multi-user environment and
Xinerama multi-monitor environment.

What is Xinerama and how the system configured upon this HOWTO differs from a
system using the Xinerama extensions in XFree?

The Xinerama extensions were introduced to the XFree86 system in version 4.0.
Xinerama is an extension to XFree86 Release 6 Version 4.0 (X4.0) which allows
applications and window managers to use the two (or more) physical displays
as one large virtual display.In case Xinerama is not used, applications can
only reside on one of the displays and can not be moved between the two.
Window managers had to be specially written to support the two displays. With
Xinerama, window managers and applications don't have to be specially written
to support the larger "Virtual Desktop" which Xinerama creates.

Just in opposite the primary goal of system configured according this HOWTO
is to offer multiple independent displays for several users on a single PC
system.

for more information on Xinerama read:

*[http://www.tldp.org/HOWTO/Xinerama-HOWTO/index.html] Xinerama-HOWTO,
    Using Xinerama to MultiHead XFree86 v.4.0+
   

-----------------------------------------------------------------------------
2.3. Binary packages

Binary rpms of modified XFree servers are available currently for Mandrake
8.2/ 9/ 9.1, RedHat 8/ 9 and SuSE 8.1. If your running other rpm based
distribution please help me to prepare and rebuild packages (i can not
install all available rpm distros on a single PC. right?), so other users can
get directly the precompiled binaries. If you prepare packages for Debian
submit them and they will be available on the same url. Currently the binary
packages are not mirrored and are available only from

[http://varna.demon.co.uk/~svetlio/ruby-contrib] http://varna.demon.co.uk/
~svetlio/ruby-contrib
-----------------------------------------------------------------------------

Chapter 3. Installing the kernel

-----------------------------------------------------------------------------
3.1. Installing backstreet ruby kernel

Now its time to install the kernel.

The easiest way would be to pull some already available binary kernel, there
are packages for some distributions (? currently only MDK-9.1 ?) or a source
package & rebuild it on your system.

If for some reason you can not use them, or have problems using them you can
also build your own kernel with the bruby patch, for more information how to
do this visit the backstreet ruby page on building and installing the kernel:
[http://startx.times.lv] http://startx.times.lv> (or some of the mirrors)
Documentation -> Quick Kernel

(if you are new to linux reading "The Linux Kernel HOWTO" [http://tldp.org/
HOWTO/Kernel-HOWTO.html] http://tldp.org/HOWTO/Kernel-HOWTO.html could be
very heplfull)

for now there is only one binary kernel package for Mandrake-9.1

you can get it from [http://varna.demon.co.uk/~svetlio/ruby-contrib/
kernel.html] http://varna.demon.co.uk/~svetlio/ruby-contrib/kernel.html
-----------------------------------------------------------------------------

3.2. Notes on building your own kernel

There are some things I would like to mention, although I wont go in details
as the backstreet ruby page on compiling the kernel.

 1. You have to follow this order
    Input support                                                            
    Virtual Terminal support                                                 
    Console drivers                                                          
   
    in order all required options to be available/ selectable
   
 2. You have to use built in input support
    Input device support --> Input core support                              
    Input device support --> Mouse support                                   
   
 3. i would suggest to include also at least one keyboard
   
    (built in - not as module), you can also use modules but i find it safer
    to be able to use a keyboard instead of trying to find a PC with ssh (or
    something similar) to load the required modules
   
    for a AT/PS2 keyboard turn on (not modules)
    Input device support --> Serial i/o support                              
    Input device support --> i8042 PC Keyboard controller                    
    Input device support --> Keyboards                                       
    Input device support --> AT keyboard support                             
   
    for a USB keyboard turn on (not modules)
    Input device support --> Keyboards                                       
    USB support --> support for USB                                          
    USB support --> USB driver (probably usb-uhci.o)                         
    USB support --> USB Human Interface Device (full HID) support            
    USB support --> HID input layer support                                  
   
 4. If you are new to linux do not try to patch already patched kernel
   
    (heavy patched kernel like the ones that ship with most distributions)
   
    use a kernel from www.kernel.org, and take a look at The Linux Kernel
    HOWTO
   

There are number of drivers which do not build for whatever reason, if you
manage to fix them please send us the diff against vanila backstreet ruby
kernel

( plain linux-2.4.xx patched with the latest bruby-xxx.diff)

currently this would be linux-2.4.20 patched with
bruby-2.4.20-20021226.diff.bz2

the drivers i'm aware of are:

 1. usbnet.o - USB-to-USB Networking cable device support
   
 2. usbserial.o - all USB serial drivers
   
 3. i8k.o - Dell Laptop support
   

Support for frame buffer devices is not back ported, and is disabled

if you try to build alsa you might have problems building the usb driver

actually to build it you have to change in include/sound/adriver.h
...                                                                          
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 20)                            
...                                                                          

to
...                                                                          
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 21)                            
...                                                                          

but i do not have the hardware to test, if the compiled driver works
-----------------------------------------------------------------------------

3.3. Creating needed device files

If you are not using devfs file system, you'll have to create several device
files needed for the new input sub-system in the backstreet ruby kernel:
cd /dev                                                                      
mkdir input.old                                                              
mv mouse js? input.old                                                       
mkdir input                                                                  
cd input                                                                     
mknod js0 c 13 0                                                             
mknod js1 c 13 1                                                             
mknod js2 c 13 2                                                             
mknod js3 c 13 3                                                             
mknod mouse0 c 13 32                                                         
mknod mouse1 c 13 33                                                         
mknod mouse2 c 13 34                                                         
mknod mouse3 c 13 35                                                         
mknod mice c 13 63                                                           
mknod event0 c 13 64                                                         
mknod event1 c 13 65                                                         
mknod event2 c 13 66                                                         
mknod event3 c 13 67                                                         
cd ..                                                                        
ln -s input/js0 js0                                                          
ln -s input/js1 js1                                                          
ln -s input/mice mouse                                                       

In case you use devfs, all required devices will be created automatically by
devfs.

Distribution which use devfs are for example Mandrake, ...( are there any
others?). Distribution which do not use devfs are RedHat, SuSE, ?Debian?, ...

You can check whether devfs is used by issuing the following commands

to check whether support for devfs is enabled in your kernel:

cat /proc/filesystems | grep devfs

to check whether devfs is used/ mounted:

mount | grep devfs

if you get empty string this means that devfs is not used, in case you get
something like the following output devfs is activated:

[root@mc contrib]# cat /proc/filesystems | grep devfs

nodev devfs

nodev usbdevfs

[root@mc contrib]# mount | grep devfs

none on /proc/bus/usb type usbdevfs (rw)

none on /dev type devfs (rw)

[root@mc contrib]#
-----------------------------------------------------------------------------

Chapter 4. Setting up the X servers

Now its time to configure XFree.
-----------------------------------------------------------------------------

4.1. Installing modified X server

Note for some video cards you can skip this part, before installing the
modified X server check the video compatibility list,whether you need such
one. Currently there are reports for working configurations without using a
modified X server for Vodoo Graphics as primary and Vodoo3 or Nvidia TNT2 as
secondary.

Probably you only need already rebuild binaries. If there are packages for
your distribution you can install them, if not you have 3 more possibilities:

 1. Install prebuild, but not packaged modified X server and crate the
    necessary symbolic links.
   
    You can get such prebuild binaries from the backstreet ruby home page
    [http://startx.times.lv] http://startx.times.lv.
   
 2. Help us (as well other people using your distribution) in building a rpm
    for your distribution.
   
    ( we lack system installed with all available distributions so we are not
    able to build packages for every distribution)
   
 3. To patch and rebuild XFree from source using the instructions at the
    backstreet ruby page
   
    in the Documentation section. [http://startx.times.lv] http://
    startx.times.lv (or some of the mirrors) Documentation -> Quick XFree
   

note that currently there are two different modifications of the X server

 1. XFree86-4.3 prefbusid ( Prefered Bus ID)
   
    the new recomended patch/ binary
   
 2. just XFree-4.3/ XFree-4.3.patch
   
    which is the older one
   
    (in the rpm section *server-concurrent.*rpm
   

the new patch solves major problems for a number of Graphic cards, check the
Video Compatibility list for details
-----------------------------------------------------------------------------

4.2. Creating symbolic Links

The symbolic links are needed for properly starting several XFree instances,
as well for properly exiting a X session, this applies for both starting X
from console and automatically starting X by the display manager (kdm, gdm,
xdm).

You need to create so much symbolic links to the modified X server binary (or
the original X server in case you don't need a modified one), as the number
of your video cards/ X sessions.

I assume that you will have to use a modified X server, but in case you don
not need it, create the links to your original X server.

cd /usr/X11R6/bin/

ln -s XFree[modified] X0

ln -s XFree[modified] X1

ln -s XFree[modified] X2

In case you use the provided RPM's, you'll need this only if you want more
then 4 parallel running X servers/ X sessions, as the rpm creates 4 symbolic
links to the X server binary.
-----------------------------------------------------------------------------

4.3. Using independent keyboards with XFree

Once you install the backstreet ruby kernel and start it with dumbcon=n, you
get n +1 independent consoles ( 1VGA + n DUMB). In case you have enough
keyboards connected to your PC, each of this consoles is associated with a
given keyboard. This enables you to start multiple X servers on each of the
consoles using for input the keyboard associated with the corresponding
console, hence you get multiple independent X servers with independent
keyboards, which in turn makes it possible one single PC to be used by
several local X users at the same time.

To start X on a given console(using a given independent keyboard) you pass it
the argument "vt[N]", where N is a number from a given tty range.

Under backstreet ruby each console is represented by 8 tty's :

Note *for the new Prefered Bus ID XFree Server you have to also specify   
         the desired graphic card                                            
                                                                             
         with parameter:                                                     
                                                                             
         -prefbusid x:x:x                                                    
                                                                             
         where x:x:x is the Bus ID of the desired graphic card,              
                                                                             
         +for AGP cards something similar to                              
                                                                             
             -prefbusid 1:0:0                                                
                                                                             
         +for PCI cards something similar to                              
                                                                             
             -prefbusid 0:x:0                                                
                                                                             
             x is normally the IRQ number                                    
                                                                             
                                                                             
     *in the following explanation I will not use this option,            
                                                                             
         if you use the Preferd Bus ID X server just append "-prefbusid x:x: 
         x" with the correct Bus ID of the card you want to start right      
         before the last argument "vt[x]"                                    
                                                                             
                                                                             

*VGA: tty0 - tty7
   
*DUMB1: tty8 - tty15
   
*DUMB2: tty16 - tty23
   

so if you have 3 video cards, 3 keyboards, and you have started backstreet
ruby kernel with dumbcon=2, with the following commands you can start 3
independent X servers for 3 simultaneous users:

For 1st X server with the 1st keyboard:

$ startx -- /usr/X11R6/bin/X0 :0 -xf86config /etc/X11/XF86Config-4[for your
1st video card] vt7

For 2nd X server with the 2nd keyboard:

$ startx -- /usr/X11R6/bin/X1 :1 -xf86config /etc/X11/XF86Config-4[for your
2nd video card] vt8

For 3rd X server with the 3rd keyboard:

$ startx -- /usr/X11R6/bin/X2 :2 -xf86config /etc/X11/XF86Config-4[for your
3rd video card] vt16

for the 1st X server you can skip the " -xf86config /etc/X11/XF86Config-4[for
your 1st video card]" argument, in this case the default configuration file "
/etc/X11/XF86Config-4" will be used.

Note *for SuSE users                                                      
                                                                             
         the XFree configuration files are normally /etc/X11/XF86Config      
                                                                             
     *the same applies for RedHat users                                   
                                                                             
         the XFree configuration files are normally /etc/X11/XF86Config      
                                                                             
                                                                             

You can also setup display manager to start the independent X servers, once
everything is properly configured.But don't rush to setup your display
manager before the configuration is finished, because this could give you
serious problems. When you are ready with the required configurations, you'll
reach the section on configuring the display manager.
-----------------------------------------------------------------------------

4.4. Using independent mice with XFree

To use independent mice for each of your independent X server/session, you
have to just modify the input section of the XFree configuration files to
adjust the proper device files.

You have to use /dev/input/mouse[n] , where n is the number of your mouse
starting from 0,

*1st mouse --> /dev/input/mouse0
   
*2nd mouse --> /dev/input/mouse1
   
*3rd mouse --> /dev/input/mouse2
   
*4th mouse --> /dev/input/mouse3
   

you shouldn't use /dev/input/mice because it merges the input from all mice.

here is my configuration: before modifications
------------------------------------------------------------------------------------------------ 
                                                                                                 
# **********************************************************************                         
# Pointer section                                                                                
# **********************************************************************                         
                                                                                                 
Section "InputDevice"                                                                            
                                                                                                 
    Identifier  "Mouse1"                                                                         
    Driver      "mouse"                                                                          
    Option "Protocol"    "IMPS/2"                                                                
    Option "Device"      "/dev/psaux"                                                            
    Option "ZAxisMapping" "4 5"                                                                  
                                                                                                 
# ChordMiddle is an option for some 3-button Logitech mice                                       
    Option "Emulate3Buttons"                                                                     
#    Option "ChordMiddle"                                                                        
                                                                                                 
EndSection                                                                                       
                                                                                                 
------------------------------------------------------------------------------------------------ 

after modifications for the first X server
------------------------------------------------------------------------------------------------ 
                                                                                                 
# **********************************************************************                         
# Pointer section                                                                                
# **********************************************************************                         
                                                                                                 
Section "InputDevice"                                                                            
                                                                                                 
    Identifier  "Mouse1"                                                                         
    Driver      "mouse"                                                                          
    Option "Protocol"    "IMPS/2"                                                                
    Option "Device"      "/dev/input/mouse0"                                                     
    Option "ZAxisMapping" "4 5"                                                                  
                                                                                                 
# ChordMiddle is an option for some 3-button Logitech mice                                       
    Option "Emulate3Buttons"                                                                     
#    Option "ChordMiddle"                                                                        
                                                                                                 
EndSection                                                                                       
                                                                                                 
-----------------------------------------------------------------------------------------------  

for the second X server
-----------------------------------------------------------------------------------------------   
# **********************************************************************                          
# Pointer section                                                                                 
# **********************************************************************                          
                                                                                                  
Section "InputDevice"                                                                             
                                                                                                  
    Identifier  "Mouse1"                                                                          
    Driver      "mouse"                                                                           
    Option "Protocol"    "IMPS/2"                                                                 
    Option "Device"      "/dev/input/mouse1"                                                      
    Option "ZAxisMapping" "4 5"                                                                   
                                                                                                  
# ChordMiddle is an option for some 3-button Logitech mice                                        
    Option "Emulate3Buttons"                                                                      
#    Option "ChordMiddle"                                                                         
                                                                                                  
EndSection                                                                                        
-----------------------------------------------------------------------------------------------   

and so on ...

in case you meet some problems consult with [http://www.tldp.org/HOWTO/mini/
XFree86-Second-Mouse/] "Second Mouse in X mini-HOWTO"

if you still have problems feel free to send me an e-mail.
-----------------------------------------------------------------------------

4.5. For graphic cards without DRI

(or reusing Xinerama configured XFree)

There could be several reasons for not using DRI

*As far i know only one graphic card in a system can use DRI
   
*the Nvidia closed source driver do not support DRI
   

In case one of this reasons applies to your system, you do not need different
XFree configuration files for the different displays.

You could configure your system for Xinerama using the tools provided with
your distribution and reading [http://www.tldp.org/HOWTO/Xinerama-HOWTO/
index.html] The Xinerama-HOWTO, so when the system is used by a single user,
he/she could switch to Xinerama desktop and use all available displays for a
bigger desktop.

Once configured for Xinerama, only small additions are needed to achieve
multiple independent desktops. All you have to do is to add new layouts which
use single screen definition and have independent input devices.

In case you have configured Xinerama in the following way
Section "ServerLayout"                                                       
    Identifier  "Simple Layout"                                              
    Screen "Screen 2"                                                        
    Screen "Screen 1" RightOf "Screen 2"                                     
    InputDevice "Mouse1" "CorePointer"                                       
    InputDevice "Keyboard1" "CoreKeyboard"                                   
EndSection                                                                   

to achieve multiple independent desktops you only have to add Layout
definitions for single screen:
Section "ServerLayout"                                                       
    Identifier  "first-Xserver"                                              
    Screen "Screen 1"                                                        
    InputDevice "Mouse1" "CorePointer"                                       
    InputDevice "Keyboard1" "CoreKeyboard"                                   
EndSection                                                                   
                                                                             
Section "ServerLayout"                                                       
    Identifier  "second-Xserver"                                             
    Screen "Screen 2"                                                        
    InputDevice "Mouse2" "CorePointer"                                       
    InputDevice "Keyboard1" "CoreKeyboard"                                   
EndSection                                                                   

which should result in this layout definitions
Section "ServerLayout"                                                       
    Identifier  "Xinerama"                                                   
    Screen "Screen 2"                                                        
    Screen "Screen 1" RightOf "Screen 2"                                     
    InputDevice "Mouse1" "CorePointer"                                       
    InputDevice "Keyboard1" "CoreKeyboard"                                   
EndSection                                                                   
                                                                             
Section "ServerLayout"                                                       
    Identifier  "first-Xserver"                                              
    Screen "Screen 1"                                                        
    InputDevice "Mouse1" "CorePointer"                                       
    InputDevice "Keyboard1" "CoreKeyboard"                                   
EndSection                                                                   
                                                                             
Section "ServerLayout"                                                       
    Identifier  "second-Xserver"                                             
    Screen "Screen 2"                                                        
    InputDevice "Mouse2" "CorePointer"                                       
    InputDevice "Keyboard1" "CoreKeyboard"                                   
EndSection                                                                   

Now you can start a single X server with option "-layout Xinerama" and enjoy
Xinerama desktop, or

you can start 2 independent X servers using "-layout first-Xserver" for the
first, and "-layout second-Xserver" for the second.

[]

As you will use a single XFree configuration file for all X servers

*in order to use independent keyboards you have to use following command:
   
    For 1st X server with the 1st keyboard:
   
    $ startx -- /usr/X11R6/bin/X0 :0 -layout first-Xserver vt7
   
    For 2nd X server with the 2nd keyboard:
   
    $ startx -- /usr/X11R6/bin/X1 :1 -layout second-Xserver vt8
   
    and if you want to use Xinerama
   
    $ startx -- /usr/X11R6/bin/X -layout Xinerama vt7
   
*also the mice must have different names
    ------------------------------------------------------------------------------------------------ 
                                                                                                     
    # **********************************************************************                         
    # Pointer section                                                                                
    # **********************************************************************                         
                                                                                                     
    Section "InputDevice"                                                                            
                                                                                                     
        Identifier  "Mouse1"                                                                         
        Driver      "mouse"                                                                          
        Option "Protocol"    "IMPS/2"                                                                
        Option "Device"      "/dev/input/mouse0"                                                     
        Option "ZAxisMapping" "4 5"                                                                  
                                                                                                     
    # ChordMiddle is an option for some 3-button Logitech mice                                       
        Option "Emulate3Buttons"                                                                     
    #    Option "ChordMiddle"                                                                        
                                                                                                     
    EndSection                                                                                       
                                                                                                     
    Section "InputDevice"                                                                            
                                                                                                     
        Identifier  "Mouse2"                                                                         
        Driver      "mouse"                                                                          
        Option "Protocol"    "IMPS/2"                                                                
        Option "Device"      "/dev/input/mouse1"                                                     
        Option "ZAxisMapping" "4 5"                                                                  
                                                                                                     
    # ChordMiddle is an option for some 3-button Logitech mice                                       
        Option "Emulate3Buttons"                                                                     
    #    Option "ChordMiddle"                                                                        
                                                                                                     
    EndSection                                                                                       
    -----------------------------------------------------------------------------------------------  
   

-----------------------------------------------------------------------------
4.6. Nvidia GLX & DRI

Note here you will found how to configure your system for parallel use of    
     Nvidia's GLX and XFree's DRI                                            
                                                                             
     in case you do not have Nvidia cards, or you have only Nvidia cards, you
     do not need to read this section                                        
                                                                             
     in the first case you do not need the Nvidia GLX at all, in the second  
     you can use the standard procedure for installing GLX                   

Why Nvidia, why closed source drivers:

a bit mixed up answer:

 1. with the open source driver its almost impossible to bring up a secondary
    card, so we should use the closed one.
   
 2. why Nvidia card? well currently these are the only available affordable
    PCI video cards with some acceleration,
   
 3. <FIX ME is this really so> I tried to use DRI on 2 parallel X servers,
    but it didn't work, i posted mails to XFree, DRI, lkml list, but i got a
    single answer with no valuable information on my problem. I tried to run
    DRI on a Matrox G550 DH AGP & SiS63xx PCI, when enabled for both cards i
    got agp errors, but enabled only for one of the cards, i was getting DRI
    up and running. Please someone confirm or prove me wrong ! </FIX ME>
   

I'll explain several ways how to get working configuration for both Nvidia
GLX and XFree86 DRI, there are probably a lot of other possibilities, and may
be these are not the simplest, but that are the ones i know to work.

The reasons why this is needed:

 1. Nvidia should use different module path for xf86: the glx extension
    module from Nvidia is incompatible with the one from XFree86
   
 2. Nvidia should use different XF86Config file: because DRI should be
    disabled for Nvidia and enabled for others.
   

If You find a simpler way, please mail it me and I'll include it.

Caution this can not be used as is on SuSE Linux                             
                                                                             
        in order to make it easy for the user to switch between Mesa, XFree  
        and Nvidia GL libraries, SuSE uses very complicated setup for the GL 
        libraries.                                                           
                                                                             
        In order to use this setup you have to switch your configuration to  
        XFree86's GL libraries,                                              
-----------------------------------------------------------------------------

4.6.1. Example 1

This is the configuration that i use at my system: ( ATI AIW Radeon 7500 AGP
and Nvidia TNT2 M64 PCI ) XFree configuration files:

 1. create a directory /usr/X11R6/libNV
   
    mkdir /usr/X11R6/libNV
   
 2. create links to the original /usr/X11R6/lib :
   
    cd /usr/X11R6/libNV
   
    lndir -silent -ignorelinks ../lib
   
 3. install the Nvidia driver and libraries in /usr/X11R6/libNV
   
 4. install Nvidia's libGLcore.so.1.0.[driver version] or better
    libGLcore.so.1 in /usr/lib make a symbolic link from /usr/X11R6/libNV/
    libGLcore.so.1 to /usr/lib/libGLcore.so.1 (this will allow you to easyly
    update your Nvidia drivers )
   
    cd /usr/lib
   
    ln -s ../X11R6/libNV/libGLcore.so.1 ./
   
    note: the Nvidia libGL.so is installed /usr/X11R6/libNV so its invisible
    to the system unless you tell the system about the existence of /usr/
    X11R6/libNV. For this setup you must not do this, as it will break the
    standard X server start-up, but you can use the XFree GL libraries with
    Nvidia graphic card and Nvidia closed source drivers as well with a non
    Nvidia graphic card using XFree's DRI, which the GL library from Nvidia
    can not do.
   
 5. add a line in the XFree configuration file for the Nvidia card to point
    the X server to the right location of the library and module path:
    Section "Files"                                                          
                                                                             
    ..........                                                               
    ModulePath  "/usr/X11R6/libNV/modules"                                   
    ..........                                                               
                                                                             
    EndSection                                                               
   
 6. install the Nvidia kernel driver
   

now everything should be fine and you should be able to use DRI and Nvidia
GLX at the same time, you will have a bit smaller performance in comparison
to a setup which uses Nvidia's libGL & libGLcore, but the difference is not
that big on my PC.
-----------------------------------------------------------------------------

4.6.2. Example 2

this example will give you the full performance of both the Nvidia card/s,
and the non Nvidia card, as it uses the XFree's libGL for the non Nvidia card
and Nvidia's libGL for Nvidia cards, but will require one more "Xserver" to
be precise a simple wrapper to add the path to the Nvidia libraries and
symbolic links to it for additional Nvidia cards.

It is almost the same as the previous one, with the difference that the X
servers for the Nvidia cards should start with environment where Nvidia's
libGL is known, while the X servers for non Nvidia cards shouldn't know
anything about the Nvidia libGL. This requires a wrapper to be used for
starting the X servers driving Nvidia cards.

install the Nvidia libraries and kernel driver like in the previous example,
you may skip step 4. as libGLcore.so.1 is installed in /usr/X11R6/libNV and
we'll inform the X servers driving Nvidia cards about the proper path to the
Nvidia libraries.

the missing part --the wrapper
#!/bin/bash                                                                  
export LD_LIBRARY_PATH=/usr/X11R6/libNV                                      
exec /usr/X11R6/bin/X0 $*                                                    

copy this lines in your favourite editor, save the file as XNV, make it
executable:

chmod +x XNV

copy the file to /usr/X11R6/bin and make some symbolic links to it for
additional Nvidia cards: for additional cards just add more link

cp XNV /usr/X11R6/bin

cd /usr/X11R6/bin

ln -s XNV Xnv0

ln -s XNV Xnv1

ln -s XNV Xnv2

remember to use /usr/X11R6/bin/Xnv0, /usr/X11R6/bin/Xnv1 ... instead of /usr/
X11R6/bin/X0, /usr/X11R6/bin/X1 ... for your Nvidia cards while configuring
the display managers in the next chapter, or when starting X on Nvidia card/s
from console.
-----------------------------------------------------------------------------

4.6.3. Installing the Nvidia libraries easily

using the new Nvidia installer (work in progress, do not use if you don't
understand what happens here ;) todo: write a script to perform steps 1-4
(does the script in the Appendix->scripts look OK, please give some feedback)

  manually:

 1. make a backup of your XFree GL libraries:
   
    cd [XFree prefix]
   
    on my Mandrake system i can use
   
    cd $OPENWINHOME
   
    find lib -name "libGL.*" -o -name "libGLcore*" -o -name "libglx.*" |
    xargs tar rpfv libGL-backup.tar
   
 2. then,run the Nvidia installer
   
    ./NVIDIA-Linux-x86-1.0-4349.run --no-opengl-headers --xfree86-prefix=/usr
    /X11R6NV --opengl-prefix=/usr/X11R6NV
   
 3. copy the installed files to /usr/X11R6/libNV
   
    cd /usr/X11R6NV/lib && tar cv * | tar xvC /usr/X11R6/libNV/
   
 4. restore the backuped GL libraries:
   
    cd [XFree prefix]
   
    tar xvfp libGL-backup.tar && ldconfig
   

-----------------------------------------------------------------------------
Chapter 5. Configuring display managers

If you have finished successfully the installation and configuration of the
kernel and XFree. It's time to configure your display manager(s).

Note *for the new Prefered Bus ID XFree Server you have to also specify   
         the desired graphic card                                            
                                                                             
         with parameter:                                                     
                                                                             
         -prefbusid x:x:x                                                    
                                                                             
         where x:x:x is the Bus ID of the desired graphic card,              
                                                                             
         +for AGP cards something similar to                              
                                                                             
             -prefbusid 1:0:0                                                
                                                                             
         +for PCI cards something similar to                              
                                                                             
             -prefbusid 0:x:0                                                
                                                                             
             x is normally the IRQ number                                    
                                                                             
                                                                             
     *in the following explanation I will not use this option,            
                                                                             
         if you use the Preferd Bus ID X server just append "-prefbusid x:x: 
         x" with the correct Bus ID of the card you want to start right      
         before the last argument "vt[x]"                                    
                                                                             
                                                                             
-----------------------------------------------------------------------------

5.1. Configuring xdm and kdm

If everything is working now, its time to setup the automatic starting of X
on all displays. For xdm and kdm you have to modify one single file, for a
RedHat like system this would be /etc/X11/xdm/Xservers, for other
distributions check whether this file exist, in case not, find your XFree86
configuration directory, in it you'll find xdm/Xservers.

Note SuSE uses                                                               
                                                                             
     */etc/X11/XF86Config                                                 
                                                                             
     */etc/X11/xdm/Xservers for xdm                                       
                                                                             
     */etc/opt/kde3/share/config/kdm/Xservers for kdm                     
                                                                             
     */etc/opt/gnome2/gdm/gdm.conf for gdm2                               
                                                                             
                                                                             
     but you could make a backup copy of /etc/opt/.../kdm/Xservers           
                                                                             
     and make symbolic link from /etc/X11/xdm/Xservers to /etc/opt/../kdm/   
     Xservers                                                                
                                                                             
     in order to use the same configuration file for xdm and kdm             

Note Red Hat uses                                                            
                                                                             
     */etc/X11/XF86Config                                                 
                                                                             
                                                                             

For every additional X server you should add a single line, you can copy the
existing line, change the X server binary , display number and append
-xf86config [your configuration file] my original xdm/Xservers:
#####################################################################                            
                                                                                                 
# $XConsortium: Xserv.ws.cpp,v 1.3 93/09/28 14:30:30 gildea Exp $                                
#                                                                                                
#                                                                                                
# $XFree86: xc/programs/xdm/config/Xserv.ws.cpp,v 1.1.1.1.12.2 1998/10/04 15:23:14 hohndel Exp $ 
#                                                                                                
# Xservers file, workstation prototype                                                           
#                                                                                                
# This file should contain an entry to start the server on the                                   
# local display; if you have more than one display (not screen),                                 
# you can add entries to the list (one per line).  If you also                                   
# have some X terminals connected which do not support XDMCP,                                    
# you can add them here as well.  Each X terminal line should                                    
# look like:                                                                                     
#       XTerminalName:0 foreign                                                                  
#                                                                                                
:0 local /bin/nice -n -10 /usr/X11R6/bin/X :0 -deferglyphs 16 vt7                                
                                                                                                 
######################################################################                           

and the modified version
######################################################################                           
                                                                                                 
# $XConsortium: Xserv.ws.cpp,v 1.3 93/09/28 14:30:30 gildea Exp $                                
#                                                                                                
#                                                                                                
# $XFree86: xc/programs/xdm/config/Xserv.ws.cpp,v 1.1.1.1.12.2 1998/10/04 15:23:14 hohndel Exp $ 
#                                                                                                
# Xservers file, workstation prototype                                                           
#                                                                                                
# This file should contain an entry to start the server on the                                   
# local display; if you have more than one display (not screen),                                 
# you can add entries to the list (one per line).  If you also                                   
# have some X terminals connected which do not support XDMCP,                                    
# you can add them here as well.  Each X terminal line should                                    
# look like:                                                                                     
#       XTerminalName:0 foreign                                                                  
#                                                                                                
                                                                                                 
:0 local /bin/nice -n -10 /usr/X11R6/bin/X0 :0 -deferglyphs 16 vt7                               
:1 local /bin/nice -n -10 /usr/X11R6/bin/X1 :1 -xf86config /etc/X11/XF86Config-4.TNT2 vt9        
                                                                                                 
#######################################################################                          

in case you have more video cards just add more lines:
:2 local /bin/nice -n -10 /usr/X11R6/bin/X2 :2 -xf86config /etc/X11/XF86Config-4.[your 3rd card] vt16 
:3 local .....                                                                                        

in case you use single XFree configuration file
######################################################################                           
                                                                                                 
# $XConsortium: Xserv.ws.cpp,v 1.3 93/09/28 14:30:30 gildea Exp $                                
#                                                                                                
#                                                                                                
# $XFree86: xc/programs/xdm/config/Xserv.ws.cpp,v 1.1.1.1.12.2 1998/10/04 15:23:14 hohndel Exp $ 
#                                                                                                
# Xservers file, workstation prototype                                                           
#                                                                                                
# This file should contain an entry to start the server on the                                   
# local display; if you have more than one display (not screen),                                 
# you can add entries to the list (one per line).  If you also                                   
# have some X terminals connected which do not support XDMCP,                                    
# you can add them here as well.  Each X terminal line should                                    
# look like:                                                                                     
#       XTerminalName:0 foreign                                                                  
#                                                                                                
                                                                                                 
:0 local /bin/nice -n -10 /usr/X11R6/bin/X0 :0 -layout first-Xserver -deferglyphs 16 vt7         
:1 local /bin/nice -n -10 /usr/X11R6/bin/X1 :1 -layout second-Xserver vt9                        
                                                                                                 
#######################################################################                          
-----------------------------------------------------------------------------

5.2. Configuring gdm

gdm as a complete rewrite of xdm uses its own configuration file: /etc/X11/
gdm/gdm.conf

you should locate the definitions of the local X servers and add additional X
servers for the number of cards you have.

modifications:

-----------------------------------------------------------------------------
5.2.1. changes part 1/2

.......                                                                      
[servers]                                                                    
# These are the standard servers.  You can add as many you want here         
# and they will always be started.  Each line must start with a unique       
# number and that will be the display number of that server.  Usually just   
# the 0 server is used.                                                      
0=Standard                                                                   
1=Second                                                                     
.......                                                                      
here you'll have only 0=Standard, for each additional X server you should add
a definition like here for 1=Second
-----------------------------------------------------------------------------

5.2.2. changes part 2/2

 
..............................                                                                 
# Definition of the standard X server.                                                         
[server-Standard]                                                                              
name=Standard server                                                                           
command=/usr/X11R6/bin/X0 :0 -deferglyphs 16 -ac vt7                                           
flexible=true                                                                                  
                                                                                               
[server-Second]                                                                                
name=Second server                                                                             
command=/usr/X11R6/bin/X1 :1 -deferglyphs 16 -xf86config /etc/X11/XF86Config-4.[your card] vt9 
flexible=true                                                                                  
..............................                                                                 
and here the exact definition of the command line for starting the X server,
very similar to the definitions in /etc/X11/xdm/Xservers (the definition of
[server-Second] is the additional one)

In case you use single XFree configuration file
..............................                                               
# Definition of the standard X server.                                       
[server-Standard]                                                            
name=Standard server                                                         
command=/usr/X11R6/bin/X0 :0 -layout first-Xserver -deferglyphs 16 -ac vt7   
flexible=true                                                                
                                                                             
[server-Second]                                                              
name=Second server                                                           
command=/usr/X11R6/bin/X1 :1 -layout second-Xserver -deferglyphs 16 vt9      
flexible=true                                                                
..............................                                               
-----------------------------------------------------------------------------

Chapter 6. Tweaking it

adding customization and automation
-----------------------------------------------------------------------------

6.1. Using independent sound cards

Note in case you do not use devfs, you may need to create additional device  
     files, take a look at                                                   
                                                                             
     [http://www.tldp.org/HOWTO/Sound-HOWTO/index.html] The Linux Sound      
     HOWTO, for information how to setup additional sound cards              
-----------------------------------------------------------------------------

6.1.1. Using arts demon (artsd)

we have to specify different sound device for the different Xsessions /
Displays

this is done by using the following options of artsd

*by OSS-free sound driver
    -D /dev/dsp[n]                                                           
   
    where n is the number of the sound card
   
*by Alsa sound driver
    -a alsa -D hw:[n],0                                                      
   
    where n is sound card id
   

add this lines to your Window Manager start-up script

(of course with the proper arguments for your setup)
real_display=`echo $DISPLAY | sed "s/://" | sed "s/\..*//"`                  
case "$real_display" in                                                      
        0)                                                                   
        artsd -F 10 -S 4096 -D /dev/dsp -s 5 -m artsmessage -l 3 -f &        
        ;;                                                                   
        1)                                                                   
        artsd -F 10 -S 4096 -D /dev/dsp1 -s 5 -m artsmessage -l 3 -f &       
        ;;                                                                   
        2)                                                                   
        artsd -F 10 -S 4096 -a alsa -D hw:4,0 -s 5 -m artsmessage -l 3 -f &  
        ;;                                                                   
esac                                                                         

and at the end of the file:
artsshell -q terminate                                                       

here is example for /usr/X11R6/bin/startenlightenment
#!/bin/sh                                                                    
#   License: GPL                                                             
                                                                             
real_display=`echo $DISPLAY | sed "s/://" | sed "s/\..*//"`                  
case "$real_display" in                                                      
        0)                                                                   
        artsd -F 10 -S 4096 -D /dev/dsp -s 5 -m artsmessage -l 3 -f &        
        ;;                                                                   
        1)                                                                   
        artsd -F 10 -S 4096 -D /dev/dsp1 -s 5 -m artsmessage -l 3 -f &       
        ;;                                                                   
        2)                                                                   
        artsd -F 10 -S 4096 -a alsa -D hw:2,0 -s 5 -m artsmessage -l 3 -f &  
        ;;                                                                   
esac                                                                         
                                                                             
/usr/X11R6/bin/enlightenment                                                 
artsshell -q terminate                                                       

this will start 3 arts demons for 3 X servers

 1. demon will use the first OSS sound device for the 1st X server
   
 2. demon will use the second OSS sound device for the 2nd X server
   
 3. demon will use the ??? Alsa sound device for the 3rd X server
   

-----------------------------------------------------------------------------
6.1.2. Using esound demon (esd)

we have to specify different sound device for the different Xsessions /
Displays

this is done by using the following options of esd

*by OSS-free sound driver or Alsa's OSS emulation
    -D /dev/dsp[n]                                                           
   
    where n is the number of the sound card
   
*by Alsa sound driver
     
   
    ??? is it possible ???
   

add this lines to your Window Manager start-up script

(of course with the proper arguments for your setup)
real_display=`echo $DISPLAY | sed "s/://" | sed "s/\..*//"`                  
case "$real_display" in                                                      
        0)                                                                   
        esd -d /dev/dsp -as 5 &                                              
        ;;                                                                   
        1)                                                                   
        esd -d /dev/dsp1 -as 5 &                                             
        ;;                                                                   
        2)                                                                   
        esd -d /dev/dsp2 -as 5 &                                             
        ;;                                                                   
esac                                                                         

and at the end of the file:
esd -terminate                                                               

here is example for /usr/X11R6/bin/startenlightenment
#!/bin/sh                                                                    
#   License: GPL                                                             
                                                                             
real_display=`echo $DISPLAY | sed "s/://" | sed "s/\..*//"`                  
case "$real_display" in                                                      
        0)                                                                   
        esd -d /dev/dsp -as 5 &                                              
        ;;                                                                   
        1)                                                                   
        esd -d /dev/dsp1 -as 5 &                                             
        ;;                                                                   
        2)                                                                   
        esd -d /dev/dsp2 -as 5 &                                             
        ;;                                                                   
esac                                                                         
                                                                             
/usr/X11R6/bin/enlightenment                                                 
esd -terminate                                                               

this will start 3 esound demons for 3 X servers

 1. demon will use the first OSS sound device for the 1st X server
   
 2. demon will use the second OSS sound device for the 2nd X server
   
 3. demon will use the ??? Alsa sound device for the 3rd X server
   

-----------------------------------------------------------------------------
6.2. Customizing the login screen

-----------------------------------------------------------------------------
6.2.1. Using xdm

copy /etc/X11/xdm/Xsetup_0 to/etc/X11/xdm/Xsetup_1

for additional X servers create the files/etc/X11/xdm/Xsetup_[n], where n is
the number of the X server starting from 0

 1. modify the line containing the background image, to adjust the path to
    your image for the 2nd X server
    ....                                                                      
    if [ -r /usr/share/mdk/backgrounds/default.png -a -x /usr/bin/qiv ]; then 
        /usr/bin/qiv -z /usr/share/mdk/backgrounds/default.png                
    else                                                                      
        /usr/X11R6/bin/xsetroot -solid "#21449C"                              
    fi                                                                        
    ....                                                                      
   
    modified
    ....                                                                     
    if [ -r /usr/share/mdk/backgrounds/flower.jpg -a -x /usr/bin/qiv ]; then 
        /usr/bin/qiv -z /usr/share/mdk/backgrounds/flower.jpg                
    else                                                                     
        /usr/X11R6/bin/xsetroot -solid "#21449C"                             
    fi                                                                       
    ....                                                                     
   
    you can also specify a different background color, with :
    ....                                                                      
    #if [ -r /usr/share/mdk/backgrounds/flower.jpg -a -x /usr/bin/qiv ]; then 
    #    /usr/bin/qiv -z /usr/share/mdk/backgrounds/flower.jpg                
    #else                                                                     
        /usr/X11R6/bin/xsetroot -solid "[your color]"                         
    #fi                                                                       
    ....                                                                      
   
 2. comment out the lines which may affect the primary X server
   
    from
    ....                                                                     
    if [ -x /etc/X11/xinit.d/numlock ]; then                                 
        /etc/X11/xinit.d/numlock &                                           
    fi                                                                       
    ....                                                                     
   
    to
    ....                                                                     
    #if [ -x /etc/X11/xinit.d/numlock ]; then                                
    #    /etc/X11/xinit.d/numlock &                                          
    #fi                                                                      
    ....                                                                     
   
 3. inform xdm about the existence of Xsetup_1 by modify /etc/X11/xdm/
    xdm-config
    ......                                                                   
    ! The following three resources set up display :0 as the console.        
    DisplayManager._0.setup:        /etc/X11/xdm/Xsetup_0                    
    DisplayManager._0.startup:      /etc/X11/xdm/GiveConsole                 
    DisplayManager._0.reset:        /etc/X11/xdm/TakeConsole                 
    DisplayManager._0.startAttempts: 1                                       
    !                                                                        
    ......                                                                   
   
    modified
    ......                                                                   
    ! The following three resources set up display :0 as the console.        
    DisplayManager._1.setup:        /etc/X11/xdm/Xsetup_1                    
    DisplayManager._0.setup:        /etc/X11/xdm/Xsetup_0                    
    DisplayManager._0.startup:      /etc/X11/xdm/GiveConsole                 
    DisplayManager._0.reset:        /etc/X11/xdm/TakeConsole                 
    DisplayManager._0.startAttempts: 1                                       
    !                                                                        
    ......                                                                   
   
 4. repeat the procedure for each additional X server
   
 5. check for additional customizing options
   
    [http://www.linuxjournal.com/article.php?sid=3325] Linux-Journal Issue
    68: Linux Apprentice: Customizing the XDM Login Screen
   

[]
-----------------------------------------------------------------------------

6.2.2. Using kdm

*not really sure
   
    /usr/share/config/kdm/kdmrc
   
    from
    ......                                                                   
    [X-:0-Core]                                                              
    Authorize=true                                                           
    AutoLogin1st=true                                                        
    AutoLoginEnable=false                                                    
    Reset=/etc/X11/xdm/TakeConsole                                           
    Setup=/etc/X11/xdm/Xsetup_0                                              
    Startup=/etc/X11/xdm/GiveConsole                                         
                                                                             
    [X-:1-Core]                                                              
    Authorize=true                                                           
    ......                                                                   
   
    to
    ......                                                                   
    [X-:0-Core]                                                              
    Authorize=true                                                           
    AutoLogin1st=true                                                        
    AutoLoginEnable=false                                                    
    Reset=/etc/X11/xdm/TakeConsole                                           
    Setup=/etc/X11/xdm/Xsetup_0                                              
    Startup=/etc/X11/xdm/GiveConsole                                         
                                                                             
    [X-:1-Core]                                                              
    Authorize=true                                                           
    #AutoLogin1st=true                                                       
    #AutoLoginEnable=false                                                   
    #Reset=/etc/X11/xdm/TakeConsole                                          
    Setup=/etc/X11/xdm/Xsetup_1                                              
    #Startup=/etc/X11/xdm/GiveConsole                                        
                                                                             
    #[X-:1-Core]                                                             
    #Authorize=true                                                          
    ......                                                                   
   
*check for additional customizing options in the kde help center
   
*
     
   
   

-----------------------------------------------------------------------------
6.2.3. Using gdm

this doesn't work on my current setup with gdm-2.4.1.3, the theme overwrites
the background

but it should work on some older 2.0 versions

 1. copy the file /etc/X11/gdm/Init/Default to
   
    /etc/X11/gdm/Init/:0
   
    and /etc/X11/gdm/Init/:1
   
 2. add this lines to use the background which kdm uses
   
    of course you can use another image file as well, just change the full
    path to it
    if [ -r /usr/share/mdk/backgrounds/default.png -a -x /usr/bin/qiv ]; then 
        /usr/bin/qiv -z /usr/share/mdk/backgrounds/default.png                
    else                                                                      
        /usr/X11R6/bin/xsetroot -solid "#21449C"                              
    fi                                                                        
   
    you can also specify a different background color, with :
    /usr/X11R6/bin/xsetroot -solid "[your color]"                            
   
    modified
   
    /etc/X11/gdm/Init/:0
    #!/bin/sh                                                                 
                                                                              
    if [ -r /usr/share/mdk/backgrounds/default.png -a -x /usr/bin/qiv ]; then 
        /usr/bin/qiv -z /usr/share/mdk/backgrounds/default.png                
    else                                                                      
        /usr/X11R6/bin/xsetroot -solid "#21449C"                              
    fi                                                                        
    if [ -x /etc/X11/xinit/fixkeyboard ]; then                                
        /etc/X11/xinit/fixkeyboard                                            
    fi                                                                        
                                                                              
    exit 0                                                                    
   
    /etc/X11/gdm/Init/:1
    #!/bin/sh                                                                
                                                                             
    if [ -r /usr/share/mdk/backgrounds/flower.jpg -a -x /usr/bin/qiv ]; then 
        /usr/bin/qiv -z /usr/share/mdk/backgrounds/flower.jpg                
    else                                                                     
        /usr/X11R6/bin/xsetroot -solid "#21449C"                             
    fi                                                                       
                                                                             
    if [ -x /etc/X11/xinit/fixkeyboard ]; then                               
        /etc/X11/xinit/fixkeyboard                                           
    fi                                                                       
                                                                             
    exit 0                                                                   
   
 3. repeat the procedure for each additional X server, using files /etc/X11/
    gdm/Init/:[n] , where n is the number of the display
   
 4. check for additional customizing options
   
    [http://www.ibiblio.org/oswg/oswg-nightly/oswg/en_US.ISO_8859-1/articles/
    gdm-reference/gdm-reference/] Gnome Display Manager Reference Manual
   

-----------------------------------------------------------------------------
6.3. 1st X server configuration file

a small part of the Mandrake init scripts

( you can append it to yours if you are missing something similar)
----------------------------------------------------------------------------------- 
# (pixel) a kind of profile for XF86Config                                          
# if no XFree=XXX given on kernel command-line, restore XF86Config.standard         
for i in XF86Config XF86Config-4; do                                                
    if [ -L "/etc/X11/$i" ]; then                                                   
        XFree=`sed -n 's/.*XFree=\(\w*\).*/\1/p' /proc/cmdline`                     
        [ -n "$XFree" ] || XFree=standard                                           
        [ -r "/etc/X11/$i.$XFree" ] && ln -sf "$i.$XFree" "/etc/X11/$i"             
    fi                                                                              
done                                                                                
----------------------------------------------------------------------------------- 

move your XF86Config-4 file( the one for standard kernel) to
XF86Config-4.standard, create a link from it to XF86Config-4, move the
XF86Config-4 file(the one for backstreet ruby) to XF86Config-4.bruby. For
ruby/ backstreet ruby kernels add to the append line in /etc/lilo.conf or on
boot prompt XFree=bruby, leave the standard kernel as is.

Results:

booting with "XFree=standard" or without "XFree=" ( boot prompt or lilo.conf)
will result in linking XF86Config-4.standard to XF86Config-4, booting with
"XFree=bruby" will link XF86Config-4.bruby to XF86Config-4, so in both
occasions XFree can be started with the proper configuration file for the
first X server.

And what about the other X servers? :

Well under standard kernel you can not use several independent X servers, so
...

you use the other XFree configuration files only under ruby/ backstreet ruby
-- no need for different configuration files under standard & bruby kernel.
-----------------------------------------------------------------------------

6.4. Number X servers started by Display managers

Well its a modified version of the previous approach:

add this to your init scripts (i bet it is missing :) ) :
--------------------------------------------------------------------------------------- 
#                                                                                       
#the same like XF86Config but for gdm.conf & Xservers                                   
#                                                                                       
for i in xdm/Xservers gdm/gdm.conf; do                                                  
    if [ -L "/etc/X11/$i" ]; then                                                       
        DumbCon=`sed -n 's/.*dumbcon=\([0-9]*\).*/\1/p' /proc/cmdline`                  
        [ -n "$DumbCon" ] || DumbCon=0                                                  
        [ -r "/etc/X11/$i.$DumbCon" ] && ln -sf "/etc/X11/$i.$DumbCon" "/etc/X11/$i"    
    fi                                                                                  
done                                                                                    
echo "Setting up display managers for `expr $DumbCon + 1` Xservers"                     
--------------------------------------------------------------------------------------- 

it will adjust the proper /etc/X11/xdm/Xservers & /etc/X11/gdm/gdm.config
according to the boot line argument dumbcon=n ( remember n+1= number of X
users/sessions)

you have to create the configuration files following this assumptions:

"i" stays for "/etc/X11/xdm/Xserver" and "/etc/X11/gdm/gdm.conf"

*i.0 is used for a single X server, when dumbcon=n is not specified, or
    dumbcon=0
   
*i.1 is used by the display manager when dumbcon=1 is specified
   
*i.2 is used by the display manager when dumbcon=2 is specified
   
*i.3 is used by the display manager when dumbcon=3 is specified
   

and so on ..

so :

*i.0 should contain the definition only of your original standard X
    server,
   
*i.1 should contain the definitions for 2 X servers
   
*i.2 should contain the definitions for 3 X servers
   
*.......
   

so if you boot without dumbcon=n or with dumbcon=0 (for example a standard
kernel), your display manager will start a single X server with the
corresponding XF86Config file,

if you start with dumbcon=1 the display manager will start automatically 2 X
servers,

if you start with dumbcon=2 when booting is finished you'll get 3 login
prompts on your 3 displays.

Have in mind that each X server should have it's own configuration file, and
it should be specified in the display manager configuration file properly --
take a look at the configuration files before restarting with activated
display manager and this addition to your init scripts.
-----------------------------------------------------------------------------

6.5. Dynamically switching the number of X servers

There is a very experimental GUI / CLI for dynamically switching the number
of running X servers. It uses the previously mentioned in section 6.2
automatic configuration of the display managers, python, dialog for the CLI,
and Xdialog for the GUI.

Once it gets a bit more tested and bug-free, you could use it under
backstreet ruby for example to switch between 2, 3 or more X servers and a
single X server using Xinerama, so when your PC is not used by more then one
user, you could use the other monitors under Xinerama, or one more funny
example : your are simulating net gaming with a number of friends on your
bruby Linux PC, you have invested a bit more in an additional graphic card
which is already configured, but you don't have enough money right now to buy
one more monitor and keyboard/mice pair. One friend of yours comes and says "
Hey guys, that's cool. Can i join? " . What would you answer? Using the GUI
could result in the following answer from your side: "No problem, just bring
your monitor and keyboard/mice."

If you are feeling hacker and want to try out this BUGGY GUI/ CLI check the
current status here : [http://varna.demon.co.uk/~svetlio/ruby-contrib/
bruby-python/] http://varna.demon.co.uk/~svetlio/ruby-contrib/bruby-python/

but remember it's not very tested, and if not configured properly it can
cause you serious troubles, so please wait till it gets stable if your
feeling not that familiar with Linux. If you feel comfortable under Linux,
and think of you as a hacker, please help in testing it and making it better,
bug-free, easy to configure.

-----------------------------------------------------------------------------
Chapter 7. Known problems

7.1. Hardware problems

Well not exactly problems, but some graphic cards do not work well, or even
at all in multi-user environment.

If you are building such system from the begging, check the video
compatibility list before buying video hardware.
-----------------------------------------------------------------------------

7.2. Software problems

for details on solving the problems see the following chapter "Special notes
on some distributions"
-----------------------------------------------------------------------------

7.2.1. Incompatible userspace programs

 1. gpm: freezy mouse under XFree86. With current XFree86 you are losing VGA
    virtual consoles any way
   
    Recommended disable.
   
 2. RedHat 8.0/ 9, SuSE 8.1 - /bin/sysfont:
   
    You can use redhat 7.3 consolechars instead.
   
 3. SuSE 8.1 - /etc/init.d/hwscan:
   
    recommended disable, if you have to install new hardware and want to use
    it
   
    boot with standard kernel and start it manually
   

-----------------------------------------------------------------------------
7.2.2. Tweaks needed

 1. Mandrake 9.1 - /etc/init.d/numlock:
   
    You should change the lines including "/dev/tty[0-8]" to " /dev/tty[0-7]"
   
 2. SuSE 8.1 - /etc/init.d/kbd:
   

-----------------------------------------------------------------------------
Chapter 8. Special notes on some distributions

8.1. Mandrake

well almost everything is easy to accomplish

(probably because i use it since 2-3 years at least)

 1. just the small tweak in /etc/init.d/numlock
    --- /etc/init.d/numlock.orig    2003-04-11 00:58:55.000000000 +0200      
    +++ /etc/init.d/numlock 2003-03-19 13:03:30.000000000 +0100              
    @@ -21,14 +21,14 @@                                                      
            echo                                                             
            touch $SYSCONF_FILE                                              
                                                                             
    -       for tty in /dev/tty[0-8]; do                                     
    +       for tty in /dev/tty[0-7]; do                                     
                    setleds -D +num < $tty                                   
            done                                                             
                                                                             
            ;;                                                               
       stop)                                                                 
            gprintf "Disabling numlocks on ttys: "                           
    -       for tty in /dev/tty[0-8]; do                                     
    +       for tty in /dev/tty[0-7]; do                                     
                    setleds -D -num < $tty                                   
            done                                                             
            echo_success                                                     
   

-----------------------------------------------------------------------------
8.2. Red Hat

 1. replacing sysfont with consolechars
   
    < needs to be written >
   
    rebuild console-tools-19990829-40.src.rpm using :
   
    rpmbuild --rebuild console-tools-19990829-40.src.rpm
   
    ( you can find the source rpm on rpmfind.net)
   
    and then install it:
   
    rpm -Uvh /usr/src/redhat/RPMS/i386/console-tools-19990829-40.i386.rpm
   
    i still seem to have some kind of problem, because i get all the time on
    console:
   
    findfont no such file or directory unable to setfont xxx
   
    but the everything else seems OK.
   

-----------------------------------------------------------------------------
8.3. Debian

< needs to be written >

< no reports yet, i should ask Andreas >
-----------------------------------------------------------------------------

8.4. SuSE

 1. /etc/init.d/kbd
   
    add this line in the very beginning of the file
    KBD_TTY="tty0 tty2 tty3 tty4 tty5 tty6 tty7"                             
   
    after modifications
    #! /bin/sh                                                                
    # Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany.                   
    #                                                                         
    # Author:   Burchard Steinbild <bs@suse.de>                               
    #           Werner Fink <werner@suse.de>                                  
    #                                                                         
    # /etc/init.d/kbd                                                         
    #                                                                         
    #   and symbolic its link                                                 
    #                                                                         
    # /sbin/rckbd                                                             
    #                                                                         
    ### BEGIN INIT INFO                                                       
    # Provides:       kbd                                                     
    # Required-Start: $remote_fs                                              
    # Required-Stop:                                                          
    # X-SuSE-Should-Start:  fbset serial                                      
    # X-SuSE-Should-Stop:                                                     
    # Default-Start:  1 2 3 5 S                                               
    # Default-Stop:                                                           
    # Description:    Keyboard settings (don't disable!)                      
    ### END INIT INFO                                                         
                                                                              
    . /etc/rc.status                                                          
    . /etc/sysconfig/console                                                  
    . /etc/sysconfig/keyboard                                                 
                                                                              
    MACHINE=`/bin/uname -m 2> /dev/null`                                      
    if [ "$MACHINE" = "sparc" -o "$MACHINE" = "sparc64" ]; then               
       # Test if we have a serial console.                                    
       (test -c /dev/tty1 && > /dev/tty1 ) > /dev/null 2>&1 || exit 0         
    fi                                                                        
                                                                              
    # The variable NON_SUSE_KERNEL determines whether we need to chvt         
    # to a console before some console settings apply.                        
    # We have no magic to find out about this (at boot time), so we           
    # leave it to the user to read this comment and put NON_SUSE_KERNEL="yes" 
    # into /etc/sysconfig/console                                             
                                                                              
    KBDBASE="/usr/share/kbd"                                                  
                                                                              
    KBD_TTY="tty0 tty2 tty3 tty4 tty5 tty6 tty7"                              
    KTABLE=${KEYTABLE%.map*}                                                  
    KTABLE=${KTABLE##*/}                                                      
    #                                                                         
    # first search the wanted keytable.                                       
    #                                                                         
    if [ $MACHINE = ppc -o $MACHINE = ppc64 ]; then                           
            test -f /proc/cpuinfo || mount -n -t proc proc /proc 2>/dev/null  
            while read line; do                                               
    ......                                                                    
    ......                                                                    
   
 2. replacing sysfont with consolechars
   
    < needs to be written >
   
    actually might not be needed,
   
    modifying /etc/init.d/kbd solves the problem for me
   
 3. hwscan causes problems some time
   
    recommended disable, if you have to install new hardware and want to use
    it
   
    boot with standard kernel and start it manually
   

-----------------------------------------------------------------------------
8.5. xxx specific parts/ problems/ solutions

< needs to be written >
-----------------------------------------------------------------------------

Chapter 9. Final words

You really got to the end? :)

or just used the link? :(

 

Have some comments?

-- send them to Svetoslav Slavtchev<galia (at) st-peter.stw.uni-erlangen.de>

Got troubles understanding the How-To? Some parts are not clear?

-- drop a line to the above address

Got problems configuring your system to run multiple independent X sessions,
using this How-To?

-- send your problems to the above address

You got it running !!! Congratulations !!!

-- drop a line, give some details on your configuration and attach your XFree
configuration files.
-----------------------------------------------------------------------------

Appendix A. Video compatibility list

this is a extract from the video compatibility list at the bruby home page
-----------------------------------------------------------------------------

A.1. Graphic card pairs/ triples/ ... which work perfectly

A.1.1. Modified X server not needed

Voodoo Graphics (glide) + Voodoo 3 (pci)(tdfx)

Voodoo Graphics (glide) + Riva TNT2 M64 (agp)(nvidia)

-----------------------------------------------------------------------------
A.1.2. Modified X server needed

ATI Radeon 7000(AGP)+ Matrox Mystique (PCI)

AGP S3 Inc. 86c368[Trio 3D/2X]+Matrox MGA1064SG[Mystique] (PCI)

Nvidia cards

Riva TNT (PCI+PCI+AGP)

Riva TNT2 M64 (pci)(nvidia) + Riva TNT2 M64 (pci)(nvidia)

Nvidia GeForce2MX(PCI)+GeForce2MX(PCI)+GeForce2MX(PCI)+GeForce2MX(PCI)

Works fine. DRI + Nvidia GLX works too.

Voodoo 3 (pci)(tdfx) + Riva TNT2 M64 (agp)(nvidia)

ATI Radeon 7500(AGP) + Nvidia TNT2(PCI)
-----------------------------------------------------------------------------

A.2. Graphic card pairs/ triples/ ... which work, but there are some glitches

*Generaly the X server driving the AGP card have to be started first
   
*AGP sever restart leads to system crash. Set in gdm.conf
    AllwaysRestartServer=false
   
*the new X server patch (XFree-4.3-prefbusid) fixes most of the problems
   
    the first and the last combination are reported to work without major
    problems with XFree86-prefbusid
   

Nividia GeForce4MX440(AGP)+TNT2M64(PCI)+TNT2M64(PCI)

Matrox MGAG400(AGP)+Matrox MGA1064SG[Mystique]PCI

Matrox MGAG550DH(AGP)+Riva TNTM64(PCI)

Matrox MGAG550DH(AGP)+Geforce4 420(PCI)
-----------------------------------------------------------------------------

Appendix B. Example configuration files

for more examples visit:

[http://varna.demon.co.uk/~svetlio/examples/] http://varna.demon.co.uk/
~svetlio/examples/
-----------------------------------------------------------------------------

B.1. XFree86

-----------------------------------------------------------------------------
B.1.1. 1st XFree server configuration file

# File generated by XFdrake.                                                        
                                                                                    
# **********************************************************************            
# Refer to the XF86Config(4/5) man page for details about the format of             
# this file.                                                                        
# **********************************************************************            
                                                                                    
Section "Files"                                                                     
                                                                                    
    RgbPath     "/usr/X11R6/lib/X11/rgb"                                            
                                                                                    
# Multiple FontPath entries are allowed (they are concatenated together)            
# By default, Mandrake 6.0 and later now use a font server independent of           
# the X server to render fonts.                                                     
                                                                                    
                                                                                    
EndSection                                                                          
                                                                                    
# **********************************************************************            
# Server flags section.                                                             
# **********************************************************************            
                                                                                    
Section "ServerFlags"                                                               
                                                                                    
    # Uncomment this to cause a core dump at the spot where a signal is             
    # received.  This may leave the console in an unusable state, but may           
    # provide a better stack trace in the core dump to aid in debugging             
    #NoTrapSignals                                                                  
                                                                                    
    # Uncomment this to disable the <Crtl><Alt><BS> server abort sequence           
    # This allows clients to receive this key event.                                
    #DontZap                                                                        
                                                                                    
    # Uncomment this to disable the <Crtl><Alt><KP_+>/<KP_-> mode switching         
    # sequences.  This allows clients to receive these key events.                  
    #DontZoom                                                                       
                                                                                    
    # This  allows  the  server  to start up even if the                            
    # mouse device can't be opened/initialised.                                     
    AllowMouseOpenFail                                                              
                                                                                    
EndSection                                                                          
                                                                                    
# **********************************************************************            
# Input devices                                                                     
# **********************************************************************            
                                                                                    
# **********************************************************************            
# Keyboard section                                                                  
# **********************************************************************            
                                                                                    
Section "InputDevice"                                                               
                                                                                    
    Identifier "Keyboard1"                                                          
    Driver      "Keyboard"                                                          
    Option "AutoRepeat"  "250 30"                                                   
                                                                                    
    Option "XkbRules" "xfree86"                                                     
    Option "XkbModel" "pc105"                                                       
    Option "XkbLayout" "de(nodeadkeys)"                                             
                                                                                    
EndSection                                                                          
                                                                                    
# **********************************************************************            
# Pointer section                                                                   
# **********************************************************************            
                                                                                    
Section "InputDevice"                                                               
                                                                                    
    Identifier  "Mouse1"                                                            
    Driver      "mouse"                                                             
    Option "Protocol"    "IMPS/2"                                                   
#    Option "Device"      "/dev/psaux"                                              
    Option "Device"      "/dev/input/mouse1"                                        
    Option "ZAxisMapping" "4 5"                                                     
                                                                                    
# ChordMiddle is an option for some 3-button Logitech mice                          
    Option "Emulate3Buttons"                                                        
#    Option "ChordMiddle"                                                           
                                                                                    
EndSection                                                                          
                                                                                    
                                                                                    
                                                                                    
Section "Module"                                                                    
                                                                                    
# This loads the DBE extension module.                                              
    Load        "dbe"                                                               
    Load        "GLcore"                                                            
#    Load       "dga"                                                               
    Load        "glx"                                                               
    Load        "extmod"                                                            
    Load        "dri"                                                               
# pass two from mga mailing-lists                                                   
#    Load       "pex5"                                                              
#    Load       "xie"                                                               
    Load        "bitmap"                                                            
    Load        "record"                                                            
    Load        "vbe"                                                               
    Load        "int10"                                                             
# end pass two mga mailing-lists                                                    
                                                                                    
                                                                                    
# This loads the Video for Linux module.                                            
    Load        "v4l"                                                               
                                                                                    
                                                                                    
# This loads the miscellaneous extensions module, and disables                      
# initialisation of the XFree86-DGA extension within that module.                   
                                                                                    
    SubSection  "extmod"                                                            
        #Option "omit xfree86-dga"                                                  
    EndSubSection                                                                   
                                                                                    
# This loads the Type1 and FreeType font modules                                    
                                                                                    
    Load        "type1"                                                             
    Load        "freetype"                                                          
EndSection                                                                          
                                                                                    
Section "DRI"                                                                       
    Mode        0666                                                                
EndSection                                                                          
                                                                                    
# **********************************************************************            
# Monitor section                                                                   
# **********************************************************************            
                                                                                    
# Any number of monitor sections may be present                                     
                                                                                    
Section "Monitor"                                                                   
    Identifier "Generic|Monitor that can do 1600x1200 at 70 Hz"                     
    VendorName "Unknown"                                                            
    ModelName  "Unknown"                                                            
                                                                                    
                                                                                    
# HorizSync is in kHz unless units are specified.                                   
# HorizSync may be a comma separated list of discrete values, or a                  
# comma separated list of ranges of values.                                         
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY.  REFER TO YOUR MONITOR'S                 
# USER MANUAL FOR THE CORRECT NUMBERS.                                              
    HorizSync  30-98                                                                
                                                                                    
                                                                                    
# VertRefresh is in Hz unless units are specified.                                  
# VertRefresh may be a comma separated list of discrete values, or a                
# comma separated list of ranges of values.                                         
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY.  REFER TO YOUR MONITOR'S                 
# USER MANUAL FOR THE CORRECT NUMBERS.                                              
    VertRefresh 50-160                                                              
                                                                                    
                                                                                    
# This is a set of extended mode timings typically used for laptop,                 
# TV fullscreen mode or DVD fullscreen output.                                      
# These are available along with standard mode timings.                             
                                                                                    
# Sony Vaio C1(X,XS,VE,VN)?                                                         
# 1024x480 @ 85.6 Hz, 48 kHz hsync                                                  
ModeLine "1024x480"    65.00 1024 1032 1176 1344   480  488  494  563 -hsync -vsync 
                                                                                    
# 768x576 @ 79 Hz, 50 kHz hsync                                                     
ModeLine "768x576"     50.00  768  832  846 1000   576  590  595  630               
# 768x576 @ 100 Hz, 61.6 kHz hsync                                                  
ModeLine "768x576"     63.07  768  800  960 1024   576  578  590  616               
                                                                                    
                                                                                    
EndSection                                                                          
                                                                                    
                                                                                    
Section "Monitor"                                                                   
    Identifier "monitor2"                                                           
    VendorName "Unknown"                                                            
    ModelName  "Unknown"                                                            
                                                                                    
    HorizSync   30-98                                                               
    VertRefresh 50-160                                                              
EndSection                                                                          
                                                                                    
                                                                                    
Section "Monitor"                                                                   
    Identifier "monitor3"                                                           
    VendorName "Unknown"                                                            
    ModelName  "Unknown"                                                            
                                                                                    
    HorizSync   31.5-60.0                                                           
    VertRefresh 56.0-75.0                                                           
EndSection                                                                          
                                                                                    
                                                                                    
                                                                                    
# **********************************************************************            
# Graphics device section                                                           
# **********************************************************************            
                                                                                    
Section "Device"                                                                    
    Identifier "Generic VGA"                                                        
    Driver     "vga"                                                                
EndSection                                                                          
                                                                                    
                                                                                    
Section "Device"                                                                    
    Identifier  "g550_1"                                                            
    VendorName  ""                                                                  
    BoardName   ""                                                                  
    Driver      "mga"                                                               
    # Clock lines                                                                   
                                                                                    
                                                                                    
    # Uncomment following option if you see a big white block                       
    # instead of the cursor!                                                        
    #    Option      "sw_cursor"                                                    
    Option      "AGPMode" "4"                                                       
#    Option      "HWCursor" "Off"                                                   
    Option      "HWCursor" "On"                                                     
    Option      "MGASDRAM" "On"                                                     
    Option      "DPMS"  "Off"                                                       
    # Screen 0                                                                      
    BusID       "PCI:1:0:0"                                                         
EndSection                                                                          
                                                                                    
                                                                                    
Section "Device"                                                                    
    Identifier  "g550_2"                                                            
    VendorName  ""                                                                  
    BoardName   ""                                                                  
    Driver      "mga"                                                               
    # Clock lines                                                                   
                                                                                    
                                                                                    
    # Uncomment following option if you see a big white block                       
    # instead of the cursor!                                                        
    #    Option      "sw_cursor"                                                    
    Option      "AGPMode" "4"                                                       
    Option      "MGASDRAM" "On"                                                     
#    Option      "HWCursor" "Off"                                                   
    Option      "HWCursor" "On"                                                     
    Option      "DPMS"  "Off"                                                       
    # Screen 1                                                                      
    BusID       "PCI:1:0:0"                                                         
EndSection                                                                          
                                                                                    
                                                                                    
                                                                                    
# **********************************************************************            
# Screen sections                                                                   
# **********************************************************************            
                                                                                    
Section "Screen"                                                                    
    Identifier "screen1"                                                            
    Device      "g550_1"                                                            
    Monitor     "monitor2"                                                          
    DefaultColorDepth 16                                                            
    Subsection "Display"                                                            
        Depth       8                                                               
        Modes       "1280x1024" "1024x768" "800x600" "640x480"                      
        ViewPort    0 0                                                             
    EndSubsection                                                                   
    Subsection "Display"                                                            
        Depth       15                                                              
        Modes       "1280x1024" "1024x768" "800x600" "640x480"                      
        ViewPort    0 0                                                             
    EndSubsection                                                                   
    Subsection "Display"                                                            
        Depth       16                                                              
        Modes       "1280x1024" "1024x768" "800x600" "640x480"                      
        ViewPort    0 0                                                             
    EndSubsection                                                                   
    Subsection "Display"                                                            
        Depth       24                                                              
        Modes       "1280x1024" "1024x768" "800x600" "640x480"                      
        ViewPort    0 0                                                             
    EndSubsection                                                                   
EndSection                                                                          
                                                                                    
                                                                                    
Section "ServerLayout"                                                              
    Identifier "layout1"                                                            
    Screen     "screen1"                                                            
                                                                                    
    InputDevice "Mouse1" "CorePointer"                                              
    InputDevice "Keyboard1" "CoreKeyboard"                                          
EndSection                                                                          
-----------------------------------------------------------------------------

B.1.2. 2nd XFree server configuration file

# File generated by XFdrake.                                                        
                                                                                    
# **********************************************************************            
# Refer to the XF86Config(4/5) man page for details about the format of             
# this file.                                                                        
# **********************************************************************            
                                                                                    
Section "Files"                                                                     
                                                                                    
    RgbPath     "/usr/X11R6/lib/X11/rgb"                                            
    ModulePath  "/usr/X11R6/libNV/modules"                                          
# Multiple FontPath entries are allowed (they are concatenated together)            
# By default, Mandrake 6.0 and later now use a font server independent of           
# the X server to render fonts.                                                     
                                                                                    
                                                                                    
EndSection                                                                          
                                                                                    
# **********************************************************************            
# Server flags section.                                                             
# **********************************************************************            
                                                                                    
Section "ServerFlags"                                                               
                                                                                    
    # Uncomment this to cause a core dump at the spot where a signal is             
    # received.  This may leave the console in an unusable state, but may           
    # provide a better stack trace in the core dump to aid in debugging             
    #NoTrapSignals                                                                  
                                                                                    
    # Uncomment this to disable the <Crtl><Alt><BS> server abort sequence           
    # This allows clients to receive this key event.                                
    #DontZap                                                                        
                                                                                    
    # Uncomment this to disable the <Crtl><Alt><KP_+>/<KP_-> mode switching         
    # sequences.  This allows clients to receive these key events.                  
    #DontZoom                                                                       
                                                                                    
    # This  allows  the  server  to start up even if the                            
    # mouse device can't be opened/initialised.                                     
    AllowMouseOpenFail                                                              
                                                                                    
EndSection                                                                          
                                                                                    
# **********************************************************************            
# Input devices                                                                     
# **********************************************************************            
                                                                                    
# **********************************************************************            
# Keyboard section                                                                  
# **********************************************************************            
                                                                                    
Section "InputDevice"                                                               
                                                                                    
    Identifier "Keyboard1"                                                          
    Driver      "Keyboard"                                                          
    Option "AutoRepeat"  "250 30"                                                   
                                                                                    
    Option "XkbRules" "xfree86"                                                     
    Option "XkbModel" "pc105"                                                       
    Option "XkbLayout" "de(nodeadkeys)"                                             
                                                                                    
EndSection                                                                          
                                                                                    
# **********************************************************************            
# Pointer section                                                                   
# **********************************************************************            
                                                                                    
Section "InputDevice"                                                               
                                                                                    
    Identifier  "Mouse1"                                                            
    Driver      "mouse"                                                             
    Option "Protocol"    "PS/2"                                                     
    Option "Device"      "/dev/input/mouse0"                                        
    Option "Emulate3Buttons"                                                        
#    Option "ZAxisMapping" "4 5"                                                    
                                                                                    
# ChordMiddle is an option for some 3-button Logitech mice                          
                                                                                    
#    Option "ChordMiddle"                                                           
                                                                                    
EndSection                                                                          
                                                                                    
                                                                                    
Section "Module"                                                                    
                                                                                    
# This loads the DBE extension module.                                              
    Load        "dbe"                                                               
    Load        "glx"                                                               
    Load        "vbe"                                                               
    Load        "int10"                                                             
                                                                                    
# This loads the Video for Linux module.                                            
#    Load        "v4l"                                                              
                                                                                    
                                                                                    
# This loads the miscellaneous extensions module, and disables                      
# initialisation of the XFree86-DGA extension within that module.                   
                                                                                    
    SubSection  "extmod"                                                            
        #Option "omit xfree86-dga"                                                  
    EndSubSection                                                                   
                                                                                    
# This loads the Type1 and FreeType font modules                                    
                                                                                    
    Load        "type1"                                                             
    Load        "freetype"                                                          
EndSection                                                                          
                                                                                    
#Section "DRI"                                                                      
#    Mode       0666                                                                
#EndSection                                                                         
                                                                                    
# **********************************************************************            
# Monitor section                                                                   
# **********************************************************************            
                                                                                    
# Any number of monitor sections may be present                                     
                                                                                    
Section "Monitor"                                                                   
    Identifier "Generic|Monitor that can do 1600x1200 at 70 Hz"                     
    VendorName "Unknown"                                                            
    ModelName  "Unknown"                                                            
                                                                                    
                                                                                    
# HorizSync is in kHz unless units are specified.                                   
# HorizSync may be a comma separated list of discrete values, or a                  
# comma separated list of ranges of values.                                         
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY.  REFER TO YOUR MONITOR'S                 
# USER MANUAL FOR THE CORRECT NUMBERS.                                              
    HorizSync  30-98                                                                
                                                                                    
                                                                                    
# VertRefresh is in Hz unless units are specified.                                  
# VertRefresh may be a comma separated list of discrete values, or a                
# comma separated list of ranges of values.                                         
# NOTE: THE VALUES HERE ARE EXAMPLES ONLY.  REFER TO YOUR MONITOR'S                 
# USER MANUAL FOR THE CORRECT NUMBERS.                                              
    VertRefresh 50-160                                                              
                                                                                    
                                                                                    
# This is a set of extended mode timings typically used for laptop,                 
# TV fullscreen mode or DVD fullscreen output.                                      
# These are available along with standard mode timings.                             
                                                                                    
# Sony Vaio C1(X,XS,VE,VN)?                                                         
# 1024x480 @ 85.6 Hz, 48 kHz hsync                                                  
ModeLine "1024x480"    65.00 1024 1032 1176 1344   480  488  494  563 -hsync -vsync 
                                                                                    
# 768x576 @ 79 Hz, 50 kHz hsync                                                     
ModeLine "768x576"     50.00  768  832  846 1000   576  590  595  630               
# 768x576 @ 100 Hz, 61.6 kHz hsync                                                  
ModeLine "768x576"     63.07  768  800  960 1024   576  578  590  616               
                                                                                    
                                                                                    
EndSection                                                                          
                                                                                    
                                                                                    
Section "Monitor"                                                                   
    Identifier "monitor2"                                                           
    VendorName "Unknown"                                                            
    ModelName  "Unknown"                                                            
                                                                                    
#    HorizSync   30-98                                                              
#    VertRefresh 50-160                                                             
                                                                                    
    HorizSync   30-50                                                               
    VertRefresh 50-120                                                              
EndSection                                                                          
                                                                                    
                                                                                    
                                                                                    
# **********************************************************************            
# Graphics device section                                                           
# **********************************************************************            
                                                                                    
Section "Device"                                                                    
    Identifier "Generic VGA"                                                        
    Driver     "vga"                                                                
EndSection                                                                          
                                                                                    
Section "Device"                                                                    
    Identifier  "nv"                                                                
    VendorName  ""                                                                  
    BoardName   ""                                                                  
    Driver      "nvidia"                                                            
    # Clock lines                                                                   
                                                                                    
                                                                                    
    # Uncomment following option if you see a big white block                       
    # instead of the cursor!                                                        
    #    Option      "sw_cursor"                                                    
    Option      "UseInt10Module" "off"                                              
    Option      "ConnectedMonitor" "CRT"                                            
    Option      "IgnoreEDID" "off"                                                  
    Option      "HWCursor" "on"                                                     
                                                                                    
    Option      "DPMS"  "Off"                                                       
    Option      "NoLogo" "On"                                                       
    BusID       "PCI:0:10:0"                                                        
EndSection                                                                          
                                                                                    
                                                                                    
# **********************************************************************            
# Screen sections                                                                   
# **********************************************************************            
                                                                                    
Section "Screen"                                                                    
    Identifier "screen1"                                                            
    Device      "nv"                                                                
    Monitor     "monitor2"                                                          
    DefaultColorDepth 24                                                            
    Subsection "Display"                                                            
        Depth       8                                                               
        Modes       "800x600" "640x480"                                             
        ViewPort    0 0                                                             
    EndSubsection                                                                   
    Subsection "Display"                                                            
        Depth       15                                                              
        Modes       "800x600" "640x480"                                             
        ViewPort    0 0                                                             
    EndSubsection                                                                   
    Subsection "Display"                                                            
        Depth       16                                                              
        Modes       "800x600" "640x480"                                             
        ViewPort    0 0                                                             
    EndSubsection                                                                   
    Subsection "Display"                                                            
        Depth       24                                                              
        Modes       "1024x768" "800x600" "640x480"                                  
        ViewPort    0 0                                                             
    EndSubsection                                                                   
    Subsection "Display"                                                            
        Depth       32                                                              
        Modes       "1280x1024" "800x600" "640x480"                                 
        ViewPort    0 0                                                             
    EndSubsection                                                                   
EndSection                                                                          
                                                                                    
                                                                                    
Section "ServerLayout"                                                              
    Identifier "layout1"                                                            
    Screen     "screen1"                                                            
                                                                                    
    InputDevice "Mouse1" "CorePointer"                                              
                                                                                    
    InputDevice "Keyboard1" "CoreKeyboard"                                          
                                                                                    
EndSection                                                                          
-----------------------------------------------------------------------------

B.2. Display managers

-----------------------------------------------------------------------------
B.2.1. xdm and kdm

/etc/X11/xdm/Xservers.0
# $XConsortium: Xserv.ws.cpp,v 1.3 93/09/28 14:30:30 gildea Exp $                                
#                                                                                                
#                                                                                                
# $XFree86: xc/programs/xdm/config/Xserv.ws.cpp,v 1.1.1.1.12.2 1998/10/04 15:23:14 hohndel Exp $ 
#                                                                                                
# Xservers file, workstation prototype                                                           
#                                                                                                
# This file should contain an entry to start the server on the                                   
# local display; if you have more than one display (not screen),                                 
# you can add entries to the list (one per line).  If you also                                   
# have some X terminals connected which do not support XDMCP,                                    
# you can add them here as well.  Each X terminal line should                                    
# look like:                                                                                     
#       XTerminalName:0 foreign                                                                  
#                                                                                                
:0 local /bin/nice -n -10 /usr/X11R6/bin/X -deferglyphs 16                                       

/etc/X11/xdm/Xservers.1
# $XConsortium: Xserv.ws.cpp,v 1.3 93/09/28 14:30:30 gildea Exp $                                       
#                                                                                                       
#                                                                                                       
# $XFree86: xc/programs/xdm/config/Xserv.ws.cpp,v 1.1.1.1.12.2 1998/10/04 15:23:14 hohndel Exp $        
#                                                                                                       
# Xservers file, workstation prototype                                                                  
#                                                                                                       
# This file should contain an entry to start the server on the                                          
# local display; if you have more than one display (not screen),                                        
# you can add entries to the list (one per line).  If you also                                          
# have some X terminals connected which do not support XDMCP,                                           
# you can add them here as well.  Each X terminal line should                                           
# look like:                                                                                            
#       XTerminalName:0 foreign                                                                         
#                                                                                                       
:0 local /bin/nice -n -10 /usr/X11R6/bin/X0 :0 -deferglyphs 16 vt7                                      
:1 local /bin/nice -n -10 /usr/X11R6/bin/X1 :1 -xf86config /etc/X11/XF86Config-4.X1 -deferglyphs 16 vt9 

not really used by me

/etc/X11/xdm/Xservers.2
# $XConsortium: Xserv.ws.cpp,v 1.3 93/09/28 14:30:30 gildea Exp $                                        
#                                                                                                        
#                                                                                                        
# $XFree86: xc/programs/xdm/config/Xserv.ws.cpp,v 1.1.1.1.12.2 1998/10/04 15:23:14 hohndel Exp $         
#                                                                                                        
# Xservers file, workstation prototype                                                                   
#                                                                                                        
# This file should contain an entry to start the server on the                                           
# local display; if you have more than one display (not screen),                                         
# you can add entries to the list (one per line).  If you also                                           
# have some X terminals connected which do not support XDMCP,                                            
# you can add them here as well.  Each X terminal line should                                            
# look like:                                                                                             
#       XTerminalName:0 foreign                                                                          
#                                                                                                        
:0 local /bin/nice -n -10 /usr/X11R6/bin/X0 :0 -deferglyphs 16 vt7                                       
:1 local /bin/nice -n -10 /usr/X11R6/bin/X1 :1 -xf86config /etc/X11/XF86Config-4.X1 -deferglyphs 16 vt9  
:2 local /bin/nice -n -10 /usr/X11R6/bin/X2 :2 -xf86config /etc/X11/XF86Config-4.X2 -deferglyphs 16 vt17 
-----------------------------------------------------------------------------

B.2.2. gdm

/etc/X11/gdm/gdm.conf.0
# GDM Configuration file.  You can use gdmsetup program to graphically                           
# edit this, or you can optionally just edit this file by hand.  Note that                       
# gdmsetup does not tweak every option here, just the ones most users                            
# would care about.  Rest is for special setups and distro specific                              
# tweaks.  If you edit this file, you should send the HUP or USR1 signal to                      
# the daemon so that it restarts: (Assuming you have not changed PidFile)                        
#   kill -USR1 `cat /var/run/gdm.pid`                                                            
# (HUP will make gdm restart immediately while USR1 will make gdm not kill                       
# existing sessions and will only restart gdm after all users log out)                           
#                                                                                                
# You can also use the gdm-restart and gdm-safe-restart scripts which just                       
# do the above for you.                                                                          
#                                                                                                
# Have fun! - George                                                                             
                                                                                                 
[daemon]                                                                                         
# Automatic login, if true the first local screen will automatically logged                      
# in as user as set with AutomaticLogin key.                                                     
AutomaticLoginEnable=false                                                                       
AutomaticLogin=                                                                                  
# Timed login, useful for kiosks.  Log in a certain user after a certain                         
# amount of time                                                                                 
TimedLoginEnable=false                                                                           
TimedLogin=                                                                                      
TimedLoginDelay=30                                                                               
# A comma separated list of users that will be logged in without having                          
# to authenticate on local screens (not over xdmcp).  Note that 'root'                           
# is ignored and will always have to authenticate.                                               
LocalNoPasswordUsers=                                                                            
# If you are having trouble with using a single server for a long time and                       
# want gdm to kill/restart the server, turn this on                                              
AlwaysRestartServer=false                                                                        
# The gdm configuration program that is run from the login screen, you should                    
# probably leave this alone                                                                      
Configurator=/usr/sbin/gdmsetup --disable-sound --disable-crash-dialog                           
GnomeDefaultSession=/usr/share/gnome/default.session                                             
# The chooser program.  Must output the chosen host on stdout, probably you                      
# should leave this alone                                                                        
Chooser=/usr/bin/gdmchooser                                                                      
# Default path to set.  The profile scripts will likely override this                            
DefaultPath=/bin:/usr/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/bin:/usr/bin                    
# Default path for root.  The profile scripts will likely override this                          
RootPath=/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/bin:/usr/bin       
DisplayInitDir=/etc/X11/gdm/Init                                                                 
# Greeter for local (non-xdmcp) logins.  Change gdmlogin to gdmgreeter to                        
# get the new graphical greeter.                                                                 
Greeter=/usr/bin/gdmgreeter                                                                      
# Greeter for xdmcp logins, usually you want a less graphically intensive                        
# greeter here so it's better to leave this with gdmlogin                                        
RemoteGreeter=/usr/bin/gdmlogin                                                                  
# User and group that gdm should run as.  Probably should be gdm and gdm and                     
# you should create these user and group.  Anyone found running this as                          
# someone too privilaged will get a kick in the ass.  This should have                           
# access to only the gdm directories and files.                                                  
User=gdm                                                                                         
Group=gdm                                                                                        
# To try to kill all clients started at greeter time or in the Init script.                      
# doesn't always work, only if those clients have a window of their own                          
KillInitClients=true                                                                             
LogDir=/var/lib/gdm                                                                              
# You should probably never change this value unless you have a weird setup                      
PidFile=/var/run/gdm.pid                                                                         
PostSessionScriptDir=/etc/X11/gdm/PostSession/                                                   
PreSessionScriptDir=/etc/X11/gdm/PreSession/                                                     
# Distributions:  If you have some script that runs an X server in say                           
# VGA mode, allowing a login, could you please send it to me?                                    
FailsafeXServer=                                                                                 
# if X keeps crashing on us we run this script.  The default one does a bunch                    
# of cool stuff to figure out what to tell the user and such and can                             
# run an X configuration program.                                                                
XKeepsCrashing=/etc/X11/gdm/XKeepsCrashing                                                       
# Reboot, Halt and suspend commands, you can add different commands                              
# separated by a semicolon and gdm will use the first one it can find                            
RebootCommand=/sbin/shutdown -r now;/usr/sbin/shutdown -r now                                    
HaltCommand=/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now     
SuspendCommand=                                                                                  
# Probably should not touch the below this is the standard setup                                 
ServAuthDir=/var/lib/gdm                                                                         
SessionDir=/etc/X11/gdm/Sessions/                                                                
# Better leave this blank and HOME will be used.  You can use syntax ~/ below                    
# to indicate home directory of the user                                                         
UserAuthDir=                                                                                     
# Fallback if home directory not writable                                                        
UserAuthFBDir=/tmp                                                                               
UserAuthFile=.Xauthority                                                                         
# The X server to use if we can't figure out what else to run.                                   
StandardXServer=/usr/X11R6/bin/X                                                                 
# The maximum number of flexible X servers to run.                                               
FlexibleXServers=5                                                                               
# the X nest command                                                                             
Xnest=/usr/X11R6/bin/Xnest -name Xnest                                                           
# Automatic VT allocation.  Right now only works on Linux.  This way                             
# we force X to use specific vts.  turn VTAllocation to false if this                            
# is causing problems.                                                                           
FirstVT=7                                                                                        
VTAllocation=true                                                                                
                                                                                                 
[security]                                                                                       
# If any distributions ship with this one off, they should be shot                               
# this is only local, so it's only for say kiosk use, when you                                   
# want to minimize possibility of breakin                                                        
AllowRoot=true                                                                                   
# If you want to be paranoid, turn this one off                                                  
AllowRemoteRoot=true                                                                             
# This will allow remote timed login                                                             
AllowRemoteAutoLogin=false                                                                       
# 0 is the most anal, 1 allows group write permissions, 2 allows all write permissions           
RelaxPermissions=0                                                                               
RetryDelay=3                                                                                     
# Maximum size of a file we wish to read.  This makes it hard for a user to DoS us               
# by using a large file.                                                                         
UserMaxFile=65536                                                                                
# Maximum size of the session file.  This is larger because it matters less as we                
# never keep it all in memory.  Just has an upper limit so that we don't go into too             
# long of a loop                                                                                 
SessionMaxFile=524388                                                                            
                                                                                                 
# XDMCP is the protocol that allows remote login.  If you want to log into                       
# gdm remotely (I'd never turn this on on open network, use ssh for such                         
# remote usage that).  You can then run X with -query <thishost> to log in,                      
# or -indirect <thishost> to run a chooser.  Look for the 'Terminal' server                      
# type at the bottom of this config file.                                                        
[xdmcp]                                                                                          
# Distributions: Ship with this off.  It is never a safe thing to leave                          
# out on the net.  Alternatively you can set up /etc/hosts.allow and                             
# /etc/hosts.deny to only allow say local access.                                                
Enable=false                                                                                     
# Honour indirect queries, we run a chooser for these, and then redirect                         
# the user to the chosen host.  Otherwise we just log the user in locally.                       
HonorIndirect=true                                                                               
# Maximum pending requests                                                                       
MaxPending=4                                                                                     
MaxPendingIndirect=4                                                                             
# Maximum open XDMCP sessions at any point in time                                               
MaxSessions=16                                                                                   
# Maximum wait times                                                                             
MaxWait=15                                                                                       
MaxWaitIndirect=15                                                                               
# How many times can a person log in from a single host.  Usually better to                      
# keep at 1 to fend off DoS attacks by running many logins from a single                         
# host                                                                                           
DisplaysPerHost=1                                                                                
# The port.  177 is the standard port so better keep it that way                                 
Port=177                                                                                         
# Willing script, none is shipped and by default we'll send                                      
# hostname system id.  But if you supply something here, the                                     
# output of this script will be sent as status of this host so that                              
# the chooser can display it.  You could for example send load,                                  
# or mail details for some user, or some such.                                                   
Willing=/etc/X11/gdm/Xwilling                                                                    
                                                                                                 
[gui]                                                                                            
# The 'theme'.  By default we're using the default gtk theme                                     
# Of course assuming that gtk got installed in the same prefix,                                  
# if not change this.                                                                            
GtkRC=/usr/share/themes/Default/gtk/gtkrc                                                        
# Maximum size of an icon, larger icons are scaled down                                          
MaxIconWidth=128                                                                                 
MaxIconHeight=128                                                                                
                                                                                                 
[greeter]                                                                                        
# Greeter has a nice title bar that the user can move                                            
TitleBar=true                                                                                    
# Configuration is available from the system menu of the greeter                                 
ConfigAvailable=true                                                                             
# Face browser is enabled.  This only works currently for the                                    
# standard greeter as it is not yet enabled in the graphical greeter.                            
Browser=true                                                                                     
# The default picture in the browser                                                             
DefaultFace=/usr/share/mdk/faces/default.png                                                     
# These are things excluded from the face browser, not from logging in                           
Exclude=bin,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,nobody,gdm,postgres,pvm,rpm 
# As an alternative to the above this is the minimum uid to show                                 
MinimalUID=500                                                                                   
# If user or user.png exists in this dir it will be used as his picture                          
GlobalFaceDir=/usr/share/faces/                                                                  
# Icon we use                                                                                    
Icon=/usr/share/pixmaps/gdm.png                                                                  
# File which contains the locale we show to the user.  Likely you want to use                    
# the one shipped with gdm and edit it.  It is not a standard locale.alias file,                 
# although gdm will be able to read a standard locale.alias file as well.                        
LocaleFile=/etc/X11/gdm/locale.alias                                                             
# Logo shown in the standard greeter                                                             
Logo=/usr/share/pixmaps/gdm-screen.png                                                           
# The standard greeter should shake if a user entered the wrong username or                      
# password.  Kind of cool looking                                                                
Quiver=true                                                                                      
# The system menu is shown in the greeter                                                        
SystemMenu=true                                                                                  
# Note to distributors, if you wish to have a different Welcome string                           
# and wish to have this translated you can have entries such as                                  
# Welcome[cs]=Vitejte na %n                                                                      
# Just make sure the string is in utf-8                                                          
Welcome=Welcome to %n                                                                            
# Don't allow user to move the standard greeter window.  Only makes sense                        
# if TitleBar is on                                                                              
LockPosition=false                                                                               
# Set a position rather then just centering the window.  If you enter                            
# negative values for the position it is taken as an offset from the                             
# right or bottom edge.                                                                          
SetPosition=false                                                                                
PositionX=0                                                                                      
PositionY=0                                                                                      
# Xinerama screen we use to display the greeter on.  Not for true                                
# multihead, currently only works for Xinerama.                                                  
XineramaScreen=0                                                                                 
# Background settings for the standard greeter:                                                  
# Type can be 0=None, 1=Image, 2=Color                                                           
BackgroundType=2                                                                                 
BackgroundImage=                                                                                 
BackgroundScaleToFit=true                                                                        
BackgroundColor=#21449c                                                                          
# XDMCP session should only get a color, this is the sanest setting since                        
# you don't want to take up too much bandwidth                                                   
BackgroundRemoteOnlyColor=true                                                                   
# Program to run to draw the background in the standard greeter.  Perhaps                        
# something like an xscreensaver hack or some such.                                              
BackgroundProgram=                                                                               
# if this is true then the background program is run always, otherwise                           
# it is only run when the BackgroundType is 0 (None)                                             
RunBackgroundProgramAlways=false                                                                 
# Show the chooser (you can choose a specific saved gnome session) session                       
ShowGnomeChooserSession=false                                                                    
# Show the Failsafe sessions.  These are much MUCH nicer (focus for xterm for                    
# example) and more failsafe then those supplied by scripts so distros should                    
# use this rather then just running an xterm from a script.                                      
ShowGnomeFailsafeSession=false                                                                   
ShowXtermFailsafeSession=false                                                                   
# Always use 24 hour clock no matter what the locale.                                            
Use24Clock=false                                                                                 
# Use circles in the password field.  Looks kind of cool actually                                
UseCirclesInEntry=false                                                                          
# These two keys are for the new greeter.  Circles is the standard                               
# shipped theme                                                                                  
GraphicalTheme=mdk                                                                               
GraphicalThemeDir=/usr/share/gdm/themes/                                                         
                                                                                                 
# The chooser is what's displayed when a user wants an indirect XDMCP                            
# session                                                                                        
[chooser]                                                                                        
# Default image for hosts                                                                        
DefaultHostImg=/usr/share/pixmaps/nohost.png                                                     
# Directory with host images, they are named by the hosts: host or host.png                      
HostImageDir=/usr/share/hosts/                                                                   
# Time we scan for hosts (well only the time we tell the user we are                             
# scanning actually)                                                                             
ScanTime=3                                                                                       
# A comma separated lists of hosts to automatically add (if they answer to                       
# a query of course).  You can use this to reach hosts that broadcast cannot                     
# reach.                                                                                         
Hosts=                                                                                           
# Broadcast a query to get all hosts on the current network that answer                          
Broadcast=true                                                                                   
                                                                                                 
[debug]                                                                                          
# This will enable debugging into the syslog, usually not neccessary                             
# and it creates a LOT of spew of random stuff to the syslog.  However it                        
# can be useful in determining when something is going very wrong.                               
Enable=false                                                                                     
                                                                                                 
[servers]                                                                                        
# These are the standard servers.  You can add as many you want here                             
# and they will always be started.  Each line must start with a unique                           
# number and that will be the display number of that server.  Usually just                       
# the 0 server is used.                                                                          
0=Standard                                                                                       
#1=Standard                                                                                      
# Note the VTAllocation and FirstVT keys on linux.  Don't add any vt<number>                     
# arguments if VTAllocation is on, and set FirstVT to be the first vt                            
# available that your gettys don't grab (gettys are usually dumb and grab                        
# even a vt that has already been taken).  Using 7 will work pretty much for                     
# all linux distributions.  VTAllocation is not currently implemented on                         
# anything but linux since I don't own any non-linux systems.  Feel free to                      
# send patches.  X servers will just not get any extra arguments then.                           
#                                                                                                
#Note: If you want to run an X terminal you could add an X server such as this                   
#0=Terminal -query serverhostname                                                                
# or for a chooser (optionally serverhostname could be localhost)                                
#0=Terminal -indirect serverhostname                                                             
                                                                                                 
# Definition of the standard X server.                                                           
[server-Standard]                                                                                
name=Standard server                                                                             
command=/usr/X11R6/bin/X0 :0 -deferglyphs 16 vt7                                                 
                                                                                                 
flexible=true                                                                                    
                                                                                                 
# To use this server type you should add -query host or -indirect host                           
# to the command line                                                                            
[server-Terminal]                                                                                
name=Terminal server                                                                             
# Add -terminate to make things behave more nicely                                               
command=/usr/X11R6/bin/X -terminate                                                              
# Make this not appear in the flexible servers (we need extra params                             
# anyway, and terminate would be bad for xdmcp)                                                  
flexible=false                                                                                   
# Not local, we do not handle the logins for this X server                                       
handled=false                                                                                    

/etc/X11/gdm/gdm.conf.1
# GDM Configuration file.  You can use gdmsetup program to graphically                           
# edit this, or you can optionally just edit this file by hand.  Note that                       
# gdmsetup does not tweak every option here, just the ones most users                            
# would care about.  Rest is for special setups and distro specific                              
# tweaks.  If you edit this file, you should send the HUP or USR1 signal to                      
# the daemon so that it restarts: (Assuming you have not changed PidFile)                        
#   kill -USR1 `cat /var/run/gdm.pid`                                                            
# (HUP will make gdm restart immediately while USR1 will make gdm not kill                       
# existing sessions and will only restart gdm after all users log out)                           
#                                                                                                
# You can also use the gdm-restart and gdm-safe-restart scripts which just                       
# do the above for you.                                                                          
#                                                                                                
# Have fun! - George                                                                             
                                                                                                 
[daemon]                                                                                         
# Automatic login, if true the first local screen will automatically logged                      
# in as user as set with AutomaticLogin key.                                                     
AutomaticLoginEnable=false                                                                       
AutomaticLogin=                                                                                  
# Timed login, useful for kiosks.  Log in a certain user after a certain                         
# amount of time                                                                                 
TimedLoginEnable=false                                                                           
TimedLogin=                                                                                      
TimedLoginDelay=30                                                                               
# A comma separated list of users that will be logged in without having                          
# to authenticate on local screens (not over xdmcp).  Note that 'root'                           
# is ignored and will always have to authenticate.                                               
LocalNoPasswordUsers=                                                                            
# If you are having trouble with using a single server for a long time and                       
# want gdm to kill/restart the server, turn this on                                              
AlwaysRestartServer=false                                                                        
# The gdm configuration program that is run from the login screen, you should                    
# probably leave this alone                                                                      
Configurator=/usr/sbin/gdmsetup --disable-sound --disable-crash-dialog                           
GnomeDefaultSession=/usr/share/gnome/default.session                                             
# The chooser program.  Must output the chosen host on stdout, probably you                      
# should leave this alone                                                                        
Chooser=/usr/bin/gdmchooser                                                                      
# Default path to set.  The profile scripts will likely override this                            
DefaultPath=/bin:/usr/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/bin:/usr/bin                    
# Default path for root.  The profile scripts will likely override this                          
RootPath=/sbin:/usr/sbin:/bin:/usr/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/local/bin:/usr/bin       
DisplayInitDir=/etc/X11/gdm/Init                                                                 
# Greeter for local (non-xdmcp) logins.  Change gdmlogin to gdmgreeter to                        
# get the new graphical greeter.                                                                 
Greeter=/usr/bin/gdmgreeter                                                                      
# Greeter for xdmcp logins, usually you want a less graphically intensive                        
# greeter here so it's better to leave this with gdmlogin                                        
RemoteGreeter=/usr/bin/gdmlogin                                                                  
# User and group that gdm should run as.  Probably should be gdm and gdm and                     
# you should create these user and group.  Anyone found running this as                          
# someone too privilaged will get a kick in the ass.  This should have                           
# access to only the gdm directories and files.                                                  
User=gdm                                                                                         
Group=gdm                                                                                        
# To try to kill all clients started at greeter time or in the Init script.                      
# doesn't always work, only if those clients have a window of their own                          
KillInitClients=true                                                                             
LogDir=/var/lib/gdm                                                                              
# You should probably never change this value unless you have a weird setup                      
PidFile=/var/run/gdm.pid                                                                         
PostSessionScriptDir=/etc/X11/gdm/PostSession/                                                   
PreSessionScriptDir=/etc/X11/gdm/PreSession/                                                     
# Distributions:  If you have some script that runs an X server in say                           
# VGA mode, allowing a login, could you please send it to me?                                    
FailsafeXServer=                                                                                 
# if X keeps crashing on us we run this script.  The default one does a bunch                    
# of cool stuff to figure out what to tell the user and such and can                             
# run an X configuration program.                                                                
XKeepsCrashing=/etc/X11/gdm/XKeepsCrashing                                                       
# Reboot, Halt and suspend commands, you can add different commands                              
# separated by a semicolon and gdm will use the first one it can find                            
RebootCommand=/sbin/shutdown -r now;/usr/sbin/shutdown -r now                                    
HaltCommand=/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now     
SuspendCommand=                                                                                  
# Probably should not touch the below this is the standard setup                                 
ServAuthDir=/var/lib/gdm                                                                         
SessionDir=/etc/X11/gdm/Sessions/                                                                
# Better leave this blank and HOME will be used.  You can use syntax ~/ below                    
# to indicate home directory of the user                                                         
UserAuthDir=                                                                                     
# Fallback if home directory not writable                                                        
UserAuthFBDir=/tmp                                                                               
UserAuthFile=.Xauthority                                                                         
# The X server to use if we can't figure out what else to run.                                   
StandardXServer=/usr/X11R6/bin/X0                                                                
# The maximum number of flexible X servers to run.                                               
FlexibleXServers=5                                                                               
# the X nest command                                                                             
Xnest=/usr/X11R6/bin/Xnest -name Xnest                                                           
# Automatic VT allocation.  Right now only works on Linux.  This way                             
# we force X to use specific vts.  turn VTAllocation to false if this                            
# is causing problems.                                                                           
FirstVT=7                                                                                        
VTAllocation=false                                                                               
                                                                                                 
[security]                                                                                       
# If any distributions ship with this one off, they should be shot                               
# this is only local, so it's only for say kiosk use, when you                                   
# want to minimize possibility of breakin                                                        
AllowRoot=true                                                                                   
# If you want to be paranoid, turn this one off                                                  
AllowRemoteRoot=true                                                                             
# This will allow remote timed login                                                             
AllowRemoteAutoLogin=false                                                                       
# 0 is the most anal, 1 allows group write permissions, 2 allows all write permissions           
RelaxPermissions=0                                                                               
RetryDelay=3                                                                                     
# Maximum size of a file we wish to read.  This makes it hard for a user to DoS us               
# by using a large file.                                                                         
UserMaxFile=65536                                                                                
# Maximum size of the session file.  This is larger because it matters less as we                
# never keep it all in memory.  Just has an upper limit so that we don't go into too             
# long of a loop                                                                                 
SessionMaxFile=524388                                                                            
                                                                                                 
# XDMCP is the protocol that allows remote login.  If you want to log into                       
# gdm remotely (I'd never turn this on on open network, use ssh for such                         
# remote usage that).  You can then run X with -query <thishost> to log in,                      
# or -indirect <thishost> to run a chooser.  Look for the 'Terminal' server                      
# type at the bottom of this config file.                                                        
[xdmcp]                                                                                          
# Distributions: Ship with this off.  It is never a safe thing to leave                          
# out on the net.  Alternatively you can set up /etc/hosts.allow and                             
# /etc/hosts.deny to only allow say local access.                                                
Enable=false                                                                                     
# Honour indirect queries, we run a chooser for these, and then redirect                         
# the user to the chosen host.  Otherwise we just log the user in locally.                       
HonorIndirect=true                                                                               
# Maximum pending requests                                                                       
MaxPending=4                                                                                     
MaxPendingIndirect=4                                                                             
# Maximum open XDMCP sessions at any point in time                                               
MaxSessions=16                                                                                   
# Maximum wait times                                                                             
MaxWait=15                                                                                       
MaxWaitIndirect=15                                                                               
# How many times can a person log in from a single host.  Usually better to                      
# keep at 1 to fend off DoS attacks by running many logins from a single                         
# host                                                                                           
DisplaysPerHost=1                                                                                
# The port.  177 is the standard port so better keep it that way                                 
Port=177                                                                                         
# Willing script, none is shipped and by default we'll send                                      
# hostname system id.  But if you supply something here, the                                     
# output of this script will be sent as status of this host so that                              
# the chooser can display it.  You could for example send load,                                  
# or mail details for some user, or some such.                                                   
Willing=/etc/X11/gdm/Xwilling                                                                    
                                                                                                 
[gui]                                                                                            
# The 'theme'.  By default we're using the default gtk theme                                     
# Of course assuming that gtk got installed in the same prefix,                                  
# if not change this.                                                                            
GtkRC=/usr/share/themes/Default/gtk/gtkrc                                                        
# Maximum size of an icon, larger icons are scaled down                                          
MaxIconWidth=128                                                                                 
MaxIconHeight=128                                                                                
                                                                                                 
[greeter]                                                                                        
# Greeter has a nice title bar that the user can move                                            
TitleBar=true                                                                                    
# Configuration is available from the system menu of the greeter                                 
ConfigAvailable=true                                                                             
# Face browser is enabled.  This only works currently for the                                    
# standard greeter as it is not yet enabled in the graphical greeter.                            
Browser=true                                                                                     
# The default picture in the browser                                                             
DefaultFace=/usr/share/mdk/faces/default.png                                                     
# These are things excluded from the face browser, not from logging in                           
Exclude=bin,daemon,adm,lp,sync,shutdown,halt,mail,news,uucp,operator,nobody,gdm,postgres,pvm,rpm 
# As an alternative to the above this is the minimum uid to show                                 
MinimalUID=500                                                                                   
# If user or user.png exists in this dir it will be used as his picture                          
GlobalFaceDir=/usr/share/faces/                                                                  
# Icon we use                                                                                    
Icon=/usr/share/pixmaps/gdm.png                                                                  
# File which contains the locale we show to the user.  Likely you want to use                    
# the one shipped with gdm and edit it.  It is not a standard locale.alias file,                 
# although gdm will be able to read a standard locale.alias file as well.                        
LocaleFile=/etc/X11/gdm/locale.alias                                                             
# Logo shown in the standard greeter                                                             
Logo=/usr/share/pixmaps/gdm-screen.png                                                           
# The standard greeter should shake if a user entered the wrong username or                      
# password.  Kind of cool looking                                                                
Quiver=true                                                                                      
# The system menu is shown in the greeter                                                        
SystemMenu=true                                                                                  
# Note to distributors, if you wish to have a different Welcome string                           
# and wish to have this translated you can have entries such as                                  
# Welcome[cs]=Vitejte na %n                                                                      
# Just make sure the string is in utf-8                                                          
Welcome=Welcome to %n                                                                            
# Don't allow user to move the standard greeter window.  Only makes sense                        
# if TitleBar is on                                                                              
LockPosition=false                                                                               
# Set a position rather then just centering the window.  If you enter                            
# negative values for the position it is taken as an offset from the                             
# right or bottom edge.                                                                          
SetPosition=false                                                                                
PositionX=0                                                                                      
PositionY=0                                                                                      
# Xinerama screen we use to display the greeter on.  Not for true                                
# multihead, currently only works for Xinerama.                                                  
XineramaScreen=0                                                                                 
# Background settings for the standard greeter:                                                  
# Type can be 0=None, 1=Image, 2=Color                                                           
BackgroundType=2                                                                                 
BackgroundImage=                                                                                 
BackgroundScaleToFit=true                                                                        
BackgroundColor=#21449c                                                                          
# XDMCP session should only get a color, this is the sanest setting since                        
# you don't want to take up too much bandwidth                                                   
BackgroundRemoteOnlyColor=true                                                                   
# Program to run to draw the background in the standard greeter.  Perhaps                        
# something like an xscreensaver hack or some such.                                              
BackgroundProgram=                                                                               
# if this is true then the background program is run always, otherwise                           
# it is only run when the BackgroundType is 0 (None)                                             
RunBackgroundProgramAlways=false                                                                 
# Show the chooser (you can choose a specific saved gnome session) session                       
ShowGnomeChooserSession=false                                                                    
# Show the Failsafe sessions.  These are much MUCH nicer (focus for xterm for                    
# example) and more failsafe then those supplied by scripts so distros should                    
# use this rather then just running an xterm from a script.                                      
ShowGnomeFailsafeSession=false                                                                   
ShowXtermFailsafeSession=false                                                                   
# Always use 24 hour clock no matter what the locale.                                            
Use24Clock=false                                                                                 
# Use circles in the password field.  Looks kind of cool actually                                
UseCirclesInEntry=false                                                                          
# These two keys are for the new greeter.  Circles is the standard                               
# shipped theme                                                                                  
GraphicalTheme=mdk                                                                               
GraphicalThemeDir=/usr/share/gdm/themes/                                                         
                                                                                                 
# The chooser is what's displayed when a user wants an indirect XDMCP                            
# session                                                                                        
[chooser]                                                                                        
# Default image for hosts                                                                        
DefaultHostImg=/usr/share/pixmaps/nohost.png                                                     
# Directory with host images, they are named by the hosts: host or host.png                      
HostImageDir=/usr/share/hosts/                                                                   
# Time we scan for hosts (well only the time we tell the user we are                             
# scanning actually)                                                                             
ScanTime=3                                                                                       
# A comma separated lists of hosts to automatically add (if they answer to                       
# a query of course).  You can use this to reach hosts that broadcast cannot                     
# reach.                                                                                         
Hosts=                                                                                           
# Broadcast a query to get all hosts on the current network that answer                          
Broadcast=true                                                                                   
                                                                                                 
[debug]                                                                                          
# This will enable debugging into the syslog, usually not neccessary                             
# and it creates a LOT of spew of random stuff to the syslog.  However it                        
# can be useful in determining when something is going very wrong.                               
Enable=false                                                                                     
                                                                                                 
[servers]                                                                                        
# These are the standard servers.  You can add as many you want here                             
# and they will always be started.  Each line must start with a unique                           
# number and that will be the display number of that server.  Usually just                       
# the 0 server is used.                                                                          
0=Standard                                                                                       
1=2nd                                                                                            
                                                                                                 
# Note the VTAllocation and FirstVT keys on linux.  Don't add any vt<number>                     
# arguments if VTAllocation is on, and set FirstVT to be the first vt                            
# available that your gettys don't grab (gettys are usually dumb and grab                        
# even a vt that has already been taken).  Using 7 will work pretty much for                     
# all linux distributions.  VTAllocation is not currently implemented on                         
# anything but linux since I don't own any non-linux systems.  Feel free to                      
# send patches.  X servers will just not get any extra arguments then.                           
#                                                                                                
#Note: If you want to run an X terminal you could add an X server such as this                   
#0=Terminal -query serverhostname                                                                
# or for a chooser (optionally serverhostname could be localhost)                                
#0=Terminal -indirect serverhostname                                                             
                                                                                                 
# Definition of the standard X server.                                                           
[server-Standard]                                                                                
name=Standard server                                                                             
command=/usr/X11R6/bin/X0 :0 -deferglyphs 16 vt7                                                 
flexible=true                                                                                    
                                                                                                 
# Definition of the second X server.                                                             
[server-2nd]                                                                                     
name=2nd server                                                                                  
command=/usr/X11R6/bin/X1 :1 -xf86config /etc/X11/XF86Config-4.X1 -deferglyphs 16 vt9            
flexible=true                                                                                    
                                                                                                 
# To use this server type you should add -query host or -indirect host                           
# to the command line                                                                            
[server-Terminal]                                                                                
name=Terminal server                                                                             
# Add -terminate to make things behave more nicely                                               
command=/usr/X11R6/bin/X -terminate                                                              
# Make this not appear in the flexible servers (we need extra params                             
# anyway, and terminate would be bad for xdmcp)                                                  
flexible=false                                                                                   
# Not local, we do not handle the logins for this X server                                       
handled=false                                                                                    
-----------------------------------------------------------------------------

Appendix C. Scripts

C.1. wrapper for starting X using Nvidia libGL.so

#!/bin/bash                                                                  
#########################################################                    
### /usr/X11R6/bin/XNV                                ###                    
### script to start XFree with different LIBRARY_PATH ###                    
### in order to use Nvidia GL libraries and           ###                    
### XFree GL libraries at the same time               ###                    
#########################################################                    
                                                                             
export LD_LIBRARY_PATH=/usr/X11R6/libNV                                      
exec /usr/X11R6/bin/X0 $*                                                    
-----------------------------------------------------------------------------

C.2. for installing Nvidia drivers for parallel use with DRI

#!/bin/bash                                                                                      
########################################################                                         
### /usr/sbin/ruby_NVinstaller                       ###                                         
### for usage call it with -h or --help parameter    ###                                         
########################################################                                         
                                                                                                 
if [[ -z $1 ]] || [ "$1" == "-h" ] || [ "$1" == "--help" ] ;then                                 
echo                                                                                             
echo "Usage :"                                                                                   
echo "$0 full path to Nvidia installer"                                                          
echo "eg. $0 /root/NVIDIA-Linux-x86-1.0-4349.run"                                                
exit 1                                                                                           
fi                                                                                               
                                                                                                 
if [[ -z $OPENWINHOME ]];then                                                                    
echo                                                                                             
echo "OPENWINHOME not defined!!!"                                                                
echo "Please set the environment variable OPENWINHOME"                                           
echo "pointing to your XFree prefix eg. /usr/X11R6"                                              
echo "for bash shell :"                                                                          
echo "export OPENWINHOME=/usr/X11R6"                                                             
exit 1                                                                                           
fi                                                                                               
                                                                                                 
cd $OPENWINHOME                                                                                  
echo                                                                                             
echo "backup file for XFree's GL libraries "                                                     
echo "is $OPENWINHOME/libGL-backup.tar"                                                          
if [ -x libGL-backup.tar ]; then                                                                 
        echo "old backup exist, deleting" && rm libGL-backup.tar                                 
fi                                                                                               
echo                                                                                             
find lib -name "libGL.*" -o -name "libGLcore*" \                                                 
        -o -name "libglx.*" | xargs tar  rpf   libGL-backup.tar \                                
        && echo "backup finished"                                                                
echo                                                                                             
echo "now running Nvidia installer"                                                              
echo "`which $1` --no-opengl-headers --xfree86-prefix=/usr/X11R6NV --opengl-prefix=/usr/X11R6NV" 
echo                                                                                             
`which $1` --no-opengl-headers --xfree86-prefix=/usr/X11R6NV --opengl-prefix=/usr/X11R6NV        
RETVAL=$?                                                                                        
if [ $RETVAL -eq 0 ]; then                                                                       
                                                                                                 
echo                                                                                             
echo "Nvidia installer finished,"                                                                
echo "now coping files to /usr/X11R6/libNV/"                                                     
echo                                                                                             
cd /usr/X11R6NV/lib &&  tar c * | tar xvC /usr/X11R6/libNV/                                      
echo                                                                                             
echo "restoring backuped GL libraries"                                                           
echo                                                                                             
cd $OPENWINHOME                                                                                  
tar xvfp libGL-backup.tar && ldconfig && echo "GL libraries restored" && rm libGL-backup.tar     
fi                                                                                               
                                                                                                 
if [ $RETVAL -ne 0 ]; then                                                                       
        echo                                                                                     
        echo "installer aborted, not restoring backup"                                           
        echo "deleting backup files" &&  rm libGL-backup.tar                                     
fi                                                                                               
                                                                                                 
echo                                                                                             
echo "script finished"                                                                           
