<revremark> add some info on the new IsolateDevice XFree/X.org, drop some stalled comments about ruby-2.6 (a lot more must be removed - linux-2.6 is table now)</revremark>
</revision>
<!--
<revision>
<revnumber>1.3.1</revnumber>
<date>2004-08-14</date>
<authorinitials>SS</authorinitials>
<revremark>update address of my site '/varna.demon/s/varna/karlovo/' </revremark>
<revremark>split "installing modified XFree" in "Do I need a modified X server" and "Installing and Configuring XFree-PrefBusID" : i think it's getting more complete (ready for 1.2) :)</revremark>
</revision>
<revision>
<revnumber>1.1.3</revnumber>
<date>2003-09-09</date>
<authorinitials>SS</authorinitials>
<revremark>XFree PrefBusID version 3, add (untested/ tested only by me) input.rc and info on using it </revremark>
This HOWTO explains one of the ways to get a working, multiple, local X user-capable PC system for up to 16 users. It is based on using a modified Linux kernel with support for multiple independent users . The second way is not covered here,
but on the web page of it's author, the pioneer Miguel Freitas.
<para><firstterm>Backstreet Ruby</firstterm> is a kernel patch for the Linux kernel. It is a back port to Linux-2.4 of the <firstterm>Ruby kernel tree</firstterm>, 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 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). </para>
<para>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 and multiple keyboards independently, in order to make multiple local XFree users on a single PC system possible. </para>
<para>You can have multiple independent graphic cards and multiple independent mice, but in order for 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. </para>
<para>The entire work on back porting Ruby to Linux-2.4 is done by Aivils Stoss. <email>Aivils.Stoss (at) unibanka.lv</email></para>
<para>All the features in Backstreet Ruby are included ( "/proc " interface & hot-plugging, video hack, ...), support for Framebuffer devices, support for single Framebuffer console which takes over the VGA console (support for multiple independent Framebuffer consoles is not yet implemented)</para>
</footnote> too, so if you prefer the Linux-2.6 kernel you might use Ruby instead of Linux-2.4 + Backstreet Ruby.</para>
<para>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.</para>
<para>You can find it here:<ulinkurl="http://startx.times.lv/"> http://startx.times.lv</ulink></para>
<para>This document explains how to configure your system for multiple local XFree users using the enchanted console/input subsystem in the Backstreet Ruby/ Ruby-2.6 kernel .</para>
<para>I will use :<itemizedlist>
<listitem>
<para>"Backstreet Ruby" or "BRuby" to refer to the back port to Linux 2.4</para>
</listitem>
<listitem>
<para>"Ruby" or "Ruby-2.6" to refer to the original Ruby kernel tree for Linux 2.6</para>
</listitem>
</itemizedlist></para>
<para>Every mention of Backstreet Ruby should be replaceable by Ruby/ Ruby-2.6 unless else mentioned.</para>
<para>There are two ways of setting up multiple local XFree users:</para>
<para><orderedlist>
<listitem>
<para>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 at <ulinkurl="http://cambuca.ldhs.cetuc.puc-rio.br/multiuser/">http://cambuca.ldhs.cetuc.puc-rio.br/multiuser/</ulink>, for instructions on how to set up such a system.
</para>
</listitem>
<listitem>
<para>Use the Backstreet Ruby kernel which supports independent keyboards.</para>
</listitem>
</orderedlist></para>
<para>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 the solution from Miguel Freitas.</para>
<para>This document is not intended to be a replacement of the existing documentation on the Backstreet Ruby home page (<ulinkurl="http://startx.times.lv/">http://startx.times.lv</ulink>), but rather, this is a HOWTO, explaining the way to a working X multi-user PC system. If you encounter any problems you'll probably need to consult the more detailed information there.</para>
<para>The document is based on the file system layout of the Mandrake-Linux distribution, but I tried to make it distribution-independent by including information about the differences to other mainstream distributions like Debian, Red Hat and SuSE Linux.</para>
<para>for providing Debian packages, comments about Debian</para>
</listitem>
</itemizedlist>
</sect1>
<!-- Feedback -->
<sect1id="feedback">
<title>Feedback/Bug Reporting</title>
<para>Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address : <email>svetoslav (at) users.sourcefourge.net</email>.</para>
<para>In case you experiance troubles in configuring the system, feel free to contact me or the linuxcosnole mailing list. </para>
<para>Please send as much details as possible, the most important information would be (from a running Backstreet Ruby kernel):</para>
<para>Well I would sugest first to read briefly chapters 3,4(may be 2 as well), then make your choices(which configuration will you use - DRI or non-DRI, do you want to install from source or binaries, ...). Then reread the parts which meet your needs more carefully. Start with a simple setup for 2 users only, get the basic setup running, then configure display manager. When everything seems to run OK, go for more advanced configurations in chapters 5,7.</para>
<para>Don't be afraid that its too complicated, </para>
<para>XFree does not support DRI acceleration on multiple graphic cards. The only way to get multiple accelerated X sessions is to use Nvidia's closed source driver and GL library or a single card using DRI and multiple cards using Nvidia's closed source drivers. XFree extensions not dependent on DRI should work.</para>
<para>Most of the multiheaded graphic cards can be used only for a single user/display. In order to start independent X servers the heads have to be explicitly addressable (which can not be done with most of the cards). It should be possible to use cards with explicitly addressable heads for independent displays, but this has not yet been tested.</para>
<para>In the following cases it might be possible to use a single multiheaded card for multiple independent displays : </para>
<para>Using/configuring independent devices for the independent screens/users is pretty hard or not explored. Exceptions are the input devices, graphic cards and sound thanks artsd. Some examples of such unexplored areas: </para>
<para>Currently under Backstreet Ruby/ Ruby you can have a maximum of 16 Virtual Terminals (8 for Backstreet Ruby released before 7 Oct 2003). This means that without hotplug configured if you are using USB keyboards with fancy keys you are limited to maximum of 8 independent users ( for older versions Backstreet Ruby - 4 users). So do use hotplug if you are going to setup a system for more then 4 users ( even systems with 2 attached USB keyboards benefit from using hotplug). </para>
<para>If you are using hotplug the maximal number of independent users is 16 for Backstreet Ruby / Ruby-2.6 and 8 for older versions Backstreet Ruby.</para>
<!--<caution>
<title>Caution</title>
<para>This also means : DO NOT start your system with <command>dumbcon=8</command> or higher number, it will lead to upredictable results (actually the kernel will reboot your system !!!). For Ruby-2.6 the maximal allowable number is 15.</para>
<para>You should configure each of your video cards to work properly with a single X server, which is actually beyond the scope of this document. You should refer to the documentation that came with your distribution, but some general hints couldn't hurt.</para>
<para>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 the BusID "PCI:x:xx:x" field in the configuration file. You can do this with the help of lspci, XFree86 -scanpci -verbose , or other similar distribution-specific tools.</para>
<para>You could use a similar approach if you have only monitors or video cards of the same type.</para>
<para>Most modern distributions also have advanced tools for easier configuration of Xinerama. You can use these 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 can use an example configuration file, replacing video card and monitor section, by the corresponding sections from the Xinerama <filename>XFConfig-4</filename> file.</para>
<para>Other useful resources:</para>
<itemizedlist>
<listitem>
<para><ulinkurl="http://www.tldp.org/HOWTO/XFree86-HOWTO/index.html">The Linux XFree86 HOWTO</ulink></para>
</listitem>
<listitem>
<para><ulinkurl="http://www.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/index.html">XFree86 Video Timings HOWTO</ulink></para>
</listitem>
<listitem>
<para><ulinkurl="http://www.tldp.org/HOWTO/XWindow-Overview-HOWTO/index.html">X Window System Architecture Overview HOWTO</ulink></para>
</listitem>
<listitem>
<para><ulinkurl="http://www.tldp.org/HOWTO/XWindow-User-HOWTO/index.html">The X Window User HOWTO</ulink></para>
</listitem>
</itemizedlist>
</sect1>
<sect1id="xf_confs_xinerama">
<title>Reusing Xinerama configured XFree</title>
<para>If you have a system configured for Xinerama, you can easily adjust the XFree configuration file so you can use it for multiple users.</para>
<para>This will allow you to easily switch between a multi-user environment and a Xinerama multi-monitor environment. </para>
<para>What is Xinerama and how does the system configured using this HOWTO differ from a system using the Xinerama extensions in XFree? </para>
<para> 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 <quote>Virtual Desktop</quote> Xinerama creates.</para>
<para>Just the opposite, the primary goal of a system configured according to this HOWTO is to offer multiple independent displays for several users on a single PC system.</para>
<para>For more information on Xinerama read:</para>
<itemizedlist>
<listitem>
<para><ulinkurl="http://www.tldp.org/HOWTO/Xinerama-HOWTO/index.html">Xinerama-HOWTO</ulink>, Using Xinerama to MultiHead XFree86 v.4.0+</para>
<para>Binary rpms of modified XFree servers are currently available for Mandrake 8.2/ 9/ 9.1/ 9.2, Red Hat 8/ 9, SuSE 8.1. If you're running other rpm-based distributions please help me to prepare and rebuild packages, so other users can get pre-compiled binaries.
Currently the binary rpm packages are not mirrored and are only available from <ulinkurl="http://karlovo.demon.co.uk/~svetlio/ruby-contrib">http://karlovo.demon.co.uk/~svetlio/ruby-contrib</ulink>.
<para>Binary packages for Debian Sid are also available thanks to Andreas Schuldei at <ulinkurl="http://www.schuldei.org/debian/bruby">http://www.schuldei.org/debian/bruby</ulink>, or as apt repository "deb http://www.schuldei.org/debian/bruby ./ ".</para>
<para>The installation of Ruby-2.6 is not fully covered, partly because there are almost no differences compared to the installation of Linux-2.6 kernel, partly because I have not gathered enough experience with Ruby-2.6 yet, so any comments and questions are welcomed. </para>
<para>If you are going to use Ruby-2.6, please do install Linux-2.6 without the Ruby-2.6 patch first and configure your system for it, in order to avoid tracking "Ruby-2.6 Bugs" which are actually due to a not properly configured system because of the Linux-2.4 -> Linux-2.6 changes. A good starting point is probably <ulinkurl="http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt">http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt"</ulink> .</para>
<para>The easiest way would be to pull an already prepared binary kernel; there are packages for some distributions (currently only Mandrake and Debian) or a source package, and rebuild it on your system.</para>
<para>If for some reason you cannot use them or have problems using them you can also build your own kernel with the Backstreet Ruby/ Ruby-2.6 patch. For more information how to do this visit the Backstreet Ruby page on building and installing the kernel: <ulinkurl="http://startx.times.lv">http://startx.times.lv</ulink> (or some of the mirrors) -> Documentation -> Quick Kernel.</para>
<para>(If you are new to Linux, reading <quote>The Linux Kernel HOWTO</quote>, <ulinkurl="http://tldp.org/HOWTO/Kernel-HOWTO.html">http://tldp.org/HOWTO/Kernel-HOWTO.html</ulink>, could be very helpful.)</para>
<para>You can find binary kernel packages for Mandrake at <ulinkurl="http://karlovo.demon.co.uk/~svetlio/ruby-contrib/">http://karlovo.demon.co.uk/~svetlio/ruby-contrib/</ulink>.</para>
<para>Debian binary kernel packages are available at <ulinkurl="http://www.schuldei.org/debian/bruby">http://www.schuldei.org/debian/bruby</ulink>, or as apt repository "deb http://www.schuldei.org/debian/bruby ./ "</para>
<para>The reason is that in some version of the module-utils package this dependency is hardcoded, but overrideable, so you should override it by adding <quote>above hid usbcore</quote> to your <filenamemoreinfo="none">/etc/modules.conf</filename></para>
<para>There are some things I would like to mention, although I won't go in details, as the Backstreet Ruby page on compiling the kernel discusses this topic.</para>
<para></para>
<para><orderedlist>
<listitem>
<para>You have to follow this order:</para>
<programlisting>
Input support
Virtual Terminal support
Console drivers
</programlisting>
<para>for all required options to be available/selectable.</para>
</listitem>
<listitem>
<para>You have to use built in input support:</para>
<para>I would suggest you also include at least one keyboard (built in - not as a 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.</para>
<para>For AT/PS2 keyboards, turn on (not modules):</para>
<programlisting>
Input device support --> Serial i/o support
Input device support --> i8042 PC Keyboard controller
Input device support --> Keyboards
Input device support --> AT keyboard support
</programlisting>
<para>For a USB keyboard turn on (not modules):</para>
USB support --> USB Human Interface Device (full HID) support
USB support --> HID input layer support
</programlisting>
</listitem>
<listitem>
<para>If you are new to Linux, do not try to patch an already patched kernel (heavily patched kernels like the ones that ship with most distributions). Use a kernel from <ulinkurl="http://www.kernel.org">www.kernel.org</ulink>, and take a look at the <ulinkurl="http://www.tldp.org/HOWTO/Kernel-HOWTO/">Linux Kernel HOWTO</ulink>.</para>
<para>In Backstreet Ruby (the patch for a 2.4 Linux kernel) does not support frame buffer devices , and for that reason is disabled.</para>
<para>In Ruby (the patch for 2.6 Linux kernel) if you want to disable/ change to modules support for PS2 input devices, you have to first activate/enable "General setup --> Remove kernel features (for embedded systems)"</para>
<para> If you are not using the devfs file system, you might need to create several device files needed for the new input sub-system in the Backstreet Ruby kernel:</para>
<note>
<title>Note</title>
<para>Most current distributions should already provide the necessary device files, so try booting Backstreet Ruby without creating the device files and in case you don't miss input devices omit this section. Any distribution that came with XFree-4.3.0 and linux-2.4.20 should provide these device files. </para>
<para>If you use devfs, all required devices will be created automatically by devfs.</para>
<para>Mandrake is an example of one distribution that uses devfs. Debian does not use devfs by default, but the kernel supports devfs; in order to activate devfs you have to add <quote>devfs=mount</quote> to the <quote>append</quote> line of your boot loader and install devfsd (the devfs demon). Distributions that do not use devfs are Red Hat and SuSE.</para>
<para>You can check whether devfs is used by issuing the following commands:</para>
<para>As the frame buffer layer is not back-ported to Linux-2.4, only the primary graphic card is initialized during the boot process. Secondary graphic cards can only be initialized by an X server, so under Backstreet Ruby you will have a single VGA text console on the primary graphic card. </para>
<para>Ruby for Linux-2.6 supports framebuffer devices and single framebuffer console (which takes over the VGA console), but support for multiple VT's through framebuffer consoles is not yet ready.</para>
<para>To keep VGA console properly working it is important first to be started the XFree instance which will drive the graphic card which is used for VGA console(the graphic card defined as primary in BIOS).</para>
<!--<para>Under Linux-2.4 a useful replacement for framebuffer graphics is SVGATextMode (<ulink url="http://freshmeat.net/projects/svgatextmode/?topic_id=136">http://freshmeat.net/projects/svgatextmode/?topic_id=136</ulink>). It provides characters superior to the VGA text mode and much faster than those of framebuffers. Unfortunately it has not been updated for newer graphics cards. SVGATextMode cannot be used under Linux-2.6</para>
<title>Keyboard numbering(order of detection)</title>
<para>In the following chapters you will read about 1st keyboard, 2nd keyboard and so on, so here I will explain what is meant by n-th keyboard. </para>
<para>When a keyboard device is found, it is bound to a free VT (given that there are free VT's). The first keyboard found will be bound to VT0 (tty1-tty16), the second to VT1 (tty17), the third to VT2 (tty18).</para>
<note>
<title>Note</title>
<para>Older versions of the bruby patch (released before Oct 7 2003) use :</para>
<para>first keyboard found => VT0 (tty0-tty7)</para>
<para>If you are using kernel with integrated USB input the USB keyboard devices will be registered first, then the AT/PS2 keyboards will follow when the modules are loaded</para>
</listitem>
<listitem>
<para>If you are using kernel with integrated PS2 input the AT/PS2 keyboard devices will be registered first, then the USB keyboards will follow when the modules are loaded</para>
</listitem>
<listitem>
<para>If you are using kernel with integrated PS2 & USB input the AT/PS2 keyboard devices will be registered first, then the USB keyboards will follow</para>
<para>Most USB keyboards represent themselves as more than one keyboard; it is common that the multimedia keys or the number-pad identify themselves as a different keyboard device. So if you are running a kernel with integrated USB input and have one USB keyboard with multimedia keys and one PS2 keyboard, the USB keyboard will be bound to VT0(real keyboard) and VT1(multimedia keys), the PS2 keyboard will be bound to VT2 (in case you have enough DUMB consoles).</para>
<para>There are several ways to work around these issues. Here I'll explain the easiest way to follow. It's definitely not the best one, but the shortest explanation, and I just want to make it clear to you that the problem is not that big. The better solutions will follow later in their own section. </para>
<para>All you need to do is to start the Backstreet Ruby/ Ruby kernel with dumbcon=n , where n is the sum of your AT/PS2 keyboards plus the sum of your USB keyboards multiplied by 2 (I suppose this is the maximum number of interfaces a USB keyboard registers), so all keyboards will be bound to a VT. Now you should find out which VT's the real keyboards are bound to (the keyboards excluding the multimedia keys) and start X using the appropriate tty ranges. Thanks to the proc interface integrated in Backstreet Ruby, you can easily find the assignment of keyboards to VT's. Each VT creates a file <filename>/proc/bus/console/[n]/keyboard</filename> (n is the number of the VT, for VT0 n will be 00, for VT1 - 01, ... , for VT11 - 11); reading this file will give you the assigned keyboard.
<para>Now we can start X on the VT's with real keyboards, in this case VT0 and VT2.</para>
<para>Of course in this simple example with only 2 keyboards (one USB and one PS2) the problem could be easily avoided by using a kernel with primary PS2 input support. The PS2 keyboard would be found first and bound to VT0, the USB keyboard would follow and it's real keyboard interface would be bound to VT1, so there is no need for additional dumb consoles (for the multimedia interfaces of USB keyboards).</para>
<para>For some video cards you can skip this part. Before installing the modified X server check the Video Compatibility list to determine whether you need one. Currently there are reports for working configurations without using a modified X server for Voodoo Graphics as primary and Voodoo3 or Nvidia TNT2 as secondary.</para>
</note>
<para><quote>Why should a modified X server be used?</quote> - The reason is that XFree is designed to serve a single user and this design requires a single X server to drive all available graphic cards. So when an unmodified X server starts, it disables access to graphic cards for other X servers. Hence we have to modify XFree to make it possible more then one X server to run at the same time.</para>
<itemizedlist>
<para>You first have to decide whether you want to experiment whether your graphic card is "multi-user friendly" or go for surer way(more details follow).</para>
<para>"The experimental way": you can use the "hackvideo"(ignoring pci_disable XFree commands) feature of the Backstreet Ruby kernel. This will allow you to use the XFree server that came with your distribution (no need for installing modified XFree server).</para>
<para>A: Well, you have to find out whether it works with your combination of graphic cards. There are some combination that works flawlessly, but the majority of tested combinations have problems with this setup.</para>
<para>"The surer way": you have to install XFree server modified with the Prefered Bus ID patch.</para>
<para>Q: "Why surer?" </para>
<para>A: Because it works with all "supported graphic cards", solves a lot of stability problems and makes it possible to use VGA console on the primary graphic card.</para>
<para>This functionality exists in the Backstreet Ruby kernel since 15. May 2003 and in Ruby-2.6 since 29. Sep 2003 , but will never be added to the official linux kernel as it is a small hack to spare you installing modified X server. </para>
<para>It is still recommended to install modified X server.</para>
<para>You probably only need already-built binaries. If there are packages for your distribution you can install them. If not, you have 3 more possibilities:</para>
<listitem>
<para>Install an already built, but not packaged, modified X server and create the necessary symbolic links. You can get such binaries from the Backstreet Ruby home page, at <ulinkurl="http://startx.times.lv">http://startx.times.lv</ulink>.</para>
<para>Help us (as well other people using your distribution) in building an rpm or binary for your distribution (we lack systems installed with all available distributions, so we are not able to build packages for every distribution).</para>
<para>To patch and rebuild XFree from source using the instructions on the Backstreet Ruby page. Go to the Documentation section, at <ulinkurl="http://startx.times.lv">http://startx.times.lv</ulink> (or some of the mirrors) -> Documentation -> Quick XFree.</para>
<para>For AGP cards, something similar to "1:0:0"</para>
<para>For PCI cards, something similar to "0:xx:0"</para>
</note>
<itemizedlist>
<listitem>
<para>In most cases you will find the BusID already set in the device section of the XFree configuration file.</para>
<para>(Virtually always in case XFree is configured for Xinerama.)</para>
</listitem>
<listitem>
<para>If it is missing you can use <command>lspci</command>, <command>XFree86 -scanpci -verbose</command> or other similar tools that came with your distribution.</para>
<para>With <commandmoreinfo="none">lspci</command> look for "VGA compatible controller" or other similar tools that came with your distribution.<screen>root@svetljo mnt]# lspci | grep "VGA compatible controller"
<para>With <commandmoreinfo="none">XFree86 -scanpci -verbose</command> , or in case XFree is already running <commandmoreinfo="none">XFree86 :1 -scanpci -verbose</command> and look for your graphic cards:<screen>[root@svetljo mnt]# XFree86 :1 -scanpci -verbose
......
(0:13:0) unknown card (0x1462/0x8852) using a nVidia Corporation NV17 [GeForce4 MX 420]
......
(1:0:0) unknown card (0x1002/0x0f2a) using a ATI Technologies Inc Radeon RV200 QW [Radeon 7500]</screen></para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>Configure XFree-PrefBusID. You have the following choices with the same effect:
<para>For use in multi-user environment set to true, for standard XFree behavior(single X server allowed) to false or comment out/ delete the line.</para>
<para>For use in multi-user environment include the option with a valid BusID, for standard XFree behavior(single X server allowed) comment out or delete.</para>
<note><para>This functionality is inlcuded the xorg-x11 packages for Mandrake and in Debian Sid XFree86 packages, but the option name is changed to <quote>IsolateDevice</quote></para></note>
<para>Use the XFree command line option <commandmoreinfo="none">-prefbusid x:x:x</command> , requires as argument a valid BusID, initial release of the patch</para>
<para>For use in multi-user environment pass the option with a valid BusID to XFree at start-up, for standard XFree behavior(single X server allowed) don't specify the option.</para>
<note><para>This functionality is inlcuded the xorg-x11 packages for Mandrake and in Debian Sid XFree86 packages, but the option name is changed to <commandmoreinfo="none">-isolateDevice x:x:x</command></para></note>
<para>For example on command line <screenformat="linespecific">[root@svetljo mnt]# startx -- /usr/X11R6/bin/X0 :0 -prefbusid 1:0:0 vt7</screen> , or from a display manager (gdm): <programlistingformat="linespecific">..............................
<para>The symbolic links are needed for properly starting several XFree instances, as well for properly exiting an X session. This applies for both starting X from console and the automatic starting of X by the display manager (kdm, gdm, xdm).</para>
<para>You need to create as many symbolic links to the modified X server binary (or to the original X server in case you do not need a modified one), as the number of your video cards/X sessions.</para>
<para>I assume that you will have to use a modified X server, but in case you do not need it, use the following commands to create the links to your original X server:</para>
<screen>
cd /usr/X11R6/bin/
ln -s XFree[modified] X0
ln -s XFree[modified] X1
ln -s XFree[modified] X2
</screen>
<para>In case you use the provided rpm packages, you'll only need this if you want more than 4 parallel running X servers/X sessions, as the rpm creates 4 symbolic links to the X server binary.
</para>
</sect1>
<sect1id="ind_keyboards">
<title>Using independent keyboards with XFree</title>
<para>Once you install the Backstreet Ruby/ Ruby-2.6 kernel and start it with <option>dumbcon=n</option>, you get n +1 independent consoles [1 VGA(or Framebuffer under Ruby-2.6) + n DUMB] . If you have enough keyboards connected to your PC, each of these consoles are associated with a given keyboard. This enables you to start multiple X servers on each of the consoles, using the keyboard associated with the corresponding console for input. Hence you get multiple independent X servers with independent keyboards, which in turn make it possible for one single PC to be used by several local X users simultaneously.</para>
<para>To start X on a given console (using a given independent keyboard) you pass it the argument <command>vt[N]</command>, where N is a number from a given tty range.</para>
<para>Under Backstreet Ruby/ Ruby-2.6, each real console (VGA or Framebuffer) is represented by 16 tty's and each DUMB console by a single tty, as currently only a single real console (VGA or Framebuffer) is supported the resulting tty ranges are:</para>
<para>If you have 3 video cards, 3 keyboards, and you have started the Backstreet Ruby kernel with dumbcon=2, you can start 3 independent X servers for 3 simultaneous users with the following commands:</para>
<para>the XFree configuration files are normally /etc/X11/XF86Config-4 </para>
</listitem>
<listitem>
<para>For Red Hat, Gentoo, SuSE users:</para>
<para>the XFree configuration files are normally /etc/X11/XF86Config </para>
</listitem>
</itemizedlist>
</note>
<caution>
<title>Caution</title>
<para>Have in mind that for the older Preferred Bus ID XFree Server (version 1) you have to specify the desired graphic card with parameter <quote><commandmoreinfo="none">-prefbusid x:x:x</command></quote> where x:x:x is the Bus ID of the desired graphic card. 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]. If you omit this option the modified X server will act as a not modified/ standard XFree server and you wont be able to run multiple XFree instances at the same time.</para>
<para>For the 1st X server you can skip the <option>-xf86config /etc/X11/XF86Config-4[for your 1st video card]</option> argument. In this case, the default configuration file, <filename>/etc/X11/XF86Config-4</filename>, will be used.
<para>You can also setup your 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.
<para>To use an independent mouse for each of your independent X servers/sessions, you just have to modify the input section of the XFree configuration files to point to the proper device files.</para>
<para>There could be several reasons for not using DRI:</para>
<para></para>
<itemizedlist>
<listitem>
<para>As far I know only one graphic card in a system can use DRI.</para>
</listitem>
<listitem>
<para>The Nvidia closed source driver does not support DRI. </para>
</listitem>
</itemizedlist>
<para>In case one of this reasons applies to your system, you do not need different XFree configuration files for the different displays.</para>
<para>You can configure your system for Xinerama using the tools provided with your distribution and reading <ulinkurl="http://www.tldp.org/HOWTO/Xinerama-HOWTO/index.html">The Xinerama-HOWTO</ulink>, 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. </para>
<para>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 (well, this is actually needed only for the mouse devices, as the keyboard is managed through the <option>vt[n]</option> option).</para>
<para>If you have configured Xinerama in the following way:</para>
<programlisting>Section "ServerLayout"
Identifier "Simple Layout"
Screen "Screen 2"
Screen "Screen 1" RightOf "Screen 2"
InputDevice "Mouse1" "CorePointer"
InputDevice "Keyboard1" "CoreKeyboard"
EndSection</programlisting>
<para>To achieve multiple independent desktops you only have to add layout definitions for a single screen :</para>
<programlisting>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</programlisting>
<para>Which should result in these layout definitions:</para>
<programlisting>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</programlisting>
<para>Now you can start a single X server with option <option>-layout Xinerama</option> and enjoy the Xinerama desktop, or</para>
<para>You can start 2 independent X servers using <option>-layout first-Xserver</option> for the first, and <option>-layout second-Xserver</option> for the second. </para>
<para>Here you will learn how to configure your system for parallel use of Nvidia's GLX and XFree's DRI. If 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, and in the second, you can use the standard procedure for installing GLX.</para>
<para>With the open source driver it's almost impossible to bring up a secondary card, so we should use the closed source driver.</para>
</listitem>
<listitem>
<para>Why the Nvidia card? Currently these are the only available, affordable PCI video cards with some acceleration.</para>
</listitem>
<listitem>
<para>
I tried to use DRI on 2 parallel X servers, but it didn't work. I posted emails to XFree, DRI and lkml list, but I only got a single answer with no valuable information on my problem. I tried to run DRI on a Matrox G550 DH AGP & SiS63xx PCI, but when enabled for both cards, I got AGP errors. When enabled only for one of the cards, I got DRI up and running. Please, someone confirm or prove me wrong!
</para>
</listitem>
</orderedlist></para>
<para>I'll explain several ways to get configuration working for both Nvidia GLX and XFree86 DRI. There are probably a lot of other possibilities, and maybe these are not the simplest, but they are the ones I know to work.</para>
<para> The reasons why this is needed: <orderedlist>
<listitem>
<para>Nvidia should use a different module path for xf86: the glx extension module from Nvidia is incompatible with the one from XFree86.</para>
</listitem>
<listitem>
<para>Nvidia should use a different XF86Config file: because DRI should be disabled for Nvidia and enabled for others.</para>
</listitem>
</orderedlist>
</para>
<para>If you find a simpler way, please email it me and I'll include it.</para>
<para>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 a very complicated setup for the GL libraries. To use this setup you have to switch your configuration to XFree86's GL libraries.</para>
</caution>
<sect2>
<title>Example 1</title>
<para>This is the configuration that I use on my system (ATI AIW Radeon 7500 AGP and Nvidia TNT2 M64 PCI) XFree configuration files:</para>
<orderedlist>
<listitem>
<para>Create a directory <filenameclass="directory">/usr/X11R6/libNV</filename>:</para>
<para>Install the Nvidia driver and libraries in <filenameclass="directory">/usr/X11R6/libNV</filename>.</para>
</listitem>
<listitem>
<para>Install Nvidia's <filename>libGLcore.so.1.0</filename> [driver version], or better, <filename>libGLcore.so.1</filename>, in <filenameclass="directory">/usr/lib</filename>. Make a symbolic link from <filename>/usr/X11R6/libNV/libGLcore.so.1</filename> to <filename>/usr/lib/libGLcore.so.1</filename> (this will allow you to easily update your Nvidia drivers):</para>
<para>Note: the Nvidia <filename>libGL.so</filename> is installed <filenameclass="directory">/usr/X11R6/libNV</filename>, so it's invisible to the system unless you tell the system about the existence of <filenameclass="directory">/usr/X11R6/libNV</filename>. 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 the Nvidia graphic card and Nvidia closed source drivers, with a non-Nvidia graphic card, using XFree's DRI, which the GL library from Nvidia cannot do.</para>
</listitem>
<listitem>
<para>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:
<programlisting>
Section "Files"
..........
ModulePath "/usr/X11R6/libNV/modules"
..........
EndSection
</programlisting>
</para>
</listitem>
<listitem>
<para>Install the Nvidia kernel driver.</para>
</listitem>
</orderedlist>
<para>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.</para>
</sect2>
<sect2>
<title>Example 2</title>
<para>This example will give you the full performance of both the Nvidia card(s), and the
non-Nvidia card, since XFree's libGL is used for the non Nvidia card, and
Nvidia's libGL is used for Nvidia cards. But this will require one more X server to be precise;
a simple wrapper to add the path to the Nvidia libraries, and symbolic links to it for
additional Nvidia cards.</para>
<para>It is almost the same as the previous scenario, with the difference that the X servers
for the Nvidia cards should start with an 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.
</para>
<para>Install the Nvidia libraries and kernel driver like in the previous example.
You may skip step 4. as <filename>libGLcore.so.1</filename> is installed in <filenameclass="directory">/usr/X11R6/libNV</filename>, and we'll inform the X servers driving Nvidia cards about the proper path
to the Nvidia libraries.</para>
<para>The missing part - the wrapper :
<programlisting>
#!/bin/bash
export LD_LIBRARY_PATH=/usr/X11R6/libNV
exec /usr/X11R6/bin/X0 $*
</programlisting>
</para>
<para>Copy these lines into your favourite editor and save the file as <filename>XNV</filename>. Make it executable:</para>
<para><command>chmod +x XNV </command></para>
<para>Copy the file to <filenameclass="directory">/usr/X11R6/bin</filename> and make symbolic links to it for additional Nvidia cards (for additional cards just add more links):</para>
<screen>
cp XNV /usr/X11R6/bin
cd /usr/X11R6/bin
ln -s XNV Xnv0
ln -s XNV Xnv1
ln -s XNV Xnv2
</screen>
<para>Remember to use <filename>/usr/X11R6/bin/Xnv0</filename>, <filename>/usr/X11R6/bin/Xnv1</filename> ..., instead of <filename>/usr/X11R6/bin/X0</filename>, <filenameclass="directory">/usr/X11R6/bin/X1</filename> ... for your Nvidia cards while configuring the display managers in the next chapter, or when starting X on Nvidia card(s) from console.</para>
</sect2>
<sect2>
<title>Installing the Nvidia libraries easily</title>
<para>Using the new Nvidia installer (note, this is a work in progress, do not use if you don't understand what happens here. To-do: write a script to perform steps 1-4. Please provide some feedback on the script in Appendix->Scripts):
</para>
<para>Manually:
<orderedlist>
<listitem>
<para>Make a backup of your XFree GL libraries:</para>
<para>Copy the installed files to <filenameclass="directory">/usr/X11R6/libNV</filename>:</para>
<screen>
cd /usr/X11R6NV/lib && tar cv * | tar xvC /usr/X11R6/libNV/
</screen>
</listitem>
<listitem>
<para>Restore the backed-up GL libraries:</para>
<screen>
cd [XFree prefix]
tar xvfp libGL-backup.tar && ldconfig
</screen>
</listitem>
</orderedlist>
</para>
</sect2>
</sect1>
</chapter>
<chapterid="tweak_input_devs">
<title>More on configuring input devices</title>
<para>Here you will find more details on configuring input devices and dealing with secondary keyboard interfaces found in USB multimedia keyboards.</para>
<para>If you feel comfortable under Linux, please review and test the experimental service ruby_init. The service, the configuration file and the README can be found in Appendix D. Any kind of feedback is highly appreciated.
(Please, please drop a line with comments. :-) ) </para>
<para>If you are configuring a system with two displays( 2 keyboards, 2 mice) you probably can skip to <xreflinkend="dm_conf"/><quote>Configuring display managers</quote>, but if you want to use a single system for more users you will find really useful information in this chapter.</para>
</note>
<sect1id="tweak_input_devs-realDev">
<title>Finding the real devices</title>
<para>We will need this information later on, to be able to assign a given keyboard/mouse to a given X-server/Display.</para>
<para>To find the PHYS ID's (the addresses) or the name(quite oft it differs from the one labeled on the device) of your input devices you have to read the file <filename>/proc/bus/input/devices</filename>.</para>
<para><filename>/proc/bus/input/devices</filename> will provide the needed information for all devices except USB multimedia/office keyboards.</para>
</listitem>
<listitem>
<para>For such USB multimedia/office keyboards you will have to gather additional information, for example with the help of <command>lsusb</command>.</para>
<para>Here, my USB Logitech keyboard is Device 003 on Bus 003.</para>
</listitem>
<listitem>
<para>Now we run <command> lsusb</command> with arguments <parameter> -v -s [your USB keyboard device id in form Bus:Device]</parameter>, in my case, <command>lsusb -v -s 003:003</command>.</para>
<para>So my USB keyboard has two interfaces (see bInterfaceNumber); the first one is the real keyboard (bInterfaceProtocol 1 Keyboard), the second (bInterfaceProtocol 0 None) - the additional keys. Hence the real USB keyboard is:</para>
<programlisting>.....
N: Name="Logitech USB Keyboard"
P: Phys=usb-00:10.1-1.1/input0
H: Handlers=kbd
.....</programlisting>
<para>The <quote>P: Phys=</quote> field (the physical descriptor/address) consorts of:</para>
<title>Using hotplug with <filename>input.agent</filename> and <filenamemoreinfo="none">input.rc</filename></title>
<para>Using the input.agent will allow you to manage input devices based on their PHYS ID. </para>
<para>The input.rc script will run the input.agent with appropriate arguments for drivers that are built in the kernel or are loaded before hotplug is available. </para>
<para>The explanations here are using Backstreet Ruby ( usb devices have PHYS_ID "usb-00:xx.x-..."), if you are running Ruby-2.6 for usb devices you should have PHYS_ID "usb-0000:00:xx.x-...." , but you should be able to use the same configuration files both under Backstreet Ruby and Ruby-2.6 by specifying "usb-0*:xx.x-..." .</para>
<para>If you are using input drivers built into the kernel please ensure that the <filenamemoreinfo="none">input.rc</filename> script is started/executed at system start. In case the script is not executed you will find that hotplug could not configure these input devices. </para>
<para>This area requires user feedback. Currently I have information only about Mandrake, where hotplug is not run as service.</para>
</note>
<para>If your distribution runs hotplug as service this will be done automatically.</para>
<para>If your distribution does not run hotplug as service you will have to modify your init scripts to run <filenamemoreinfo="none">input.rc</filename> for you before XFree is started. </para>
<para>You may add this at the end of your <filenamemoreinfo="none">/etc/rc.d/rc.sysinit</filename><programlistingformat="linespecific">if [[ -f /proc/bus/console -o -n tmp=`uname -r | sed -n 's:ruby::p'` ]]; then
<para>if you have input devices with different names, to use them with the same Xserver/screen wherever you plug or re-plug them. </para>
</listitem>
<listitem>
<para>if you have input devices with the same names, to use them with the same Xserver/screen according to the USB port where you plug or re-plug them. </para>
</listitem>
<listitem>
<para> the ability to use wild cards such as <quote>*</quote> and <quote>?</quote>.</para>
<para>Currently hot-plugging doesn't seems to work properly. I have reports that it works when using the <quote>Dev Name</quote> option, but my primary purpose was to get it working with <quote>Dev Phys</quote> and this does not currently seem to work. <quote>Why "Dev Phys"?</quote> - because if one wants to setup a single system for 4,5 or more users it would be easier to get 4,5 or more pieces of the same keyboard/ mouse then to find the same number keyboards or mice but from different manufacturer or with different names, and i find configuring XFree for such number users is simpler when <quote>Dev Phys</quote> is used.</para>
<para>For this to work you will have to use XFree with the patches for event interface support, developed by Zephaniah Hull. You can find them at the following url: <ulinkurl="http://people.debian.org/~warp/evdev/">http://people.debian.org/~warp/evdev/</ulink>.</para>
<para>To build from source you will need the following patches :</para>
<para>For hot-plugging you will also need the <filename>/etc/hotplug/input.agent</filename> , which you can find under the above address and in Appendix Scripts </para>
<para>For Dev Name and Dev Phys, the wildcats <quote>?</quote> and <quote>*</quote> work, you MUST have at least one of the two, if you have both then the device must match on both, a non-existent entry is the same as one consisting of <quote>*</quote>.</para>
<title>Using the <quote>Phys</quote> descriptor and USB devices</title>
<para>Using the <quote>Phys</quote> descriptor of input devices simplifies a lot the configuration of input devices in XFree, especially when a bigger number of displays are used.</para>
<para>As USB devices are connecting in a tree form, you can really easy specify the way keyboard and mice devices are bound to a specified X display. You have to use one USB hub with number of ports equal(or bigger) to the number of the X displays, to this hub are connected smaller (2-4 port) hubs (or keyboards with integrated hub). To the first port of the smaller (integrated) hub are connected the keyboards, to the second the mice (in case there are free ports you can connect usb-audio devices to them :) ). This results in the following layout of the usb-id's in case the primary USB hub is the first USB device :</para>
<para>In the following explanations and examples I use for first device on the secondary(integrated) hub keyboard device because my keyboard is internally connected to the 1st port of the integrated hub. I assume this will apply for most of the keyboards with integrated hub, but in case the one you own uses different port you will have to make small adjustments.</para>
<para>Here the PCI function of the USB controller is masked by *.* so it should work both under Backstreet Ruby and Ruby-2.6 . If you use more then one USB controller you'll have to use different mask ( for example "usb-0*:xx.x-...") or specify the full PHYS_ID's : .</para>
<para>For Backstreet Ruby you should have PHYS_ID "usb-00:xx.x-..."</para>
<para>For Ruby-2.6 you should have PHYS_ID "usb-0000:00:xx.x-...." </para>
<para>We'll use the <quote><command>vt[n]</command></quote> parameter when starting X and the following configuration file for the keyboards(<filenamemoreinfo="none">/etc/hotplug/kbd.conf</filename> ):</para>
<para>and we have to adjust the XFree configuration files, so XFree uses the symbolic links instead of the actual devices. If you already configured independent mice you have only to append <quote>br</quote> to each of the mouse devices.</para>
<para>Change each <quote>/dev/input/mouse[n]</quote> to <quote>/dev/input/mouse[n]br</quote>.</para>
<title>... with XFree with event interface support</title>
<para>Using the <quote>Dev Phys</quote> option of XFree with event device support and USB input devices enables us to use almost identical configuration of the input devices for all X servers. The only difference will be in the part of the usb-id, which reflects the port of the primary USB hub.</para>
<para>The examples below are for multiple XFree configuration files, if you use a single XFree configuration file you have to adjust the identifiers.</para>
</note>
<para>The configuration for the input devices for the 1st display would look something like this:</para>
<para>If you have successfully finished the installation and configuration of the kernel and XFree, it's time to configure your display manager(s).</para>
<para>Beside the graphical differences, xdm/kdm and gdm handle the X servers differently. Gdm will start the X servers in the order specified in it's configuration file (and stop them in the reverse order). Xdm/kdm will start and stop all the X servers at the same time(in case there are no opened X sessions). Also, restarting the gdm daemon means end for all X sessions, but if you restart xdm/kdm when you are under X, your session won't be closed.</para>
<para>Using gdm could help you to retain the VGA console and prevents lock-ups with some graphic cards (check the compatibility list).</para>
</listitem>
<listitem>
<para>Using xdm/kdm allows you to switch it's configuration retaining your opened X session(of course the changes shouldn't affect the X server you are using).</para>
<para>Have in mind that for the older Preferred Bus ID XFree Server (version 1) you have to specify the desired graphic card with parameter <quote><command>-prefbusid x:x:x</command></quote> where x:x:x is the Bus ID of the desired graphic card. 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].</para>
<para>If everything is working now, it's time to setup the automatic starting of X on all displays. For xdm and kdm you have to modify one single file. For a Red Hat-like system this would be <filename>/etc/X11/xdm/Xservers</filename>; for other distributions check whether this file exists. If not, find your XFree86 configuration directory, and in it you'll find <filename>xdm/Xservers</filename>. </para>
<para><filenamemoreinfo="none">/etc/X11/xdm/Xservers</filename> for xdm</para>
</listitem>
<listitem>
<para><filenamemoreinfo="none">/etc/opt/kde3/share/config/kdm/Xservers</filename> for kdm </para>
</listitem>
</itemizedlist>
<para>you can make a backup copy of <filenamemoreinfo="none">/etc/opt/.../kdm/Xservers</filename> and make a symbolic link from <filenamemoreinfo="none">/etc/X11/xdm/Xservers</filename> to <filenamemoreinfo="none">/etc/opt/../kdm/Xservers</filename>, in order to use the same configuration file for xdm and kdm.</para>
<para><filenamemoreinfo="none">/etc/kde3/kdm/Xservers</filename> for kdm </para>
</listitem>
</itemizedlist>
<para>you can make a backup copy of <filenamemoreinfo="none">/etc/kde3/kdm/Xservers</filename> and make a symbolic link from <filenamemoreinfo="none">/etc/X11/xdm/Xservers</filename> to <filenamemoreinfo="none">/etc/kde3/kdm/Xservers</filename>, in order to use the same configuration file for xdm and kdm.</para>
<para>For every additional X server you should add a single line. You can copy the existing line, change the X server binary and display number, and append <option>-xf86config</option> [your configuration file]. My original xdm/Xservers:
<para>Gdm, as a complete rewrite of xdm, uses its own configuration file, <filename>/etc/X11/gdm/gdm.conf</filename>. You should locate the definitions of the local X servers and add additional X servers for the number of cards you have.
<para><filenamemoreinfo="none">/etc/gdm/gdm.conf</filename> for gdm </para>
<para><filenamemoreinfo="none">/etc/X11/gdm/</filename> is a symbolic link to <filenamemoreinfo="none">/etc/gdm/</filename>, so you can use both paths. </para>
<para>In case you do not use devfs, you may need to create additional device files. Take a look at <ulinkurl="http://www.tldp.org/HOWTO/Sound-HOWTO/index.html">The Linux Sound HOWTO</ulink>, for information on how to setup additional sound cards.</para>
<para>We have to specify different sound devices for the different Xsessions/Displays. This is done by using the following options of aRts daemon (<ulinkurl="http://www.arts-project.org/">http://www.arts-project.org/</ulink>):</para>
<para>Copy <filename>/etc/X11/xdm/Xsetup_0</filename> to <filename>/etc/X11/xdm/Xsetup_1</filename>. For additional X servers, create the file(s) <filename>/etc/X11/xdm/Xsetup_[n]</filename>, where n is the number of the X server starting from 0.</para>
<orderedlist>
<listitem>
<para>Modify the line containing the background image, to adjust the path to your image for the 2nd X server:</para>
<programlisting>
....
if [ -r /usr/share/mdk/backgrounds/default.png -a -x /usr/bin/qiv ]; then
<para>Repeat the procedure for each additional X server.</para>
</listitem>
<listitem>
<para>Check here for additional customising options: <ulinkurl="http://www.linuxjournal.com/article.php?sid=3325">Linux-Journal Issue 68: Linux Apprentice: Customising the XDM Login Screen</ulink>.</para>
</listitem>
</orderedlist>
</sect2>
<sect2>
<title>Using kdm</title>
<para></para>
<itemizedlist>
<listitem>
<para>I'm not really sure. This area requires feedback. </para>
<para>Check for additional customising options at the KDE Help Center.</para>
</listitem>
</itemizedlist>
</sect2>
<sect2>
<title>Using gdm</title>
<para>This requires <filename>gdmlogin</filename> to be used instead of <filename>gdmgreater</filename>, because using different themes for different displays is not yet implemented in gdm. In case you want to use gdm themes you'll have the same theme on all displays.</para>
<orderedlist>
<listitem>
<para>Switch to gdmlogin by making this changes in <filename>/etc/X11/gdm/gdm.conf</filename></para>
<para>From:</para>
<programlisting>.....
# Greeter for local (non-xdmcp) logins. Change gdmlogin to gdmgreeter to
# get the new graphical greeter.
Greeter=/usr/bin/gdmgreeter
.....
</programlisting>
<para>to </para>
<programlisting>.....
# Greeter for local (non-xdmcp) logins. Change gdmlogin to gdmgreeter to
# get the new graphical greeter.
Greeter=/usr/bin/gdmlogin
.....</programlisting>
</listitem>
<listitem>
<para>Copy the file <filename>/etc/X11/gdm/Init/Default</filename> to <filename>/etc/X11/gdm/Init/:0</filename>, and <filename>/etc/X11/gdm/Init/:1</filename></para>
</listitem>
<listitem>
<para>Add these lines to use the background that kdm uses (you can use another image file as well, just change the full path to it):</para>
<programlisting>
if [ -r /usr/share/mdk/backgrounds/default.png -a -x /usr/bin/qiv ]; then
<para>Repeat the procedure for each additional X server, using file(s) <filename>/etc/X11/gdm/Init/:[n]</filename>, where n is the number of the display.</para>
</listitem>
<listitem>
<para>Check here for additional customising options: <ulinkurl="http://www.ibiblio.org/oswg/oswg-nightly/oswg/en_US.ISO_8859-1/articles/gdm-reference/gdm-reference/">Gnome Display Manager Reference Manual</ulink>.</para>
</listitem>
</orderedlist>
</sect2>
</sect1>
<sect1id="first_x_server">
<title>1st X server configuration file</title>
<para>A small part of the Mandrake init scripts <filename>/etc/rc.d/rc.sysinit</filename> (you can append it to yours if you are missing something similar):</para>
<para>Move your <filename>XF86Config-4</filename> file (the one for standard kernel) to <filename>XF86Config-4.standard</filename>, create a symbolic link from it to <filename>XF86Config-4</filename>, and move the <filename>XF86Config-4</filename> file (the one for Backstreet Ruby) to <filename>XF86Config-4.bruby</filename>. For Ruby/Backstreet Ruby kernels, add to the append line in <filename>/etc/lilo.conf</filename>, or on boot prompt <quote>XFree=bruby</quote>, leave the standard kernel as is.</para>
<para>Results:</para>
<para>Booting with <quote>XFree=standard</quote> or without <quote>XFree=</quote> (boot prompt or <filename>lilo.conf</filename>) will result in linking <filename>XF86Config-4.standard</filename> to <filename>XF86Config-4</filename>; booting with <quote>XFree=bruby</quote> will link <filename>XF86Config-4.bruby</filename> to <filename>XF86Config-4</filename>, so in both scenarios XFree can be started with the proper configuration file for the first X server.</para>
<para>And what about the other X servers?</para>
<para>Under a standard kernel you cannot use several independent X servers, so you should use the other XFree configuration files only under Ruby/Backstreet Ruby - there is no need for different configuration files under standard & bruby kernels.</para>
</sect1>
<sect1id="auto_dm_confs">
<title>Number X servers started by Display managers</title>
<para>Here is a modified version of the previous approach. Add this to your init scripts (I bet it's missing!):</para>
<para>This will adjust the proper <filename>/etc/X11/xdm/Xservers</filename> and <filename>/etc/X11/gdm/gdm.config</filename> according to the boot line argument dumbcon=n (remember n+1= number of X users/sessions).</para>
<para>You have to create the configuration files following these assumptions:</para>
<para><quote>i</quote> only stands for <filename>/etc/X11/xdm/Xserver</filename> and <filename>/etc/X11/gdm/gdm.conf</filename>.</para>
<itemizedlist>
<listitem>
<para><quote>i.0</quote> is used for a single X server, when dumbcon=n is not specified, or dumbcon=0.</para>
</listitem>
<listitem>
<para><quote>i.1</quote> is used by the display manager when dumbcon=1 is specified.</para>
</listitem>
<listitem>
<para><quote>i.2</quote> is used by the display manager when dumbcon=2 is specified.</para>
</listitem>
<listitem>
<para><quote>i.3</quote> is used by the display manager when dumbcon=3 is specified.</para>
</listitem>
</itemizedlist>
<para>...and so on.</para>
<para>Therefore:</para>
<itemizedlist>
<listitem>
<para><quote>i.0</quote> should contain the definition only of your original standard X server.</para>
</listitem>
<listitem>
<para><quote>i.1</quote> should contain the definitions for 2 X servers.</para>
</listitem>
<listitem>
<para><quote>i.2</quote> should contain the definitions for 3 X servers.</para>
</listitem>
<listitem>
<para>...and so on.</para>
</listitem>
</itemizedlist>
<para>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.</para>
<para>If you start with dumbcon=1 the display manager will automatically start 2 X servers.</para>
<para>If you start with dumbcon=2, when booting is finished you'll get 3 login prompts on your
3 displays.</para>
<para>Keep 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 an activated display manager and this addition to your init scripts.</para>
<para>This can also be used if you have a single XFree configuration file (see <xreflinkend="no_dri"/>, <quote>For graphic cards without DRI</quote>). In this case you will have to specify the correct layout instead of the correct XFree configuration file.</para>
<para>There is a very experimental GUI/CLI for dynamically switching the number of running X servers. It uses the automatic configuration of the display managers (mentioned in <xreflinkend="auto_dm_confs"/>), Python, dialog for the CLI, and Xdialog for the GUI.</para>
<para>Once it is more tested and bug-free, you could, for example, use it under Backstreet Ruby to switch between 2, 3 or more X servers and a single X server using Xinerama. So when your PC isn't used by more then one user, you could use the other monitors under Xinerama. Or one more funny example: you're 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/mouse pair. One friend of yours comes and says, <quote>Hey guys, that's cool. Can I join?</quote> What would you answer? Using the GUI could result in the following answer from your side: <quote>No problem, just bring your monitor,keyboard and mouse.</quote></para>
<para>If you are feeling like a hacker and want to try out this BUGGY GUI/CLI, check the current status at <ulinkurl="http://karlovo.demon.co.uk/~svetlio/ruby-contrib/bruby-python/">http://karlovo.demon.co.uk/~svetlio/ruby-contrib/bruby-python/</ulink>. But remember, it's not very tested, and if not configured properly it can cause you serious troubles. Please wait until it is more stable if you are not that familiar with Linux. If you feel comfortable enough under Linux, and think of yourself as a hacker, please help in testing it and making it better, bug-free and easy to configure.
<para>While not exactly problems, some graphic cards do not work well, or even at all in multi-user environments.</para>
<para>If you are building such a system from the beginning, check the Video Compatibility list before buying video hardware.</para>
<para>Sometimes secondary graphic card(s) (for now reported only by Nvidia owners) will refuse to start, even if they have worked flowlessly for months. One of the following sollutions should fix the problem:</para>
<para>Running <command>/usr/X11R6/bin/X -probeonly</command> on the secondary card(s) before initializing/ starting XFree on the primary graphic card.</para>
<para>Switching the secondary graphic card to primary, starting the system (to initialize the card as primary), and reverting the card to secondary.</para>
<para>You should change the lines including <quote><filename>/dev/tty[0-8]</filename></quote> to <quote><filename>/dev/tty[0-7]</filename></quote>.</para>
<para>Replacing <filename>sysfont</filename> with <filename>consolechars</filename>.</para>
<para>< needs to be written ></para>
<para>Rebuild <filename>console-tools-19990829-40.src.rpm</filename> using <command>rpmbuild --rebuild console-tools-19990829-40.src.rpm</command>. You can find the source rpm on <ulinkurl="http://www.rpmfind.net"></ulink>).</para>
<para>This can be acomplished by manually starting X or using gdm as desktop manager. You'll have to abstain from using xdm or kdm, as they start the X servers at the same time.</para>
<para>The XFree-4.3-prefbusid patch/binary fixes most of the problems. In case the X servers are started in the right order there are no lock ups.</para>
<title><filenamemoreinfo="none">README.ruby_init</filename> explains how to configure and use the service.</title>
<programlistingformat="linespecific">well,
have to be written :-)
You'll need to install the following scripts :
(and don't forget to make them executable :-) with chmod a+x [filename] )
/etc/hotplug/input.agent
/etc/hotplug/input.rc
/etc/init.d/ruby_init
and the configuration file:
/etc/sysconfig/ruby.conf
edit the configuration file to adjust it to your system configuration
start the service and check if everything is done as requested and configured
/etc/init.d/ruby_init start
if everything is OK activate the service by running "chkconfig --add ruby_init" .
"chkconfig --list ruby_init" will tell you in which runlevels the service is active
root@svetljo SRPMS]# chkconfig --list ruby_init
ruby_init 0:off 1:off 2:on 3:on 4:on 5:on 6:off
you can deactivate it by running "chkconfig --del ruby_init"
The input configuration uses the same syntax
as kbd.conf, mouse.conf, event.conf as explained
in the section about hotplug with input agent.
The other configurable options are:
HACK_VIDEO_ENABLE=no
If set to "yes", turns on at boot the hackvideo feature of the Backstreet Ruby kernel.
In case XFree PrefBusID is used set to "no"
HOTPLUG_RC_input=yes
If set to "yes", runs /etc/hotplug/input.rc to configure input devices which were activated
by the kernel before hotplug was available (drivers statically linked in the kernel).
Generaly needed by all systems unless you have all input drivers configured as loadable modules
and load the drivers after hotplug is accessible to the kernel.
AUTO_DM=no
AUTO_XFree=no
No description yet. Or may be ...
enables/disables the features explained in sections
"7.3. 1st X server configuration file" and "7.4. Number X servers started by Display managers"
you don't need to modify your init scripts if you use the ruby_init service and enable them
in ruby.conf.
LOAD_MODULES=yes
if set to "yes" loads certain input device drivers in case a ruby kernel is running.
#
# input modules configuration
#
# module arguments
The list of modules which should be loaded in case ruby kernel is running and
LOAD_MODULES is set to "yes".
In the example file are listed all important input drivers (keyboards & mice).
If you have some of them compiled in the kernel, you may disable the loading
of the corresponding drivers by commenting them out.
the ext-status argument can give you detailed information about the current
configuration, and valuable information in case you are in trouble. </programlisting>
</sect1>
<sect1id="app_ruby_init_ruby_conf">
<title>The global configuration file <filenamemoreinfo="none">/etc/sysconfig/ruby.conf</filename></title>
<para>In <filenamemoreinfo="none">/etc/sysconfig/ruby.conf</filename> are stored all configuration options for the Input subsystem of a Backstreet ruby kernel and wether certain actions/ services should be run when such kernel is used. </para>