Linux Step By Steps
Dual-head display with Xinerama

Written by Ian Stephen on 15-September-2003.


The Xinerama extension in XFree86 is not enabled by default.  You can specify it when starting X from the console with 'startx - +xinerama'.  I haven't used Multihead (ie startx -- -layout Multihead), but as I understand it Xinerama is not the same as Multihead.  With Multihead you have two (or more) displays that work independently.  With Xinerama two (or more) displays work as one.

For example, using Xinerama with two monitors side by side, each 1024x768, gives an effective display size of 2048x768.  The mouse moves freely between displays and you can drag windows between them at will or even straddle both.  Older versions of OpenOffice.org Impress used to take both displays when running slide shows in full screen mode, but that seems to have been fixed in recent versions (or maybe it's improvements in XFree86).

My PC came with on-board AGP video using 16 MB shared memory and an IBM C51 monitor.   I added a used PCI video card with 4 MB memory for $10 Cdn and a used 15" VGA monitor for $50 Cdn.  For anything other than games this setup works just fine.

I was already using Red Hat 8, which uses /etc/X11/XF86Config-4 for X configuration.  Some distros might use XF86Config.  Whatever yours uses, back it up first!  Your original XF86Config-4 is your starting point.  Make a working copy with a handy name.  To it you need to add a few things for the new hardware.  I'll enclose specific stuff to add in angle braces < like this >.

In the ServerFlags section add < Option "Xinerama" "true" >

You may want to leave the ServerFlags bit till later and just use 'startx - +xinerama' while you are experimenting.

In the ServerLayout section you should have "Screen       0  "Screen0"  0  0

                                                           add   < "Screen      1  "Screen1" RightOf "Screen0" >

The 'RightOf' could also be 'LeftOf', 'Above', 'Below', 'Relative' or 'Absolute'.  If you use 'Relative' or 'Absolute' you must provide coordinates.
See http://www.xfree86.org/4.2.0/DESIGN2.html

You will need to add a second Monitor section.  Use your existing one as an example.  If you don't have specs for your monitor, Google does.  Just search for the model name or any other identifying numbers or names on it.  It is important to enter the right values for horizontal sync and vertical refresh (HorizSync and VertRefresh) as too high values can fry your monitor.  Remember as root you can destroy things.  If in doubt be conservative.

You need to add a Device section for the second video card.  What to put there may be a mystery.  Again Google knows all.  Search for any numbers or names you find on the card and you'll probably figure out what it is.  Another handy technique is to run one of the X configuring tools, Xconfigurator, XF86config, XF86cfg, XFree86Setup or what have you.  Take the useful bits out of the file it produces and incorporate them into the configuration file you are building.  If you have XF86config (for example) pick a driver for the card, you can get more info on the options for that driver at www.xfree86.org

Lastly you need a second Screen section for the second card and monitor.  If the first components on the system were idenfied in the Device, Monitor and Screen sections as Card0, Monitor0 and Screen0 (most drivers require the '0' devices be present) you can probably just copy your old Screen section, change the identifiers there to Screen1, Card1, Monitor1 (make sure these are matched in the relevant Device and Monitor sections) and go.

Test your new configuration file by using 'XFree86 -xf86config <path/workingfilename>' as root.  If it succeeds and you get a plain blue (mine's blue anyway) screen with an 'X' cursor you're in business.  Press Crtl - Alt - Backspace to kill X.  Rename your original XF86Config-4 to something else and rename your working file to XF86Config-4.  Don't forget to put it in the right directory if it isn't already there.  Now 'startx' and hopefully you are rewarded with a fully functional dual-head Linux machine!

Second video card - $10, second monitor - $50,  two applications full-screen at once - priceless!