mkaz.com home photography web dev personal about
Two Heads are Better than One
Dual Monitor Support on Gentoo Linux
Marcus Kazmierczak
June 20, 2003
Gentoo

This document covers how I got dual monitors to work on Gentoo Linux. The two monitors are side-by-side physically and it is as if I have one large 2560x1024 desktop. Both monitors are running the same resolution of 1280x1024.

Intro

I am going to assume you already have Gentoo installed and have XFree86 working with one monitor right now. If you don't have this, please follow the Gentoo installation documentation and XFree86 setup. Before compiling XFree86, see the section below regarding xinerama support.

Equipment: I am also going to assume you have the following equipment or something similar. How you set this up may be dependent on the video card you use. I got and use the nVidia card. I have no experience using any other dual-card or two video cards setup.


Kernel/System Setup

The "nv" driver that initial came with my XFree86 install did not work, I needed to use the "nvidia" one. So if you did not install the nVidia drivers following the XFree86 instructions about you will need to install the following.

# emerge nvidia-glx
# emerge nvidia-kernel
NOTE: In order to install the nvidia-kernel package I had to recompile my kernel with MTRR support built in. Follow Gentoo installation instructions for how to compile your kernel.

After installing the packages:

# echo "nvidia" >>/etc/modules.autoload
# modprobe nvidia
Configuring XFree86

I am using the latest XFree86 ver 4.3.0 with xinerama support compiled in. I'm not sure if this is necessary or not, but it very well may be. To compile XFree86 with xinerama support. Edit /etc/make.conf and add xinerama to your USE variable. Recompile X using:

# emerge xfree

The only thing left is to configure XFree86. The nVidia card uses some special options inside of the Screen section of your XF86Config. The config file is found at /etc/X11/XF86Config

WARN: Back up your config before editing

Please carefully look over this file before making changes. If your X config is running well then I would compare and hand copy the Screen and verify the Device. Be sure you use the same identifiers in the different sections. I may have named mine differently than yours.

Screen Section:


Section "Screen"
    Identifier "Screen0"
    Device "NVIDIA"
    Monitor "My Monitor"
    DefaultDepth 24

    Option "NvAGP" "1"
    Option "TwinView" "true"
    Option "SecondMonitorHorizSync" "30.0-121.0"
    Option "SecondMonitorVertRefresh" "48.0-160.0"
    Option "MetaModes" "1280x1024, 1280x1024; 1280x1024, 1280x1024;"
    Option "TwinViewOrientation" "RightOf"
    Option "Xinerama" "on"

    Subsection "Display"
      Depth 24
      Modes "1280x1024"
      ViewPort 0 0
    EndSubsection
EndSection

View Complete Config File: XF86Config file


After you have everything configured. Exit X (quick way: ctrl-alt-backspace) and restart.

# startx

Hopefully everything worked right and you should have one large desktop across two monitors.

If not, check all your error messages on screen and also look for any in /var/log/XFree86.0.log I won't be much help trouble shooting, this documents just about everything I know regarding this. You can try some of the links below for more information or use the University of Google, the best education around.



Related Links