May 12, 2007 · General · Email This Post
Share

If you're new here, you may want to subscribe to my RSS feed and if you have questions related to your ubuntu system post question to our forums. Thanks for visiting!

It’s quite a pain to get dual monitors working your first time using Linux, however I hope this guide will make the process relatively quick and painless.

The first step towards dual monitors involves installing the NVidia 3D drivers. Luckily, NVidia has great Linux support and the drivers can easily be downloaded from the Ubuntu repository. Ubuntu Feisty Fawn gives users the option to install these drivers when first installing, but in case you chose not to install these drivers, all it requires is one line of code in the terminal:

sudo apt-get install nvidia-glx

Now that the drivers are installed, let’s make sure that we’re using them. First, let’s check xorg.conf, the main location for display settings in Linux. Type sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_backup. This ensures that we have a backup copy in case some of the settings we’re about to edit break X and don’t allow you to use a graphical interface! I suggest always doing thins before changing settings in Linux manually to ensure easy recovery later. Now we’re ready to edit our settings, so type sudo gedit /etc/X11/xorg.conf. Under the module section, replace “nv” with “glx”. Under the device heading, make sure that Driver says “nvidia”. Under the screen section, add the following line:

Option “RenderAccel” “true”.

Now save your changes and close gedit. We’re going to reload X to ensure that we’re now using the proper drivers. Reload X by hitting Ctrl+Alt+Backspace. This will require you to log back into Ubuntu, so if you’re not using a browser that saves your session, like Firefox/Swifterfox, make sure you bookmark this guide to follow the remaining instructions. If our install worked, you should see the NVidia logo flash quickly before the Ubuntu log in screen comes up. Actually, if this doesn’t work, you’re not going to be able to load X properly. If that’s the case, you’re going to have to type this into the console to replace the new xorg.conf with the old:

sudo cp /etc/X11/xorg.conf_backup /etc/X11/xorg.conf

Assuming everything went well, we’re quite close to having dual screens working. Let’s go back into xorg.conf using sudo gedit /etc/X11/xorg.conf. Now go back under the heading “Screen”. Let’s add a few lines:

##This turns on NVidia’s TwinView
Option “TwinView”
##Here I’m setting the resolution to the individual monitors.
Option “MetaModes” “1280×1024 1280×1024″

That should be it! Restart X with Ctrl+Alt+Backspace and you should have two screens. If the orientation of the screens is off, try this under the “Screen” heading…

Option “TwinViewOrientation” “LeftOf”

LeftOf can be LeftOf, RightOf, Below, Above, or Clone.

Hope that was helpful!
Thanks to the progress in technology by 220-601 and 70-620 professionals, a dual monitor is not just limited to the laboratory of a 1Y0-259 pro. It was basically a requirement in SY0-101 and 642-812 courses to work on the kinks of the project and finally in 70-236 certifications candidates learn to operate it fully.

  • Share/Bookmark

Related Articles

