Since I just spent several hours trying to get my Dell 2405FPW monitor working with a Debian laptop I’ll post the successful formula in the hopes of getting someone else through it faster. I found a ton of bad information on this issue on the net. Some of it was old, some was just wrong. If you have Debian and a working nVidia binary driver installation, then I think this process is sure to work for you. If you have some other distro it probably will work since it’s all X configuration anyway.
Walkthrough
The key to all happiness: use the nvidia-settings utility. Really, the biggest problem with the advice you find on the net is that most posts are half-right. They get close to the variable names and values that you need in the conf file, but none of the posts I read were even close on the sections. In many cases I’m sure this is because there are multiple ways to do it, and nVidia, whose drivers are proprietary binaries, knows how to make their own GPU work. Anyway, my advice is to use it. But first a few other things.
- Move /etc/X11/xorg.conf off to a backup somewhere. Call it xorg.conf.old or whatever. You don’t have to move it, but we’re going to overwrite it later anyway, so at least back it up.
- Make sure the external monitor is plugged in to the laptop’s VGA port (or DVI I suppose).
- Run the nvidia-settings utility.
The nvidia-settings utility can be run from the shell if you know the parameters, but it’s easier to run it from the K-menu, in Debian > Applications > Tools. Once it is going click on the “X Server Display Configuration” menu item in the left-hand navbar. The right-hand window is where you edit the display config, and it is divided horizontally into two parts. The top part has icons depicting the actual displays. You click an icon to select a display to edit. When you start into it one of these will probably be disabled, and if you’re doing a laptop like I was they won’t be the same size. The bottom part of the page has the actual properties and sports two tabs, one for “Display” and one for “X Screen.” You start off in the “Display” tab, which is fine.
First thing to do is decide how you want the panels to work together. X gives you a lot of flexibility in this regard. You can have one virtual desktop spanning both screens; or an individual X desktop on each. You can also make the desktop bigger than the panels, but we’ll get to that in a sec. Click the icon for the display that is disabled, and then click the “Configure” button. Either select “TwinView” for one virtual desktop, or “Separate X Screen” for individual desktops. The utility will set the other display(s) appropriately based on your choice, at least when you have two monitors.
So far we’ve been working in the “Display” tab. Click the “X Screen” tab next to it. About halfway down in that page you’ll see “Position” with a drop-down list next to it, and then an edit box next to that. This is where we decide how the panels will be positioned in the desktop world. Regardless of whether you’re using TwinView or separate X sessions the system has to know which physical panel is where in order to flow the mouse across. You’re going to give one of them an absolute position, and the other a relative position. Since screen coordinates go from left to right, give the left display an absolute position of 0,0, and the right display a relative position of “RightOf.” Other combinations are possible, but this will be what most people want.
Click the “Display” tab to get back to the display configuration. If you chose “Separate X Screens” in the configuration you can skip this part. If you have two panels the exact same size you can also skip this part. One of the challenges in setting up dual monitors on a laptop is that almost certainly the monitors are not the same size. If you have a separate desktop on each, then this is no big deal. If you have a single virtual desktop then that desktop is going to encompass both the larger and smaller panel, and since the virtual desktop is rectangular there is going to be some extra space in the neighborhood of the smaller panel.
On the “Display” tab click the “Advanced” button. This will display the “Panning” settings for either display. It’s a strange name, since it’s really the size of the virtual desktop for that display. Let’s say you have a 1600 x 1200 LCD, and a laptop with a 1280 x 800 LCD. You can leave the Panning x,y values at 1600 x 1200 for the first display, and 1280 x 800 for the second, and it will work fine. But because X will allocate enough rectangular desktop to encompass the height of the tallest screen, and the width of both, there is an area that the little laptop screen can’t cover. It’s not tall enough. If instead you set the Panning value for the laptop display to 1280 x 1200, it will take up the full width, and you will be able to pan an 800 row window over the full 1200 rows of the virtual desktop. Of course you can make the virtual desktop larger than both screens, and pan them both. It’s up to you.
Once you have these set click “Save to X Configuration File” at the bottom of the dialog. In the save file dialogue uncheck “Merge with existing file.” If you have custom settings in your existing xorg.conf file and you want to try the automatic merge, then you can leave this box checked and try to save into /etc/X11/xorg.conf. You’ll need sufficient permissions to do that, usually meaning root. If, like me, you prefer to have the new file written elsewhere so you can look it over before installing it, then I suggest saving it to your home directory as xorg.conf.nvidia. The utility will generate a complete xorg.conf, including the input devices, server layout, and any monitors that it detects. For most systems this generated config will work fine. As mentioned above if you have customized xorg.conf you’ll need to manually merge at this point. In my case I simply replaced the existing xorg.conf file with the one nvidia-settings generated, and it worked right off. I initially used TwinView, but decided that separate X screens would be better. Now when logging in I get the log-in box on the big Dell, while the laptop screen remains blank. As soon as I log in both panels show a complete X desktop.
Once you have merged any custom settings copy the resulting xorg.conf.nvidia (or whatever) file to /etc/X11/xorg.conf, hit ctrl-alt-backspace to kill X, and then if necessary log in at the terminal and type startx. You should have both panels configured and working. That’s the walkthrough. If you’re interested in the details of the generated .conf files follow the link. Continue reading