HOWTO: Rotate the screen in Linux using Nvidia

Posted by Bob Hazard On Monday, 23 November 2009 11 comments

When you open the normal display options in Ubuntu the choice to rotate your display in landscape or portrait mode is disabled if you are using proprietary NVIDIA drivers.

It turns out that NVIDIA disabled it for performance reasons and if you edit the xorg.conf file you can rotate the screen using xrandr.

TIP: If you are uncomfortable editing the system files make a backup of xorg.conf first because you might loose the desktop if you make a mistake. Copying the file back will restore the previous settings.

Open the /etc/X11/xorg.conf file in a text editor as root such as
gksu gedit /etc/X11/xorg.conf

Then look for the device section which should have the name of your graphics card, and add an option at the end which I have highlighted in bold:

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 8800 GTS"
Option "RandRRotation" "true"

If you are using twinview with two monitors then you may have a second device1 add this line to that section as well

Save the file and log out so that the xserver will restart and apply the changes.

Now you can rotate the screen using the xrandr command (x rotate & resize) such as:
xrandr -o left

To restore the rotation use
xrandr -o normal
There are many options which you can see using xrandr --help or a quick google search