Setting up a second monitor

James Gray james at
Thu Apr 20 22:55:24 UTC 2006

On Thu, 20 Apr 2006 08:27 pm, Jean Hollis Weber wrote:
> Hi, I'm a fairly new user of Ubuntu and completely new to Linux.
> Although I have been using computers for over 35 years, I am not
> a programmer, just a user. :-)

Cool - welcome :)  Don't let the zealots put you off - mostly we're a pretty 
friendly bunch.  Coffee machine is in the corner, pour yourself a steaming 
java and get comfy.

> I am using 5.10 (Breezy?) on a dual-boot Dell Inspiron 510m
> laptop. I want to use a second monitor as an extension of the
> desktop. Is this possible? At the moment the second monitor is
> not displaying anything (no signal at all), and I don't know
> where to start.

Indeed - it IS possible but not normally handled "out of the box".  So be 
prepared to edit some text files and poke around the "back end" of Linux's 
GUI which is called the "X server".  Read on.

> This setup works fine under Windows, so I know the hardware is
> compatible. I'm just clueless about setting up the software. If
> this is written up in the documentation somewhere, a pointer to
> the right place would be fine. I'm a bit daunted by the volume of
> available information.

First - is it an nVidia or ATi chipset?  Something else?  What is the monitor 
you're trying to plug in (Brand/Model)?

The volume of documentation exists because of there are literally thousands 
(millions?) of different Card+Monitor combinations.  What works with one 
combination is completely broken in another.  This exists in the Windows 
world too - but it's mostly hidden.  Ever changed a monitor on Windows only 
to get a "Frequency out of range" and can't see anything to fix it? ;)

Anyway, back to your problem.  Often the drivers in Linux wont initialise a 
second monitor if it wasn't connected when the GUI (X server) started.  
Plugging it in AFTER starting wont work.  However, you DON'T need to reboot 
in order to restart the GUI - simply log out of your session, to close any 
running apps, hit "CTRL+ALT+BACKSPACE" and voila, you've restarted the GUI :)

So log out, plug in the second monitor, then give it the (modified) 3-finger 
salute.  If you get a cloned desktop on the second monitor (or anything 
really), then you're almost there!  Unfortunately, this is the bit that gets 
little "complicated" and involves editing the /etc/X11/xorg.conf file.  So 
firstly, make a backup of it:
1. Open a command prompt (terminal)
2. type "sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf-working"
   (without the "")

Now you can start editing the file and can roll-back to known working 
configuration.  THIS is one of the beauties of Linux (and Unix in general) - 
everything is in a config file making backup/restoration of configurations is 
as easy as copying a file!  Try *that* with regedit ;)

You'll need to consult your video driver documentation as to the best way to 
enable multi-head (the second monitor) in something other than clone mode.  
Both nVidia and ATi have their own proprietary methods that are unique to 
their driver (nVidia have "TwinView", ATi have "HydraVision").  However, good 
old xorg have Xinerama which works with almost any multi-monitor-capable 
video card and I'll write the rest of this based on Xinerama and a 
"traditional" multi-monitor setup.

This is where knowing the PCI bus ID for each of the "heads" is important. 
"lspci" and "/var/log/Xorg.?.log" provide useful information here.
$ lspci
0000:01:00.0 VGA compatible controller: ATI Technologies Inc.....

$ grep PCI /var/log/Xorg.0.log
(II) Primary Device is: PCI 01:00:0
(II) fglrx(0): PCI bus 1 card 0 func 0
(II) fglrx(0): PCIE card detected
drmOpenByBusid: Searching for BusID PCI:1:0:0
(II) fglrx(0): [drm] created "fglrx" driver at busid "PCI:1:0:0"

So, on my laptop I have PCI:1:0:0 at the moment.  It's actually dual-head, but 
the second head only "registers" when I have a monitor plugged in.  When that 
happens I also see "PCI:1:1:0".  So these are the sort of gems people on this 
list need to see in order to help you further with specifics.

Once you (we) know the bus ID's you simply enable Xinerama, and configure two 
"Monitor" sections and two "Device" sections that correspond to the monitors 
and the "plugs" (devices/heads) that drive them.

You can probably start by just copying the existing declarations for Monitor 
and Device and change their "Identifer" strings so they are unique.  Then 
modify the "ServerLayout" to reflect the new device and monitor.  Google 
"ServerLayout +Xinerama +xorg.conf" without the "".

Then restart the X server (GUI - see early about the CTRL+ALT+BACKSPACE trick) 
with the second monitor plugged in.  If you now have a spanning desktop, 
you're pretty much done.

More tweaking may be required to get the second monitor's resolution/refresh 
sorted, and also configuring the xorg.conf to behave when the second monitor 
isn't plugged in.  But they are minor and can be dealt with later. :)

Any questions - please get back to the list and we'll try to help.  Please try 
to give us any errors you see (egrep 'EE|WW' /var/log/Xorg.0.log) and any 
information you can from "lspci" etc.  That helps us help you!


We place two copies of PEOPLE magazine in a DARK, HUMID mobile home.
45 minutes later CYNDI LAUPER emerges wearing a BIRD CAGE on her head!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the ubuntu-users mailing list