74 Comments to “Dual Monitors with NVidia in Ubuntu”

  1. NShiell says:

    BIG THANK YOU!
    I spent hours on this.
    I now have 19″ CRT with a 17″ TFT
    And Compiz desktop cube rotating on my screens

    Basically the Nvidia GUI config couldn’t parse the existing xorg.conf????? So I had to manually hack it, your instructions above worked for me.

    P.s. ctrl-alt-backspace didn’t seem to do much? So instead i just did a reboot each time.

  2. ejdo says:

    NShiell; were you running the nvidia config thing as root?

    if you didn’t, it wont work

  3. Devin de Gruyl says:

    Nshiell: Since version 8.10, Ubuntu has shipped with the Ctrl+Alt+Backspace shortcut disabled by default, to prevent its accidental use. It can be reactivated, but you’ll have to install and run a small program called “dontzap” first:

    sudo apt-get install dontzap
    dontzap -e

    …and then reboot. After this, Ctrl+Alt+Backspace should function normally again.

  4. Devin de Gruyl says:

    …My fault, I gave the wrong option for dontzap in my above comment. It’s “dontzap -d“, not “-e”. Sorry for that.

    Anyway…

    sudo apt-get install dontzap

    dontzap -d

    …should do the trick.

  5. marius says:

    sudo apt-get install nvidia-glx
    yield:
    Package nvidia-glx is a virtual package provided by:
    nvidia-glx-96 96.43.10-0ubuntu1
    nvidia-glx-71 71.86.08-0ubuntu1
    nvidia-glx-180 180.44-0ubuntu1
    nvidia-glx-173 173.14.16-0ubuntu1
    You should explicitly select one to install.

    So which one I do pick ?

    I picked 1th one. After adding
    Option “RenderAccel” “true”.
    I get parsing error.

  6. Jon Bystedt says:

    This came up as the first hit in google, so for what it’s worth here’s my two cents. The above method did not work for me -- it consistently picked the wrong monitor to make the default. After some screwing around and trying to make nvidia-settings work (may or may not be broken depending on what mood it’s in) I came up with this:

    Section “Device”
    Driver “nvidia”
    Option “NoLogo” “True”
    EndSection

    Section “Screen”
    Option “TwinView” “1″
    Option “metamodes” “CRT: 1280×1024 +1680+0, DFP: 1680×1050 +0+0″
    EndSection

    That’s my ENTIRE xorg.conf file and it works like a charm. Please note that the names ‘CRT’ and ‘DFP’ in the ‘metamodes’ line may be different for you. If you open up nvidia-settings you can find out what it likes to call your monitors. The resolutions are whatever your monitor’s resolutions are, and the ‘+1680+0′ positions the monitor called ‘CRT’ to the right of ‘DFP’ (which is 1680 pixels wide).

    @marius: The higher numbers denote later versions, if you have an at all recent graphics card you should try 180 first. Also, many of the Option “blahblahblah” lines are no longer necessary with the later versions of X.

  7. beck says:

    Here is a post that helped me

    http://ubuntuforums.org/showthread.php?p=8258827#post8258827

    Here’s what I did to get around it:

    sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
    sudo nvidia-xconfig
    sudo nvidia-settings

    The first step creates a backup of your currently working xorg.conf file.
    Step 2 runs the NVIDIA utility to generate a new xorg.conf file that the utility can actually read.
    Step 3 runs the graphical NVIDIA setup tool as root, so you can actually save your changes.

    If this does not work then after step 1, do sudo rm /etc/X11/xorg.conf to delete your current xorg.conf file. Then run sudo nvidia-xconfig and sudo nvidia-settings.

    I hope this helps someone else…..

  8. Richard Moore says:

    Hi, I have dual monitors and I’m using the fancy desktop affects - wobbly windows 3D cube etc. I can’t find a way to move a window from one monitor to the other. Is there one? If I set Xinerama in the NVIDIA settings then I can drag windows across monitors, however Xinerama disables all the fancy desktop affects.

    Richard

  9. Similar to this discussion, I have one monitor, but it always loads in VGA, and I have to always go into Display settings (in Ubuntu 9.04 jaunty jackaloupe) and set the HDMI connection as primary on twinview, then go and disable the vga, and click apply to get an HDMI screen. Can anyone tell me how to get it saved so it loads on HDMI every time from bootup? The conf file doesn’t want to save when I click Save To Configuration file.

  10. jcode says:

    Much appreciation! Worked the first try in karmic. Many thanks!

  11. A Fuddyduddy says:

    Becks way worked out just fine.

  12. jandrioli says:

    Please vote on Adobe’s website so they will fix the twinview-fullscreen bug: http://bugs.adobe.com/jira/browse/FP-562

    there less than 50 votes right now!

  13. ubnoob says:

    Thank you soo much for this tutorial. Worked excellent and gave me a little lesson. I actually understood what I was doing and am able to apply this to other tasks in Linux. Much appreciated :)

  14. ponteaus says:

    Thanks!! That “RenderAccel” option proved to be the magic line of code. All of a sudden, everything is beautiful :)

Leave a Reply