Wednesday, 13 August 2008

Dual Monitor Setup On Ubuntu 7.10

This is a Howto about getting 2 (or with small modifications more) monitors working on Ubuntu 7.10 as a single big screen.


Get it to work

Connect one monitor to VGA and one to DVI on your computer.

If you see the desktop in mirror mode on both monitors after you connected the second one, then you just have to do some few steps to get it in extended mode.

Don't touch the GUI Setting tool (displayconfig-gtk) for monitors, it won't work correctly and may destroy your xorg.conf

To see the identifier for your monitors you can use:

xrandr -q

See sample output below:

Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 3200 x 1200
VGA connected 1280x1024+0+0 (normal left inverted right) 376mm x 301mm
1280x1024 60.0*+ 84.8 75.0 59.9
1280x960 84.9 59.9
1152x864 74.8
1024x768 84.9 75.1 70.1 60.0
832x624 74.6
800x600 84.9 72.2 75.0 60.3 56.2
640x480 84.6 75.0 72.8 66.7 60.0
720x400 70.1
TMDS-1 connected 1280x1024+0+0 (normal left inverted right) 518mm x 324mm
1920x1200 60.0 +
1600x1200 59.9
1680x1050 60.0
1280x1024 75.0* 59.9
1440x900 75.0 59.9
1280x800 74.9 59.8
1024x768 75.1 60.0
800x600 75.0 60.3
640x480 75.0 60.0
720x400 70.1


VGA is the identifier for my old 17" TFT that is connected with a VGA cable and TMDS-1 is my new 24" monitor that is connected with a DVI cable.

To find out, which resolution you have to set for the virtual display, you can use following command instead of calculating yourself ;-)

xrandr --output TMDS-1 --auto --left-of VGA

Sample Output:

xrandr: screen cannot be larger than 1920x1920 (desired size 3200x1200)

This output tells you the needed size of the virtual desktop that you have to enter in xorg.conf.

sudo pico /etc/X11/xorg.conf

There you go all the way down to the section "screen" and add "Virtual {X} {Y}" below the mode line:

Section "Screen"
Identifier "Default Screen"
Device "Intel Corporation Integrated Graphics Controller"
Monitor "Acer X243W"
DefaultDepth 24
SubSection "Display"
Modes "1920x1200" "1680x1680" "1600x1200" "1440x1440"$
Virtual 3200 1200
EndSubSection
EndSection

Now you have to reload your X-Server:

press ctrl+alt+backspace

Log in again and enter the command from the beginning in a console window.

xrandr --output TMDS-1 --auto --left-of VGA

You should now have an extended desktop where the left side of the desktop is on the big 24" monitor and the right side on the old 17" monitor. For xrandr you could also use following arguments for positioning:

--pos {x}x{y}
--left-of output
--right-of output
--above output
--below output

You can add the xrandr command to session startup scripts to have it executed automatically.


Adding to session startup on gnome

Go to: System > Preferences (Einstellungen) > Session (Sitzungen).

Add a task called "dualhead setup" and use the command

xrandr --output TMDS-1 --auto --left-of VGA

or whatever xrandr command you have.

There exists one problem... It's not enabled before you log in. If you know in wich init file you can put the command, please leave a comment or send me a PM.

No comments: