Tuesday, January 29, 2008

Extended desktop configuration with xrandr

I've got Ubuntu 7.10(gutsy) running pretty well on my DELL Latitude D505 laptop. I'll try to explain how I configured extended desktop with a NEC 19'' LCD monitor.
We will use xrandr utility to configure multiple screens. Before using xrandr you must check xorg.conf file ( /etc/X11/xorg.conf )

Section "Screen"
Identifier "Default Screen"
Device "Intel Corporation 82852/855GM Integrated Graphics Device"
Monitor "Generic Monitor"
Defaultdepth 24
SubSection "Display"
Depth 24
Virtual 2304 1792
Modes "1280x1024@75" "1024x768@60"

The Virtual keyword is important. Sum of resolution widths and sum of resolution heights of two monitors are written in Virtual.
For example : 1280 + 1024 = 2304 and 1024 + 768 = 1792

You must restart X server after updating xorg.conf file. ctrl-alt-backspace is the shortcut to restart X. After successfully restarting X server, run the following commands:

xrandr --output VGA --mode 1280x1024
xrandr --output LVDS --mode 1024x768
xrandr --output VGA --right-of LVDS
First command sets VGA (19'' LCD monitor) resolution to 1280x1024. Second command sets laptop monitor resolution to 1024x768. The last command places the extended monitor (VGA) right of laptop monitor. That's it. At least it works for me.

For more information check intellinuxgraphics.org site.


Austin said...

Thanks a bunch. I found this with a Google search and it helped me get dual monitors working the way I wanted.

A couple of notes: The Virtual option in the Display subsection doesn't need to add both the height and width of the monitors. If your monitors will be side by side, you add the widths together, and use the height of the largest monitor. If your monitors will be one on top of another, you add the heights and take the width of the largest monitor.

So in your case, 2304x1024 would be appropriate.

Houston said...

I agree, this totally helped out a lot. Also, if you still need your laptop to be portable, you can turn the VGA off with 'xrandr --output VGA --off'. Then, we you want the extended desktop again, do 'xrandr --output VGA --auto --right-of LVDS'. Werd.

Anonymous said...

thanks this worked great, got extended desktop working, didn't even bother with the xorg.conf settings. only problem was that it made compiz only work with XRendr and this is like watching paint dry. great thing is you can also use 'xrandr --output LVDS --off' to turn off your laptop display (motion le1600).

deniz dizman said...

yil 2011 olmus, hala xrandr mi kaldi deme, xmonad WM kurdum, baya ise yaradi bu xrandr setupu. Tesekkurler.

Bechelli said...

Worked like a charm for me too. Thanks a lot!

Bechelli said...

Worked like charm for me. Thanks for the post!