Skip navigation.

Stephen O'Sullivan

Blah, blah, blah ....

Ubuntu 8.04 Dual Monitor Setup

, , , ,

Dual screen setup in Linux

One of the more difficult (read temperamental / infuriating) tasks in Linux comparative to MS Windows is the dual screen setup. I had it working in Ubuntu 7.10 by setting up one virtual desktop of size 2960 x 1050. This solution worked in most cases, with the majority of full-screen applications opening on whichever screen it was on when windowed, though some expanded full-screen over both screens. This solution was stumbled upon after much tinkering with xorg.conf, and consequently, this file was a bit of a mess. Nevertheless, I was unable to successfully setup the sort of dual resolution system I can on Windows.

With only four weeks to go before the final release of Ubuntu 8.04, I decided to upgrade my system to the latest beta. Despite the ease of upgrading an Ubuntu installation, I like to perform a fresh install when each new version is released, so this latest beta was simply an opportunity to test out some of the new features, knowing I'll be scrubbing the install in a month. One such feature was the improved support for dual monitors thanks to Xorg 7.3.

So I thought I'd try it out. After a bit of trial and error, I found a relatively simple solution.

Note: I have two LCD monitors of differing resolutions on a single Nvidia 6800 Ultra: a 22inch (1680x1050) on the DVI input, and a 17inch (1280x1024) on the VGA input. By default, Linux identifies the VGA screen as the primary screen, though I have the 22" screen in front of my chair so-to-speak, and the 17" to the right, so I have to ensure this is factored into the setup. Nevertheless, simpler configurations should work using this method, as it basically uses the following steps: start with a clean xorg.conf configuration; use nvidia-settings to automatically identify and configure you screens; save this to xorg.conf. If you are not using an Nvidia video card, then this howto will not help you.

Also, it is always wise to backup you xorg.conf before messing around with it. You can do this a variety of ways, but the easiest is in the terminal:

$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak

If you find upon restart that X won't start, then reverting to your old configuration is simply a matter of typing $ sudo cp /etc/X11/xorg.conf.bak /etc/X11/xorg.conf at the command prompt.

Howto

Pre: having chosen to test the new, apparently automatic, dual monitor support in Ubuntu 8.04, I started with "Screens and Graphics", which can be found at Applications > Other > Screens and Graphics.


This screenshot is actually from after the setup below, but attempting to use it to setup my dual screen configuration, upon restarting the system, served only to stuff up X. Thankfully, since Ubuntu 7.10 (and perhaps earlier), this leads to a pared-down X configuration, which had both my screens at resolution 800x600, and cloned.

My first problem, as it turns out, was that the Nvidia driver was not enabled...

Step 1: (see below for update) ensure Nvidia driver is enabled by navigating to System > Administration > Hardware Drivers.

I found that the driver was not enabled, so put a tick next to "enable". I was then asked to restart the system.


Step 2: start with a clean xorg.conf

$ sudo dpkg-reconfigure -phigh xserver-xorg

and restart X: Ctrl+Alt+Backspace, then log back in.

Step 3: install "nvidia-settings"

$ sudo apt-get install nvidia-settings

Step 4: run Nvidia Settings by navigating to System > Administration > Nvidia X Server Settings (or better still, run it from the terminal using $ sudo nvidia-settings, to ensure you can save your configuration, as I learned...)


Nvidia settings should identify your monitors, and it allows you to configure them the way you want. Clicking on "X Server Display Configuration" displays the following screen:


This screenshot shows the final configuration, but immediately after rebooting to a clean xorg.conf only the 17" screen was enabled (because it is plugged into the VGA port), and the 22" was shown shaded out and on the right-hand side.

Enabling it was as simple as clicking on it in the "Layout" box, clicking "Configure...", and choosing "Twinview". I left "Resolution" to "Auto" which gave me the optimum resolution for the screen, and under "Position" I initially chose "Left of", which swapped the screens over in the "Layout" view at the top, but then I changed it to "Absolute", which shows +0+0 for the 22" and +1680+0 for the 17".

Clicking "Apply" reconfigured my screens to the new configuration, with a 15 second countdown on which you have to click "Accept" if the new configuration works, but will automatically revert if not.

