Install and configure Matrox dual head video card for Xinerama under Ubuntu 6.10 (Edgy)

Edit xorg.conf to enable dual head (2 monitor) use.

As with any installation on any computing platform, it is good practice to ensure important data is backed up in case unforeseen difficulties arise.
Review all instructions on this page before you begin.

Page dependencies (ensure you have access to everything you need before you begin).
Commands issued at the command prompt in this section are done so as superuser or root unless otherwise specified. When installed, Ubuntu does not ask for a root password to be specified. Either set a root password using sudo passwd root so that you can log in as superuser, or enter the commands listed in this guide prefixed with 'sudo'.

Text file editing from the command line.
This guide uses the Nano application for text editing because of its simplicity. Alternative text editors are available. Basic Nano key combinations to remember are CTRL-O to save and CTRL-X to exit.

Page format.
Text in this format indicates command line entry by the user.
Text in this format indicates an error returned by the system.
Text in this format indicates a normal return from the system.
Beware of similar characters such as 1(one), l(lowercase L), 0(zero), O(uppercase 'o'), | (pipe – Shift ' \ ' usually).
Text enclosed in [square brackets] indicates a build-specific variable such as a version number or user name.

This page was written for Ubuntu 6.10 (Edgy) and may contain content or instructions that are not relevant to other distributions.
This information is provided for guidance only. Use of these instructions is deemed to be at your own risk.
R3UK Limited welcomes comment on this information but cannot guarantee a reply and provides no technical support. Please use one of the many dedicated Linux forums or IRC channels if you require assistance.
Text colours and fonts used in the formatting of this page relating to command input and output are used for illustration purposes. Actual command line colours and fonts will vary according to individual system preferences.
GUI instructions were written for the Gnome 2.14 desktop environment and may differ for other desktop environments.

I have two monitors connected to my Compaq desktop using a PCI Matrox G450 dual head graphics card. One is a primary monitor that holds the task bar, the other is a secondary screen for some extra desktop space. Obviously the point of this set up is that my desktop area is twice the size of normal allowing two full-screen applications to be visible at any one time with applications or windows able to be dragged and dropped between the screens.

While the built-in Matrox 'mga' driver in Edgy can be set to drive both screens, setup isn't always obvious (there is nowhere in the GUI for the feature to be enabled). As such, I list the changes made to xorg.conf here which got it all working for me (kind of)....

Firstly, backup your existing xorg.conf so that you may revert to it if it all goes wrong!
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

Now find out the BUS ID of your graphics card with the lspci command. If the output doesn't fit on one screen, use lspci | less and press the space bar to scroll through the pages. It should return something like this...
06:00.0 VGA compatible controller: Matrox Graphics, Inc. G400/G450 (rev 85)

Next, open xorg.conf for editing (use your favourite text editor, vi, nano, vim, etc.)

The first change to xorg.conf is to amend the existing 'Device' section. We're going to add a second device section so start by setting the identifier of the existing one so that it can be differentiated from the new one. Also add a 'screen' setting. My first device section looks as below (text in blue indicates existing settings, green indicates amendments I have made....)

Section "Device"
Identifier "Matrox Graphics, Inc. MGA G400 AGP 1"
Driver "mga"
BusID "PCI:6:0:0" #use the BUS ID you found earlier!
Option "OldDmaInit" "True"
Screen 0

Now create a new Device section under this first one. Only the identifier and screen section will change as below...

Section "Device"
Identifier "Matrox Graphics, Inc. MGA G400 AGP 2"
Driver "mga"
BUSID "PCI:6:0:0"
Option "OldDmaInit" "True"
Screen 1

Similarly, the Monitor section also needs to be duplicated and differentiated....

Section "Monitor"
Identifier "DELL E171FP 1"
Option "DPMS"

Section "Monitor"
Identifier "DELL E171FP 2"
Option "DPMS"

Next, the existing Screen section needs to be given a unique identifier and associated with the first device and first monitor sections...

Section "Screen"
Identifier "Default Screen 1"
Device "Matrox Graphics, Inc. MGA G400 AGP 1"
Monitor "DELL E171FP 1"
DefaultDepth 24

A second Screen section needs to be added, named and associated with the second device and monitor sections...

Section "Screen"
Identifier "Default Screen 2"
Device "Matrox Graphics, Inc. MGA G400 AGP 2"
Monitor "DELL E171FP 2"
DefaultDepth 24

The following lines need to be amended/added to the ServerLayout section to define the layouts of the monitors...

Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen 1"
Screen "Default Screen 2" RightOf "Default Screen 1"

Finally Xinerama needs to be enabled by adding the following section

Section "ServerFlags"
Option "Xinerama"

Setting up the above options did involve some trial and error. If you have problems, check the error messages in the xorg.0.log and disable the Xinerama (you should get a mirrored display with it disabled). Under ServerLayout you can use 'LeftOf' if you find your monitors are displaying the wrong way around.

You may have noticed the 'kind of' comment made earlier when I said it was working. This is because after a cold boot, my left screen remains powered off. To get around the problem I have to follow these steps...

Press CTRL-ALT-F1 to get a command prompt;
Open /etc/X11/xorg.conf in a text editor;
Comment out the BusID line in the second Device section;
Save and close xorg.conf
Press CTRL-F7 to return to the GUI;
Press CTRL-ALT-BACKSPACE to restart the GUI (this gives me a mirrored display);
Press CTRL-ALT-F1 to get a command prompt;
Open /etc/X11/xorg.conf in a text editor;
Remove the comment (#) from the BusID line in the second Device section;
Save and close xorg.conf
Press CTRL-F7 to return to the GUI;
Press CTRL-ALT-BACKSPACE to restart the GUI;

This then gives me the Xinerama display! I haven't found a way to get around this problem and have since changed out this computer for a Mac Mini so it's unlikely now that I'll ever get to the bottom of it!