This document is available for free, and, while I have done the best I can to make it accurate and up to date, I take no responsibility for any problems you may encounter resulting from the use of this document.
The purpose of this document is to provide a basic guide for using multiple monitors under X in Linux.
Are able to Install PC hardware.
1.3 Requirements
There are a few things this project requires:
1. At least two supported graphics cards (AGP or PCI).
2. At least two supported SVGA monitors.
3. The most current version of XFREE86.
4. A running and stable X Server.
5. A Current, stable system.
________________________________________________________________________
2. Setup
2.1 Hardware
When you set out to acquire your monitors and video cards make sure that they are Linux compatible. I have found that Nvidia chipset graphics cards work quite nicely (GeForce Line) as they are quite Linux friendly. They are also fairly inexpensive which is a plus. If you wish to use ATI cards be sure to stay away from older models as some of them tend not handle acceleration under X very well. If you decide to go the dual-head route you cannot beat Matrox.
Mixing AGP and PCI cards doesn't matter. You will see why. If they are of the same chipset or use the same drivers you will make your life a lot easier.
You will need a monitor for each card (or for each port on dual-head models). Again, having all of your monitors the same will make the setup very easy. If you want to run a X session on each monitor then you can use any SVGA monitor you want since different resolutions will not matter. If you plan to run an extended/expanded desktop using xinerama, then I highly recommend that you use monitors that are capable of running the same resolution. If you run an expanded desktop and use monitors running different resolutions then your desktop will not look as good. Well, in my opinion.
Install your cards. It is much easier to install and configure a single card first. That way you have a good XF86Config file to edit. XF86Config is usually located in /etc/X11.
After installing your cards you will need to gather information from the PCI bus. Multiple head setup require that each video card be uniquely identified. So from a command line run this command, as root:
lspci -v or lspci -v > textfile (output to file)
You should get a listing of your pci bus. Here is an example of what a video card listing will look like:
01:00.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 440 Go] (rev a3) (prog-if 00 [VGA])
Subsystem: Dell Computer Corporation: Unknown device 00d5
Flags: bus master, VGA palette snoop, 66Mhz, medium devsel, latency 248, IRQ 11
Memory at fc000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (32-bit, prefetchable) [size=128M]
Memory at dff80000 (32-bit, prefetchable) [size=512K]
Expansion ROM at 80000000 [disabled] [size=128K]
Capabilities: [60] Power Management version 2
Capabilities: [44] AGP version 2.0
The identifier for the card is 01:00.0 and is an AGP card. The cards identity will then translate into AGP:1:0:0
2.2 /etc/X11/XF86Config
Your X configuration file will usually be located either in /etc or /etc/X11. Depending on your distribution it may reside elsewhere. So far you should have all of the necessary hardware installed, know your card information, and a workable X server (pre-configured before using this document). Now it is time to edit the XF86Config file.
Open the file using your favorite editor. I personally use vi. The order of the following config sections may differ depending on your distribution.
2.3a Server Layout Section
This section describes your screens, layout, and input devices. This is also where you set up the relationship between multiple screens.
Section "ServerLayout"
Identifier "Multi Head"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
# InputDevice "Mouse1" "SendCoreEvents"
InputDevice "Keyboard0" "CoreKeyboard"
Screen 1 "Screen1" RightOf "Screen0"
EndSection
As you can see there are entries for two screens, 0 and 1. You should only need to add the second screen. You must also tell Screen 1 its relationship to Screen0. I have mine to the right, using the entry RightOf. Other possible choices are LeftOf, Above, and Below. Adding other screens is easy. Just add a Screen 2, Screen 3, and so on.
2.3b Section Device
This section is where you identify your video cards. Note the Bus ID and add the cards that you need. Set up a section for each device.
Section "Device"
# no known options
Identifier "NVIDIA GeForce 4 (440 GO MX)"
Driver "nvidia"
VendorName "NVIDIA GeForce 4 (440 GO MX)"
BoardName "NVIDIA GeForce 4 (440 GO MX)"
BusID "AGP:1:0:0"
EndSection
2.3c Section Screen
Here is where you Identify your screens and associate your monitors and video cards to them. You may use different resolutions for each display but the color depth must be the same. Set up a section for each screen.
Section "Screen"
Identifier "Screen0"
Device "NVIDIA GeForce 4 (440 GO MX)"
Monitor "Dell 20 inch LCD Panel"
DefaultDepth 16
Subsection "Display"
Depth 16
Modes "1600x1200"
EndSubsection
EndSection
2.4 Running X
Installation from RPM:
Your configuration should now be finished. Simply type:
startx
Using just that command will put a separate X session on each monitor. Each session can be configured separately and each has its own settings.
If you want to run an expanded, virtual desktop then you will need to use the xinerama extension. This is useful fir stretching your desktop and allow you to run those "centerfold" backgrounds. To run the stretch X, simply type:
startx -- +xinerama
You may want your desktop environment to start with the xinerama extensions.
For Gnome, edit gdm.conf and look for the command=/usr/X11R6/bin/X then add +xinerama to the end of it. You ma need to use -- +xinerama instead. The same thing will work for KDE also. Edit the /usr/share/config/kdm/Xservers file (or whatever file your KDM uses) and the same thing to the end of :0 local /usr/X11R6/bin/X.
________________________________________________________________________
3. Conclusion
3.1 The conclusion
Well, that's about it in a nutshell. Hopefully this gave some people insight on using multiple monitors under the Linux operating system. This document isn't aimed at the Newbie market. If I did this would be extremely long. Besides, a little bit of research never hurt anyone...
I tested my configuration using RedHat 7.2 through RedHat 8.0 and have used both the Gnome and KDE desktop environments. The example XF86Config is from a RedHat 8.0 install.
________________________________________________________________________
4. Example XF86Config
4.1 Config example
# File generated by anaconda.
Section "ServerLayout"
Identifier "Multi Head"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
# InputDevice "Mouse1" "SendCoreEvents"
InputDevice "Keyboard0" "CoreKeyboard"
Screen 1 "Screen1" RightOf "Screen0"
EndSection
Section "Files"
# The location of the RGB database. Note, this is the name of the
# file minus the extension (like ".txt" or ".db"). There is normally
# no need to change the default.
RgbPath "/usr/X11R6/lib/X11/rgb"
# Multiple FontPath entries are allowed (they are concatenated together)
# By default, Red Hat 6.0 and later now use a font server independent of
# the X server to render fonts.
FontPath "unix/:7100"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "fbdevhw"
# Load "dri"
Load "glx"
Load "v41"
Load "record"
Load "freetype"
Load "type1"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
# Option "AutoRepeat" "500 5"
# when using XQUEUE, comment out the above line, and uncomment the following line
# Option "Protocol" "Xqueue"
# Specify which keyboard LEDs can be user-controlled (eg, with xset(1))
# Option "Xleds" "1 2 3"
# To disable the XKEYBOARD extension, uncomment XkbDisable.
# Option "XkbDisable"
# To customise the XKB settings to suit your keyboard, modify the
# lines below (which are the defaults). For example, for a non-U.S.
# keyboard, you will probably want to use:
# Option "XkbModel" "pc102"
# If you have a US Microsoft Natural keyboard, you can use:
# Option "XkbModel" "microsoft"
#
# Then to change the language, change the Layout setting.
# For example, a german layout can be obtained with:
# Option "XkbLayout" "de"
# or:
# Option "XkbLayout" "de"
# Option "XkbVariant" "nodeadkeys"
#
# If you'd like to switch the positions of your capslock and control keys, use:
# Option "XkbOptions" "ctrl:swapcaps"
Option "XkbRules" "xfree86"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
#Option "XkbVariant" ""
#Option "XkbOptions" ""
EndSection
Section "InputDevice"
Identifier "Mouse0"
# Modified by mouseconfig
Driver "mouse"
Option "Device" "/dev/mouse"
Option "Protocol" "IMPS/2"
Option "Emulate3Buttons" "yes"
Option "ZAxisMapping" "4 5"
EndSection
# Section "InputDevice"
# Identifier "Mouse1"
# Driver "mouse"
# Option "Device" "/dev/input/mice"
# Option "Protocol" "IMPS/2"
# Option "Emulate3Buttons" "no"
# Option "ZAxisMapping" "4 5"
# EndSection
Section "Monitor"
Identifier "Dell 20 inch LCD Panel"
VendorName "Dell Computer Corp"
ModelName "Dell 20 inch LCD Panel"
HorizSync 31.5-90.0
VertRefresh 59.0-85.0
Option "dpms"
EndSection
Section "Monitor"
Identifier "ViewSonic VE150"
VendorName "ViewSonic"
ModelName "VE150"
HorizSync 31.5-82.0
VertRefresh 50-70
Option "dpms"
EndSection
Section "Device"
# no known options
Identifier "NVIDIA GeForce 4 (440 GO MX)"
Driver "nvidia"
VendorName "NVIDIA GeForce 4 (440 GO MX)"
BoardName "NVIDIA GeForce 4 (440 GO MX)"
BusID "AGP:1:0:0"
EndSection
Section "Device"
Identifier "Nvidia GeForce2 MX"
Driver "nvidia"
BoardName "Unknown"
BusID "PCI:3:1:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "NVIDIA GeForce 4 (440 GO MX)"
Monitor "Dell 20 inch LCD Panel"
DefaultDepth 16
Subsection "Display"
Depth 16
Modes "1600x1200"
EndSubsection
EndSection
Section "Screen"
Identifier "Screen1"
Device "Nvidia GeForce2 MX"
Monitor "Viewsonic VE150"
DefaultDepth 16
Subsection "Display"
Depth 16
Modes "1024x768"
EndSubSection
EndSection
# Section "DRI"
# Mode 0666
# EndSection
Other Linuxlookup guides can be found here.