Step 5: assuming the new configuration worked - mine did, with both screens automatically identified by Nvidia - you need to save the settings to xorg.conf. Unfortunately, the Nvidia Settings application was running only with user rights. This meant an error popped up when I tried to "Save to X Configuration File". If I had started the application in the terminal using $ sudo nvidia-settings this problem, I assume would not have occured.

Nevertheless, I found an easy solution. Clicking on "Save to X Configuration" pops up this:


And clicking on "Show preview..." opens a text box with the draft xorg.conf. I simply copied the entire text, opened xorg.conf with elevated rights ($ sudo gedit /etc/X11/xorg.conf), highlighted all the text of the existing document and pasted the new one.

A restart confirmed the setup worked perfectly, and in less than 5 minutes.

UPDATE: now running a fresh install of the final release Ubuntu 8.04, a couple of additional observations. I found that immediately after installation, System > Administration > Hardware Drivers showed Nvidia driver installed but not in use. I'm not entirely sure why, because the default driver was the generic VESA driver. Step 1, above, requires installation of the driver, no matter what Hardware Drivers says. To do this, simply install nvidia-glx-new (note from the Synaptic description of the driver "If you have a TNT, TNT2, or older GeForce, you may need the nvidia-glx-legacy package instead of this one. If you have a GeForce4, you may need the nvidia-glx package."). Step 2 is redundant if you are running a clean install.

Autism and postmodernismiPod Management in Linux

Comments

StickyC 29. April 2008, 05:13

