There’s a lot of stuff on the web about how to setup your nvidia card with ubuntu. After a lot of work, I am able to switch between single and dual monitor setup with an nVidia Quadro 1000M video card on my Lenovo Thinkpad w520 running Ubuntu 11.10. The following is an instruction list that worked for me.
BIOS: set to discrete and disable optimus detection
Run “sudo nvidia-xconfig” to replace the current xorg.conf file. Alternatively, you could use my config file, available here
Edit /etc/X11/xorg.conf and add the following to “Device” section
* Where the BusId bit is determined by the output of:
If disper doesnt work (it will), you could do it the uglier way: run “nvidia-settings” and click the “detect monitors” button. Click “apply.” (Don’t “save” the settings because you’ll probably overwrite the xorg.conf file that has your customizations in it.)