Quick and Dirty secrets of xorg.conf
My Ubuntu install went off without a hitch, but the second monitor never came on. To be clear, I have a main AGP graphics card, and a much older crappy PCI one. They both connect to their monitors (two of the same model of Dell LCD) via VGA. It turns out the problem is with the X server, which is the thing that is the basis of every GUI on Linux, be it GNOME, KDE, Xfce, whatever. Configuring X is the first step in getting multiple monitors with the proper resolutions, color depths, etc. There is this file /etc/X11/xorg.conf that does the magic. If you have the right configuration settings here, you can make wondrous things happen. The first thing I thought was "Hey, Ubuntu probably has a really nice GUI multiple monitor configuration!". Turns out it doesn't so that means that I'd have to modify xorg.conf by hand. At first I tried setting up something called Xinerama using a forum post I found. No luck with this, even though I am convinced I did things exactly like they said. After digging around some more, I came up with the following, and it pretty much works. Where the Debian configuration of X failed to find and set up the second monitor, X's own configuration of itself does not. Try the following:
- Reboot into a failsafe shell/single user mode. This keeps X and your desktop environment from running. You need to do this to configure X (can't configure itself while its running). Failsafe mode usually involves stopping your boot loader by pressing some buttons during bootup, then picking the appropriate option. Note that you'll be root, so be careful.
- Make sure all graphics cards and monitors you want are hooked up and ready to go.
- Do a "X -configure". This gets you a local version of a configuration file called xorg.conf.new
- Now try it out: "X -config /root/xorg.conf.new". You should be greeted with some test patterns on both screens! The mouse will move back and forth across both screens too. Simple as pie.
- Now quit X: ctrl+alt+backspace. If you didn't get the test patterns...abandon all hope, I know not what else to do.
- Backup your working xorg.conf just in case: "cp /etc/X11/xorg.conf /etc/X11/xorg.conf.working"
- Copy over the new config file to where X expects its configuration file "cp xorg.conf.new /etc/X11/xorg.conf"
- Do a "reboot"
If it worked, this gets you a fresh, working start to editing xorg.conf. The two Desktops are still distinct and have no way of moving windows between them at this point, so one last thing to enable that is to open up your xorg.conf ("sudo gedit /etc/X11/xorg.conf") and add the following line:
Option "Xinerama" "true"
To the "ServerLayout" section. Save the file, then do a ctrl+alt+backspace to try it out! Remember if you screw things up, just go back to the backed up file you have. You might need to edit the "Screen" section some to support the display modes you want, and maybe comment (#) out the HorizSync and VertRefresh parts of the "Monitor" section. You can see your backed up copy of xorg.conf for the formatting of the display modes.
Final Thoughts
It's not Windows. It's not easy. It's kind of a pain to set up. Oh Ubuntu, why don't you make a GUI tool to make this configuration nice and easy, and why oh why don't you include it as a System->Preference option? I guess they're working on it for 7.10. But I hope I have saved you some of the trouble I came across when trying to configure multiple monitors. Happy editing!
2 comments:
How ironic that your blog is called "rtfm-nub".
Have you read the manpages, particularly "man Xorg"?
@Alec:
i have read that manpage...why is it ironic? it'd be ironic if i were an idiot who had no idea about xorg and was complaining about setting it up. instead i offer a simplified tutorial for those that don't want to go through that arcane guide known as the manpages.
Post a Comment