FYI - I just finished installing Ubuntu 8.04 AMD64 on my machine with the nVidia GeForce 8800GT and had a slightly different path.
1. There is no "Applications\Other\*" menu. As near as I could tell, the only screen manipulation app is "System\Preferences\Screen Resolution" which was entirely limited.
2. A short time after installing, Ubuntu prompted me to install the "private" nVidia drivers. They successfully installed and were active once I rebooted (as prompted).
3. I was able to immediately get dual screen support by following your steps 3 & 4 above (I did not need to do any customization on the Layout panel - using 2 24" monitors though with identical screen res). When attempting to save my configuration, I got an error that it was unable to create a backup, no issues with saving the original, but I wasn't terribly concerned as this was a brand new install and I'd likely just re-install if things got wonky.

Hope this helps folks!

sjosul 30. April 2008, 11:13

Thanks for your comments - I thought two matched resolution screens would be easier.

The "Applications\Other" menu exists but is not visible by default. If you right click on the "Applications" menu bar and choose "Edit menus" you will see "Other" in italic. Clicking on it should reveal a series of menu items also in italic, because they have no ticks against them, i.e. they have not been revealed. One of these should be "Screens and Graphics". Put a tick next to it to show the item in the menu.

That said, nvidia-settings is a much better way of setting up a dual-screen configuration.

geoffory 15. May 2008, 09:05

I have a very similar setup to the one you described configuring ( a 1680x1050 21" FP & 1280x1024 17" FP, only on an Nvidia GeForce 6200). Steps 3 and 4 got me just about to where I want to be, but I have one hang-up. In the default TwinView setup with native resolutions, my default Gnome panel bars (top and bottom) extend across both screens. This is an issue because my 21" screen is 26 pixels taller than my 17" screen, causing me to see only one of the bars on the second screen.

In past configurations of dual-screen, I have been able to keep both the bars confined to one screen, making the resolution of the second matter less, but I don't know if TwinView will do this.

Since you have the same screen resolutions to work with, what experience did you have with these bars? Right now, I have forced my 21" screen to 1600x1024, so that the heights match up, but I hate having a blurry LCD.

Thanks for any advice

EDIT: Silly me. the 'Apply' button gets dual-screen working how I described, but with a reboot after saving the Xorg.conf file, it was more how I expected.

Great guide - just forgot to restart X

sjosul 16. May 2008, 08:15

Great - I have in the past experienced the panel over two screens but couldn't remember what fixed it. Doubtless the same as you - fixed itself after restarting X

chintabs 22. May 2008, 22:39

For me the issue begins in step 1.

1: I enabled the NVIDIA accelerated graphics driver.
2: restart the system
3: The enabled flag was unchecked, but the status field showed 'in use'

Can this be the cause of a bigger problem which is what I get while running nvidia-settings

'You do not appear to be using the NVIDIA driver.. please run nvidia-xconfig as root'


P.S even after running nvidia-xconfig, no luck starting the nvidia-settings

sjosul 25. May 2008, 11:06

Chintabs, have you installed nvidia-glx-new? This is the driver (check the comments section in Synaptic, depending on your card, you may need one of Nvidia-glx, nvidia-glx-legacy or nvidia-glx-new.)

Once installed, restart. Then enable the driver, as in step 1.

gaia2000 28. May 2008, 15:54

hi, absolutely great instructions, got it working the first time 'round on Ubuntu 8.04. I'm using a Dell 24" (1920x1200) and a Samsung plasma screen (1028x768).
A few problems though:
1. I'm getting my background picture stretched ou over the 2 screens, having them as separate Xscreens, same in Twinview. Is there a way to get a complete picture on both screens?
2. On the Samsung I'm getting a 1" black edge around the screen although resolution seems to be set correctly. (I'm using the s-video output of my nvidia card, could this be part of the problem? Haven't found a VGA cable long enough yet....)
3. When configuring the screens as separate scrrens or in Twinview I lose all Compiz effects. Is there a way to keep Compiz running o both screens?

Thanks,

Ben.

sjosul 29. May 2008, 09:56

Hi Ben,

1. The wallpaper image stretched over both screens in twinview is unavoidable - the only way to have the appearance of separate wallpapers is to attach two images, one 1920x1200 and the other 1024x768 in GIMP. With separate x screens you can choose to get a clone of the primary screen, but I don't believe you can have two different wallpapers (might be wrong on that, tho)

2. My guess is, as you say, something to do with the s-video output - sounds like its limiting your resolution. Like you have set the screen's resolution to less than its optimal, and it doesn't want to zoom to fullscreen.

3. You should have no problem with compiz using twinview (make sure you don't have xinerama enabled), but my experience with individual x screens is that compiz will work on one screen but not the other.

Good luck!

gaia2000 31. May 2008, 17:21

Thanks mate, I'll try that out.

Ben.

Alexx4 15. June 2008, 20:31

Hardware, two identical monitors with 5200 card, new install, 8.04

First had to adjust the application menu, you will have read that above.

When I got to show preview after running sudo nvidia-settings just saved the file without a problem.

My KB doesn't work properly now, probably because it now set up as US.

All in all quite easy and little trouble.

Remember that after first setting up the full screen spreads across both screens but this fixes itself on reset.

sjosul 15. June 2008, 23:10

Thanks for your comment - good point about the keyboard. I use defaults for keyboard and mouse, so wiping xorg.conf doesn't matter. You should have the backup though, you can simply copy across the keyboard section of xorg.conf backup into the new file.

epsolon77 14. October 2008, 12:55

Thank you so much for this post. It has taken me a giant leap forward in ridding my office of windows!

sjosul 14. October 2008, 22:23

Glad to have helped, and good luck with freeing your office of windows...

timmayc 16. October 2008, 16:01

Thanks for this post, it really helped me out.

sjosul 17. October 2008, 01:26

Its good to hear, thanks

danielleao 19. December 2008, 14:35

i have a toshiba notebook with ATI Radeon Mobility 9100IGP. The note's monitor is 1280x800 and i've been working before (with windows) with a samsung 17" at 1280x1024 as secondary monitor.

After installing the correct ATI video card, i was able also to show image on the secondary monitor, but i can't get the sec mon to be an extension to the first one. It is repeating the image on both of them.

Any ideas on what to do ?

sjosul 21. December 2008, 01:25

Daniel, I'm not as familiar with ATI, but clone output will be the default until you configure xorg. My understanding is that ATI has a aticonfig tool for setting up the screen similar to the nvidia one.

These links suggest two different methods specific to ATI, the first simply modifying xorg.conf, the second using the aticonfig tool:

http://ubuntuforums.org/showthread.php?p=1773710

http://ubuntuforums.org/showthread.php?p=1773544

ubuntunerd1 28. January 2009, 15:39

i was just getting ready to write this exact guide but you beat me to it good job

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

Type the two words displayed in the image below:


Smilies