Ubuntu: Resizing Virtual Screen in X11

Thanks to a little surplus grant money, I was able to purchase a nice, large, external monitor for my office.  With my docking station, that meant I could use two monitors simultaneously – my laptop monitor and my external monitor.  I had been doing this previously, but the external monitor I had before was about the same size as my laptop monitor (15″), so setting it up using dual monitors in Ubuntu was relatively easy.  But the new monitor is, well, huge (28″) and has a much higher native resolution – 1920×1200 vs. 1024×768.  I had two problems when initially trying to set up my new dual monitor system.  First, X11 wasn’t correctly detecting the possible resolutions for the monitor – it only allowed resolutions up to 1024×768.  Second, X11, when I first set up the dual monitor system, created a default virtual monitor that was 2048×768, which basically meant that I couldn’t go any larger than that.  As it turns out, solving the second problem solved the first problem for me.  Keep in mind that I’m using Ubuntu 9.04 on my laptop because of some other X11 problems that 9.10 had when I first tried it out.

Here’s how I solved this.  In a terminal, I input the command to modify the X11 configuration file:

$ sudo gedit /etc/X11/xorg.conf

Technically you should always back this up before you mess with it, but I didn’t this time around as I knew I was just going to change one thing and figured I could always change it back if there was a problem.

In the “screen” section of the xorg.conf file, it said:

Section “Screen”
Identifier    “Default Screen”
Monitor        “Configured Monitor”
Device        “Configured Video Device”
SubSection “Display”
Virtual    2048 768
EndSubSection
EndSection

I changed the settings for “virtual” to: 2944 1200, which is the maximum width and height of my new monitor combined with my laptop monitor (width – 1920+1024=2944; height – 1200 encompasses 768, so I went with 1200).  So my new xorg.conf file looked like this:

Section “Screen”
Identifier    “Default Screen”
Monitor        “Configured Monitor”
Device        “Configured Video Device”
SubSection “Display”
Virtual    2944 1200
EndSubSection
EndSection

Once I changed this, I logged out, then logged back in.  Then using the “Display” tool (System->Preferences->Display), I selected my 28″ monitor and found that the maximum resolutions were now available.  I chose the correct one – 1920×1200, and hit apply.  Et voila, my dual monitors are now using their maximum resolution.  I think the video card in my laptop is freaking out trying to handle this resolution, but it works!