Skip to content
 

Ubuntu: Dual monitors with Nvidia in 9.10 (Karmic)

Here’s a quick guide to setting up Ubuntu 9.10 (Karmic) on a dual monitor system with Nvidia video.  There are a couple of oddities that can crop up when installing, so I’ve included tips for getting around them if they happen to you.

First, your system may not boot completely from the live CD.  It may hang with a black screen after the splash.  This happened to me today.  Fortunately I remember having this problem occasionally with earlier versions.  The fix is to disconnect the second monitor until you’re done installing.

Once Ubuntu is installed and working, make sure you’re using the Nvidia drivers (System>Administration>Hardware Drivers if you’re not sure).  Then connect the second monitor and reboot the system.  From terminal, run this command:

sudo nvidia-settings

This will bring up the Nvidia settings tool.  Click on X Server Display Configuration.  You will see a box marked Layout, with one or two gray rectangles.  These represent your monitors.  If there is only one, click Detect Displays to add the second.  It will initially be labeled “disabled.”  Select it and click Configure, then select TwinView and click OK to enable it.

Drag the gray rectangles in the layout area until their arrangement roughly matches how the physical monitors are placed in your workspace.  Then click Apply.  Your screens will go black momentarily (don’t panic!) and then should come back up with a properly laid out dual desktop.  Move the mouse around to make sure it crosses over from screen to screen the way you expect, and make further changes in the Layout box if necessary.

Once you are happy with the dual monitor behavior, click “Save to X Configuration File.”  This is where I had an unexpected problem – the Settings tool put up an error message that it could not parse the xorg.conf file, then crashed.  If this happens to you, here’s how to handle it.

First, restart nvidia-settings and redo your setup to get everything as you like it.  Then, before you click the Save to X Configuration button, open up another terminal and enter this command:

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bkup

Then, back in the settings window, click the Save to X Configuration button.  It will prompt you for where to save; enter /etc/X11/xorg.conf and click the button to save it.  Then click Quit in the settings window, and reboot to test your settings.  If everything has gone properly, your system should boot with dual monitors enabled.  If you have trouble and need to back out these changes, you can restore the old file like this:

sudo rm /etc/X11/xorg.conf
sudo mv /etc/X11/xorg.conf.bkup /etc/X11/xorg.conf

Bonus tip: You can add panels (“taskbars,” if you’re used to Windows) to the second screen.  Right-click on one of the panels in your main screen and choose New Panel.  It will add another panel on an unused side of the main screen.  Do it again, and you’ll get another new panel on the main screen.  When all four sides of your main screen have panels on them, the next time you do it will start adding panels to the second screen.  Once you have the panels you want on the second screen, delete any unwanted panels by right-clicking on them and selecting Delete This Panel.  Reader Julien Nicoulaud points out that I was doing that the hard way.  The easier way is to create the new panel, press and hold Alt, then click and drag the new panel to the screen and position where you want it.  Thanks, Julien!

Bonus bonus tip: If you add a Window List item to a panel on the second screen, the window buttons on each panel will display only the windows on that screen.  If you move a window from one screen to another, the button will follow and move to that screen’s panel.  To do this, right-click the panel, choose Add To Panel, select the Window List item, and place it as you like it.

