One of the last tasks that moving to my new machine involves is to stretch the Ubuntu desktop across both of my monitors. Our sysadmin had very kindly set it up to work with the monitor card integral to the motherboard, so in principle I only had to tweak the configuration for X, the standard Linux GUI system.
Could I get this to work? Could I hell. xorg.conf configuration after configuration threw the error
(WW) MGA: No matching Device section for instance (BusID PCI:5:0:0) found
Once in a while there was a flicker from X. A couple of times my machine returned to its text-only state with text on both monitors. So something was happening, but not even the same thing every time.
Eventually, I began to grow suspicious. I finally did what I probably ought to have done earlier and read the man page for xorg.conf. Yeah, I realise: RTFM; but when the X system seems to be both spread over so many different programs and also quite different from the old pre-Xorg layout that I remember, it’s difficult to second-guess which files will have man pages named after them and which won’t.
After some hunting, the following caught my eye:
When the Xorg server is started by the “root” user, the config file search locations are as follows:
That’s it. I’d left an old xorg.conf hanging around in /root/, and being calledâ€”depending on how I instantiated my X session, and hence apparently not repeatablyâ€”in preference to the “standard” one in /etc/X11. So if I used the init.d script to start gdm it would ignore the dud xorg.conf; if I ran X or startx it wouldn’t; but if I then specified
-config /etc/X11/xorg.conf on the command line I’d get flickers and pops from my monitors again. Sigh.
So, my rather ludicrous, meandering experiences aside, these are my humble recommendations for anyone trying to get similar hardware to mine working. I’m running Dapper Drake Ubuntu including Xorg 7.0.0 on a dual-core 2×3.0GHz Dell Optiplex GX520 with 1GB RAM and oh, so many GB HD. The monitor card is a Matrox G450 (VGA + DVI sockets), and with malice aforethought I’d probably install a similar-looking system as follows:
- Start X, wherever possible, using
/etc/init.d/gdm (re)start. This prevents loading any stray xorg.conf files. Also, just don’t leave them lying around with the name xorg.conf!
sudo dpkg-reconfigure -phigh xserver-xorgcan be handy to version
/etc/X11/xorg.conf, as it re-parses it to make sense for dpkg-reconfigure and saves the old version. Be aware that reparsing might modify any weird configuration that dpkg-reconfigure doesn’t understand.
- Avoid older Matrox cards, such as the G200 or G250, for purely physical reasons: they don’t fit in some of the smaller Dell boxes.
- Matrox drivers come with Xorg 7.0.0, although I used Matrox’s own drivers for reasons of not knowing beforehand. Given most people recommend the stability of former set of drivers, it looks like either might do.
lspcito see which location on the PCI bus is occupied by the Matrox card. The output lines begin with numbers like “0000:05:00.0″: these correspond to PCI addresses e.g. a BusID setting in xorg.conf of “PCI:5:0:0″ in this case. I’ve read in some places that xorg.conf sometimes wants extra zeroes e.g. “PCI:05:0:0″, but I’ve not noticed that behaviour.
- In xorg.conf, you’ll need two device entries, two screen entries and two monitor entries. You can get away with one monitor entry if both your monitors are the same, but two will future-proof you against any modifications to your hardware.
- The G450, unlike some cards, only occupies one PCI address. This means you’ll need the “Screen 0″ and “Screen 1″ attributes to differentiate your two Device entries in xorg.conf
- There are other options like Xinerama (standard multiple-head management drivers) that you ought to switch on, but without these X will at least recognise your monitors are there.
- Screen sizes, sync rates etc. should be set conservatively at first: with most modern monitors you can probably leave sync rates out, but caveat lector: it’s possible to explode old monitors using funny sync settings.
- For reference, my xorg.conf is available at http://www.jpstacey.info/blog/files/code/xorg.conf. Obviously check the sync and resolution settings with the above caveat, but you should only need to modify this slightly for your own setup, if the hardware is at all similar.
The system works fine; really well, in fact. My old machine was dual-head, but it’s easy to get used to slowness caused (in that case) by the processing power of the machine and not realise those shackled were present. The graphics on this machine have a kind of OSX slickness to them that I’m still a little dazzled by. Now, if only I can get it to swap to kubuntu; gnome’s big buttons and stultified interface always remind me of primary school.