Solemn's Site
Buggy software since 200X
Xinerama tutorial

Posted in Linux on 07 Feb 2007 at 15:54 UTC

This howto explains setting up 2 or more monitors under X11 using the xinerama extention which is supported under XFree86 and, it is only tested under Linux but I assume it works under BSD and other unixes as well.

Warning: Trying this without some Linux experience can cause headaches!
Copyright © 2007,2008 Daniel Collins

Step one: Add "Device" sections

Every port you intend to connect a monitor to needs a "Device" section with it's own unique Identifier, even if the ports are on the same card. The "Device" section I used for the DVI port of an AGP nVida GeForce 6600GT with comments explaining what each option does is shown below as an example:

Section "Device"
	# The name of the section, it MUST be unique!
	Identifier	"nVidia 6600GT DVI"
	# Driver to use for the card, in this case nvidia
	Driver		"nvidia"
	# PCI bus ID of the card
	# You might be able to get your card working without this option but
	# I added it because my old motherboard was strange and put AGP at
	# 2:0:0 instead of 1:0:0
	BusID		"2:0:0"
	# Screen number connected to card
	# Screen numbers start at 0, so Screen 1 is the second monitor
	Screen		1
	# The port to use
	# If this card only has one port in use you might not need this
	# nVidia cards have the following values for this:
	# CRT-0/1/ect	- VGA connector
	# DFP-0/1/ect	- DFP connector
	# TV		- TV-out socket
	# I don't know if the same port names are used on other cards
	Option		"UseDisplayDevice"	"DFP-0"

You may want to set other options such as RenderAccel, or use a different driver, look at your current Device section to check what it's using.

Step 2: Adding "Monitor" sections

Each monitor you plan on connecting needs a section with it's own unique identifier, just like each port does. An example monitor section with comments is below:

Section "Monitor"
	# Yep! Another thing that needs a unique identifier!
	Identifier	"Generic monitor"
	# Refresh rate for monitor to use
	# Rates below 75 can cause headaches or eye problems on CRTs
	# Some old monitors may not support any above 60Hz
	VertRefresh	75
	# This enables DPMS power saving for your monitor, unless your
	# monitor messes up it's geometry when it goes to standby like one
	# of mine does you should use this to save some power.
	Option		"DPMS"

You should edit this to suit your monitor, not mine!

Step 3: Adding "Screen" sections

Now it's time to add the "Screen" sections, you may be wondering what the "Monitor" sections are for, they don't actually get used as screens directly, they provide monitor settings and information to the screen sections.
These "Screen" sections are virtual screens which are used by X11 and contain most of the monitor settings. As usual a commented, example one is below:

Section "Screen"
	# The unique name of the screen
	# Don't confuse this with the Screen option in the Device sections!
	Identifier	"Screen 2"
	# The unique identifier of the port this screen is connected to
	Device		"nVidia 6600GT DVI"
	# The unique name of the Monitor section for this screen
	Monitor		"Generic monitor"
	# Color depth and resolution settings
	# Consult the X11 docs for more info here
	# Again, configure this for your monitor, not mine!
	DefaultDepth	24
	SubSection "Display"
		Depth		24
		Modes		"1152x864"

Well, we're almost done now! Just one more section to go!

Step four: Updating your "ServerLayout" section

Unlike the other sections, you don't need to add another one of these, you just need to edit the Screen layout and add an option!
You're probably not expecting this, but there's really another example :)

Section "ServerLayout"
	# Unique identifier of the ServerLayout section
	# Don't change this!
	Identifier	"Default Layout"
	# InputDevice options to select the mouse and keyboard sections to use
	# Don't change these either!
	InputDevice	"Generic Keyboard"
	InputDevice	"Configured Mouse"
	# This probably isn't in your config unless you are already using xinerama
	# It simply enables the xinerama extention
	# If there is an "Xinerama" "Off" option delete that too
	Option	"Xinerama"	"On"
	# These are the screen sections, they tell the server which "Screen"
	# sections to use and how the monitors are arranged
	# They are rather self explanatory...
	Screen	0 "Screen 1"
	Screen	1 "Screen 2" RightOf "Screen 1"

Step five: Pray

Now, start (or restart) your X server and pray that it works. It may take several attempts to configure correctly, if somthing goes wrong check your log, it usually logs all problems and is normally in /var/log. Looking at a working X+Xinerama config may help as well.


No comments have been posted

Comments are currently disabled