Monday, September 05, 2011

One horizontal and one vertical monitor for Ubuntu 11.04

I recently had problems configuring Ubuntu with dual screens using an NVidia card - the first screen is horizontal and the second screen is vertical - they are both Dell U2711 monitors. The idea is to be able to have Firebug running on the screen without obscuring the web page.

This should be a simple thing. But from what I can tell NVidia's TwinView driver doesn't support different monitor rotations (under Linux). But having X Windows it should still be easy using dual X Screens. It should just be a matter of going to NVidia X Server Settings, selecting "Separate X Screen" and then selecting "Enable Xinerama". Unfortunately for me, this caused general weirdness where the first screen was mostly black and the second screen was displayed horizontally.

The way I fixed the problem was to disable Compiz. The easiest way I found to disable Compiz was to log in using the "Ubuntu Classic (No effects)" session.

Then it was just a matter of enabling multiple XServers and Xinerama and enabling rotation (RandRRotation). Here are the bits in my xorg.conf to rotate my second monitor to the left:

Section "Monitor" 
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor1" 
    VendorName     "Unknown" 
    ModelName      "DELL U2711" 
    HorizSync       29.0 - 113.0
    VertRefresh     49.0 - 86.0
    Option         "RandRRotation" "on" 
    Option         "DPMS" 
Section "Screen" 
    Identifier     "Screen1" 
    Device         "Device1" 
    Monitor        "Monitor1" 
    DefaultDepth    24
    Option         "TwinView" "0" 
    Option         "metamodes" "DFP-2: nvidia-auto-select +0+0" 
    Option         "Rotate" "left"
    SubSection     "Display"
        Depth       24