42 Comments

  1. aperson says:

    If you encounter the parsing error, just run sudo nvidia-xconfig before trying to save again.

  2. dwasifar says:

    @aperson
    Yup, that’ll work too. Anything that gets the malformed xorg.conf out of the way.

  3. David says:

    I’ve been doing something similar for the last few incantations of kubuntu……
    except that when I clicked on save, my system would never save the config file……..so I would go into root then manually save the generated xorg.conf file from the Nvidia settings tool and “bobs your aunty” twin screens…… ;0)
    couldn’t have been too hard……… I’m a truck driver, not a puter guru !!

    ;0)

  4. Spasm says:

    This works for me in Karmic – I am using an nVidea Quadro NVS 280 with Eizo S1921 LCD Monitors. When I do this I get dual screen but my refresh rate is very slow – windows seem to take an eternity to draw when you move them.

    Does anyone have any ideas?

  5. Boricotico says:

    You’re the best man, so many thank you, I’m happy with my dual monitors working finally over Kubuntu 9.10 Karmic Koala =)

  6. Tim Ardan says:

    Worked like a charm. Well, better, actually. Now my Gnome panel doesn’t stretch across both screens. Sometimes something so simple can cure the most annoying problems. Thanks!

  7. saruji says:

    Thank you so much for this, really appreciated. Worked like a charm, where as before 9.10 I couldnt figure out how to do this (bonus tips that is). Oh and the save x file thingy I did get from before, but this is a better way then what I did back then, which was……saving the xorg.conf file to home folder, then copying over the xorg.conf file via terminal. Stupid but I’m am/was totally new to this, so hard way it always seemed to be, so easy now.

  8. Guillaume says:

    Thanks! That really helped!
    Great advice, well explained.

  9. [...] más de 60 minutos. No todo funciona a la primera. Tengo una instalación con una tarjeta gráfica Nvida 8800 GTS que soporta dos monitores Samsung de 22′ DVI, y hay que tunearla con los driver… Además, he tenido que reconfigurar la compartición de ficheros mediante Samba. Pero tras la [...]

  10. Reif says:

    Great explanation! I’ve been trying to work your formula for months, but learned the trick is to follow it step by step. i still find the X screen reverts to 1600×1200 on restarts, but it’s easily resolved within the nvidia settings.

    Thanks so much!

    Reif

  11. Reif says:

    Sorry if this is off topic, but I can’t find the appropriate place for this query: On boot-up, my Karmic unit first dispalys the Kubuntu blue on black logo, then seems to hiccup, and boots again to the Ubuntu logo. This must be a conflict I’ve managed to bring about. Is it easily resolved, or should I re-install? No sweat as I’ve prolly re-installed it 8 to 10 times already…

  12. dwasifar says:

    I assume you’re seeing the blue Kubuntu, then a black screen for a few seconds, and then the brown glow with white Ubuntu logo and animated bar, right?

    What’s happened is that you’ve accidentally replaced your default usplash theme with the Kubuntu usplash theme, probably by installing kubuntu-desktop or some portion of it.

    To get things back to normal, install Startup Manager (sudo apt-get install startupmanager), then run it (it will be in System>Administration) and change the boot splash from usplash-theme-kubuntu to usplash-theme-ubuntu.

  13. Reif says:

    Thanks! The Kubuntu has gone away, but the white Ubuntu logo hangs for a bit, then it boots again into Ubuntu, with the X screen starting at 1600×1200. Still seems to go to bootup sequence twice. These issues aren’t bothering me too much, but I wonder if they could be hogging resources?

  14. dwasifar says:

    That’s normal for Karmic, unfortunately. It’s not booting twice, it just has two boot splash programs – usplash and xsplash. Usplash puts up the starting graphic, and then xsplash is there to conceal the desktop until it’s completely drawn up, so that you don’t see things coming up in pieces.

    I don’t like it that way, myself. I preferred it the way it was in Jaunty and before. I have this tutorial for changing it, if you want.

  15. Reif says:

    The bootup at 1600×1200 can’t be right – is there a fix for that?

  16. Reif says:

    Great tutorial!

  17. dwasifar says:

    Reif :
    The bootup at 1600×1200 can’t be right – is there a fix for that?

    Do you mean to say the splash is coming up at 1600×1200, or your final desktop is at that resolution once boot is complete? What resolution are you expecting instead?

  18. Reif says:

    That is the final resolution for the X screen. Thankfully, the other monitor stays at 1024×768, which is where I like to keep both screens set. I have to go into the Nvidea X Server Settings every time I restart, which is only a minor quibble, but I’d resolve it if I could.

  19. dwasifar says:

    In the Nvidia settings tool, how are you setting the Resolution option for that screen? Are you leaving it set to Auto, or have you selected the specific resolution you wish to use, clicked Apply, and done Save to X Configuration?

    If you’ve done all that, and you’re still having problems, write it up at ubuntuforums.com, include your xorg.conf file in the post, and leave a comment here with a link to the write-up so I can find it easily.

  20. Reif says:

    I keep getting this: “Unable to create new X config backup file ‘/etc/X11/xorg.conf.backup’.” when I try to save it, and I’m a newb to the point of not knowing how to access my xorg.conf file. Thanks again for all the trouble you’re going through with this. I’m trying to develop my Linux chops on my own, which brings me to the occasional brick wall…

  21. dwasifar says:

    Aha!

    You need to run the nvidia settings tool with root access. If it can’t write to the xorg.conf file, your settings will only last for your current session.

    Start nvidia-settings with sudo, from the terminal, like so: sudo nvidia-settings

    Then you should be able to save successfully. On some systems nvidia-settings will bomb when you try to save; that’s an unrelated problem, but if it happens, follow the directions in the tutorial starting from where it says “First, restart nvidia-settings and redo your setup.”

  22. Reif says:

    Wow! Now it’s gone nuts!The screens both hold their resolutions, but the desktop is gone – just 2 white screens. The Ubuntu colored logo is there for both screens, then the white on brown Karmic one comes on the secondary display only. I tried going back into the tutorial, but the terminals seem to open behind the white background, and are unreadable. They show up the the workspace switcher on the panel. I also don’t have the “x” visible to close programs and windows, and have use Force Quit.

  23. Reif says:

    typo – have to use Force Quit

  24. Reif says:

    Hmmmm…..After an initial panic, I checked KDE, IceWM, Xterm, and Gnome Failsafe, and everything seems fine – just not in Gnome, in which I can’t open readable terminals. Failsafe is exactly how I hoped Gnome would be, and I’m fine with staying with that.

  25. Reif says:

    New wrinkle: I mentioned I was using Gnome Failsafe, but it has somehow become invalid, and Gnome is gone. KDE seems fine, but unfamiliar. Dunno how I’m bringing these issues about, also the burner doesn’t see a blank disc, among other things. Is it time to re-install?

  26. Ian says:

    Anyone experienced a problem where programs that use OpenGL hang? I currently am experiencing it. Just about any program I run that uses hardware acceleration randomly causes the system to hang for about 10 seconds. If I turn off dual monitors, the problem goes away. I’m using the latest (195) nvidia ubuntu driver.

  27. dwasifar says:

    @Ian – Have you tried “downgrading” to an earlier nvidia driver?

  28. Ian says:

    @dwasifar – Thanks for the reply. Yep, indeed I have tried downgrading. Actually the problem is worse with older drivers. Version 185 for example caused the system to hang even when I simply ran Firefox.

  29. dwasifar says:

    Originally Posted By Ian
    @dwasifar – Thanks for the reply. Yep, indeed I have tried downgrading. Actually the problem is worse with older drivers. Version 185 for example caused the system to hang even when I simply ran Firefox.

    That’s never happened to me. I’ve occasionally had weird problems with one version or other of the nvidia drivers, but usually changing to a different version has solved it.

    I think at this point you’d probably do better to open the question on the Ubuntu forums, if you haven’t already. You’re more likely to run into someone with your same hardware combination there.

  30. Vlad says:

    Thanks for the tips. But since you are talking about video/visual setups, it would be SUPER helpful if you had some photos/screenshots or graphical examples of what you are talking about. I’m having to imagine what you are describing, but a picture would be worth a 1,000 words here!

    Thanks anyway.
    V

  31. dwasifar says:

    @Vlad – I’m sure there are other tutorials that have pictures if you need them. Most people seemed to be fine with the step-by-step walk-through, though; yours is the first such complaint I have had on this or any other tutorial.

    Alternatively, there’s this.

  32. Mohan says:

    Thanks a lot, you saved lot of time.

  33. charlie says:

    Very well explained article.

    I managed to get two monitors to work (using nvidia Quadro NVS 320M) separately (not as suggested in the article above Twinview), however one of the monitors only shows the cursor, just black background. Also when I try to drag windows onto the “extended screen” these are not displayed.

    any ideas?

    thanks

  34. For the bonus tip: just crete a panel and ALT+drag it where you want ;)

  35. dwasifar says:

    Originally Posted By Julien NicoulaudFor the bonus tip: just crete a panel and ALT+drag it where you want ;)

    @Julien Nicoulaud – D’oh! I knew there had to be a better way. Thanks, I’ll add it to the article.

  36. Webpastor says:

    I’m with charlie on this,

    I’m running Ubuntu 9.10 on a Dell system with a GeForce 8400 graphics card. I’m able to run in TwinView with no problem, but I would rather run Separate X screens. When I setup Separate X screen configuration the primary display is fine, but the 2nd display only has a black screen. I am able to run the mouse on the 2nd display, but no graphics whatsoever.

    Any help would be appreciated.

    Thanks

  37. Derrick Ashby says:

    Thanks for the tip re the failure to pass the xconf file. I now have separate X windows for each monitor, and I can run programs in each. Interestingly I had no trouble setting this up in KDE, but Gnome gave me problems. (I’m currently using Gnome because KDE is giving me grief with sound, but that’s another story…) A couple of oddities – I can’t move a window from one screen to the other just by dragging. Is this to be expected? (This works fine with Windows 7), and the second screen’s bottom panel is only showing 2 virtual windows instead of the 4 on the first screen – even though the preferences says there are 4. I’d also like to have different wallpapers on each monitor. Is that possible?

  38. @roibondi says:

    Everything worked fine for me, but after my last restart I suddenly can’t stretch apps screens over 2 screens. Any ideas ?

  39. dwasifar says:

    Originally Posted By @roibondi
    Everything worked fine for me, but after my last restart I suddenly can’t stretch apps screens over 2 screens. Any ideas ?

    Is your second screen still active at all, or just black?

  40. @roibondi says:

    @dwasifar – My second screen is active. I can move windows from on screen to the other and even stretch them from one screen to the other – but only half way on each side. I can’t stretch a window more then one screen wide.

  41. dwasifar says:

    @@roibondi – Hm. I just tried it, and neither can I, as it turns out. I never tried to make a window that big before, so I never knew about that limitation.

  42. @roibondi says:

    Good news ! Found a solution – instead of just pressing the mouse button and stretching the screen, I use ‘ALT’ and ‘middle mouse button’. :-)

Leave a Reply

Markup Controls