02 July 2009

Setting Up a Dual Monitor Ubuntu Workstation

Last Friday I discovered that the CTO of the small start-up where I work had attempted to install Ubuntu on a box for a new developer and ran into issues with it. Too busy with more important matters, he left off troubleshooting it. Loving the opportunity to work with Ubuntu (it's what I use on my family's desktop and on my notebook), I volunteered to have a look at it.

The HP xw4600 Workstation was to be set up with two monitors. The Ubuntu 8.10 live CD the CTO had burned was in and spinning just fine. I checked BIOS, although that really wasn't necessary. The computer was attempting to boot from the CD and was freezing just as the standard brown Intrepid Ibex wallpaper appeared. No icons or toolbars were populating, and the second monitor was dark.

It was late, so I decided to come back to the problem fresh the following Monday morning. Over the weekend I mulled over the possibilities, and it occurred to me that I might have better luck booting into "graphics safe mode." Bright and early Monday morning I gave it a try ("F4" on the keyboard or choose an option on the screen just as the first Ubuntu screen appears with install/boot options on the Live CD). Sure enough, the computer went on in to the Ubuntu environment, and I was able to make the full installation (Ubuntu 9.04, from one of my own CDs).

It took me most of the morning to figure out why the second screen refused to come on. To make a long story a little shorter, I found that System > Display could not help me to detect the second monitor. After some research, I downloaded EnvyNG. To quote the developer's own description:

"Envy" is an application for Ubuntu Linux and Debian written in Python and PyGTK which will:
1) detect the model of your graphic card (only ATI and Nvidia cards are supported) and install the appropriate driver. However automatic detection can be overridden with the "Manual installation"
2) install the right driver for your card and all the required dependencies
3) configure the Xserver for you

It worked like a charm. I ran it from Applications and accepted the drivers it recommended for the workstation's graphic card. Then, when I went to System > Display it gave me an error message, to which I said "Yes." This took me into Nvidia's controls, allowing me to set up the monitors. Check out the following screenshots to get an idea of what I'm talking about here.

Clicking "Yes" takes you to the next screen:

Play around with the settings and you'll figure it out.

Two points to note:

First, you may have trouble finding EnvyNG in the Synaptic Package Manager. I don't know why, but when I looked for it by name there it didn't come up. When I searched for "Nvidia," though, I found EnvyNG nestled in the midst of the other packages.

Second, after a routine system update I found that the second screen was offline again. I had to go back through System > Display and correct the settings again for Nvidia.

I am fairly certain that the initial installation/boot problem stemmed from the two monitors. In a sense, I think it was confusing the Ubuntu Live CD. Safe graphics mode allowed me to install Ubuntu, and then EnvyNG helped me get the right driver(s) to set up dual monitors.