Dual Monitors with NVidia in Ubuntu

Sponsored Link
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!

Sponsored Link

You may also like...

96 Responses

  1. kay says:

    Thank you very much, it works for me, got my dual screen.
    This si what did the trick for me.

    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?

  2. Vincent says:

    I lost the xorg.conf_backup file at which now Ubuntu won’t boot up -_-

  3. Apsolutno says:

    “NVidia has great Linux support”

    NVidia proprietory drivers are not open source.
    They do not support Linux at all.

  4. poktor says:

    well err…. nogo thusfar:

    “E: Package ‘nvidia-glx’ has no installation candidate.”

  5. andy says:

    E: Package ‘nvidia-glx’ has no installation candidate.”,,””””can anyone help me out

  6. ksanger says:

    Maybe in 2007 when this article was written nVidea had great support.

Leave a Reply

Your email address will not be published. Required fields are marked *