There are 2 basic approaches you can take. The first is to utilize randr which will allow you to create one large virtual display in which you can position your monitors. The second is to utilize xinerama which will allow you to have 2 separate X screens which will function as one large display. I will cover both here and you can decide which is more appropriate for your needs.
RandR - Resize and Rotate
You can dynamically enable dual head by using XRandR
xrandr --output foo --above bar
There is also a gui frontend for this called arandr which is in the 12.04 repos, but it would seem that you want a more static configuration.
It could be as simple as creating /etc/X11/xorg.conf.d/10-monitor.conf with the contents:
Section "Monitor"
Identifier "Monitor0"
EndSection
Section "Monitor"
Identifier "Monitor1"
Option "Above" "Monitor0"
EndSection
This method implies an randr setup. There are some notable drawbacks if using xrandr with monitors of different resolutions. Windows may be improperly placed, there may be black areas on one screen, etc..
When you run xrandr without command line options you can find out which Identifier you need to use in your 10-monitor.conf. Then restart Ubuntu to see if the settings are loaded.
Xinerama
To enable xinerama you need to modify
/etc/X11/xorg.conf:
Section "ServerFlags"
Option "Xinerama" "true"
EndSection
It might be as simple as that as X is pretty good about automagically configuring things based on hardware detection. But, if simply turning the xinerama extension on does not provide the functionality you desire, you may opt to fully configure X to use xinerama. There are a few ways to configure X. You could have multiple files in /etc/X11/xorg.conf.d/, some for your monitors, some for the devices, etc. I will cover having a single xorg.conf file that contains all the settings using a modified version of my current setup.
Section "ServerLayout"
Identifier "DualHead"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" Above "Screen0"
Option "Xinerama" "1" # You can specify xinerama here
EndSection
Section "Device"
Identifier "Device0" # A Device section for each monitor
Driver "nvidia" # Specify the driver to use
VendorName "NVIDIA Corporation"
BoardName "GeForce GT 430"
BusID "PCI:1:0:0" # Use lspci | grep VGA to find BusID
Screen 0 # Do note the screen number
EndSection
Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GT 430"
BusID "PCI:1:0:0"
Screen 1 # Do note the screen number
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Gateway HX2000"
HorizSync 31.0 - 83.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "Unknown"
ModelName "DELL 1907FPV"
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
EndSection
Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "Monitor1"
DefaultDepth 24
EndSection
Obviously you will need to modify this to suit your hardware, but the basic skeleton is there for you.
Do note that I have recently read that Intel might have issues with xinerama. You may find yourself needing to utilize your discrete graphics card.