Ever since I’ve been using two monitors at work I’ve wanted to setup two monitors at home but finances are tight and I just can’t afford another flat screen. But this weekend I did dust off my daughters old 17″ CRT and tried to get it working with my Dell widescreen. I knew the latest Ubuntu had made advances in setting up monitors but I was also familiar with hacking on xorg.conf so I wasn’t too concerned with screwing anything up. I backed up my xorg.conf and started tinkering.
I originally messed with Ubuntu’s native screen controls but they were having no effect. After a bit of digging I discovered if you are using the ‘restricted’ NVIDIA drivers (which I was) there is another application for tweaking settings - nvidia-settings. This was a bit confusing. Which one to use? (Ubuntu should check to see if the NVIDIA drivers are installed and if so disable the native screen tools.) The NVIDIA application provided a nice dialog - both screens were showing - but at incorrect resolutions. I tweaked a few things - saved, restarted my session. Nothing happened. The CRT was working but my Dell widescreen was doing nothing. I tried a few more things and got frustrated so I hit the Ubuntu forums. Lots of threads on there about running dual head but no real silver bullet solutions. One suggestion did mention running the settings application as sudo. I tried that and things started to work. After a bit more experimentation I got the following modes to work.
Twinview - this is a NVIDIA setting. It basically takes your current desktop and ’stretches’ it across both monitors. This would probably work OK if both monitors were the same size and resolution but since mine were different - it was a bit odd to work with. I could also not ‘contain’ my applications to one screen. If I maximized a window - it would stretch across both monitors. Not ideal.
Next I turned off Twinview and enabled Xinerama.
Xinerama is an extension to the X Window System which enables multi-headed X: applications and window managers which use two (or more) physical displays as one large virtual display.
This worked but oddly enough some applications (like terminal and Gnome Do) would not start. After tinkering a bit I discovered the fancy new compositing window manager Compiz wasn’t running. Why? I have no idea. But overall this was the most “Windows” like setup. I could drag running applications between screens but if I maximized an application it would contain itself to one monitor. But without Compiz running the system was unusable. If I can get Compiz running in this mode I’ll be happy.
Finally I removed the Xinerama setting and just set configured two X sessions. This gave me two independent desktops. I had two taskbars, two desktops and while I could drag and drop icons and files between the two screens I could not open an application on one desktop and move it to the other. This works and is what I’m using now but obviously it is not ideal.
I’m going to tinker with the ‘restricted’ NVIDIA drivers a bit more. If I can’t make any progress I may try the drivers from the NVIDIA site itself and see if anything improves. The other alternative is to figure out why Compiz isn’t running and fix that.
I’ve been so happy running Ubuntu it is a shame that getting this setup is so difficult. While I’m happy tweaking things I could easily see others hitting this roadblock and giving up. Hopefully the Ubuntu team will make some progress on tightening up the integration between native Ubuntu apps, restricted drivers and Compiz.

You May Also Enjoy Reading:
13 Comments
You sure your terminal not starting was because Compiz wasn’t running?
I use a TRI-HEAD setup on Ubuntu 7.10 w/o Compiz (and am using Xinerama) and have no problems what-so-ever. I have three Dell 19″ LCDs running at 1280×1024 in-line. I have two Nvidia cards (each 128MB) and the built-in Intel GMA adapter (using i810). The box is a HP Pavilion a6120n. Runs just fine.
Just curious.
> Hopefully the Ubuntu team will make some progress on tightening
> up the integration between native Ubuntu apps, restricted drivers
> and Compiz.
Actually, hopefully a Free Software driver is ready soon which can do these types of things on an NVidia graphics card.
Due to the rapidly-moving state of Free Software (like the X Server, which gives Linux its graphics) and the slow-moving, closed source state of NVidia drivers (and other companies), making these work together always is extremely difficult.
Nouveau is a project to try for better 3D drivers for the NVidia card, but it isn’t done yet.
If you really want to use any Linux with this type of setup, do the whole community a favor and let NVidia know that they need to Free their drivers. PLEASE. It’s the least we can all do in exchange for the great software that makes up Ubuntu and the other wonderful Linux distributions.
@ratchet - I’m not 100% sure. Now that I have sort of figured out things I need to go back and explore a bit more. It was odd though because I have terminal and Gnome-Do to startup automatically - and running that particular config - they would not run. I didn’t poke around too much to see what else didn’t work.
You should be able to drag applications between screens in the final setup you mention (two X screens). Ensure you have the LeftOf or RightOf option enabled. Read this…
http://gentoo-wiki.com/HOWTO_Dual_Monitors
Well I’m running a nvidia driver based TwinView system with compiz and two monitors and when I maximise windows they fill the screen they are currently in.
I just don’t how I did it. I’l try and work it out though. Hmmmm.
@Simon - tonight I’ll setup a Linux page on my wiki and I’ll make a xorg.conf page where you could post your config if you’d like…
Feel free to post your xorg.conf file here:
http://www.thecrumb.com/wiki/Talk:Xorg
Hi Jim, I just wanted to mention that I am running twinview having used nvidia settings and for me applications when maximised stick to the limits of each display under both metacity and compiz.
Gutsy Install with 8600GT and the 100.14.19 driver installed via restricted driver manager with a 20″ samsung and 17″ benq both running via dvi.
@Ryan - thanks for the info. You know I need to check and see if I have the latest restricted driver from Ubuntu. I’m not sure how to update those?? Hopefully I will have time over the weekend to tinker with this again.
Maybe check directly in synaptic to see which version you have installed (nvidia-glx or nvidia-glx-new). I’m using new and if your card is supported perhaps upgrading to that will address the issue. By the way I don’t think 3D apps can work well (and definately not compiz) with xinerama because it disables dri. I came accross this when my little sister couldn’t play tuxcart because I had setup userful to let her and my brother both use the computer at the same time.
Whoo hoo! I tinkered with things a bit more tonight. Twinview just doesn’t work for me - I think it’s an issue with the different monitor size/resolutions.
But I ended up UN-installing everything NVIDIA related from Synaptic. I then installed the nvidia-glx-new and everything it said I needed. A quick reboot and everything was working as before - I then enabled Xinerama and it worked. I just had to switch the xorg.conf to LeftOf and my screens are all setup and I can drag apps between monitors AND all my apps (Terminal / Gnome Do) work.
Though right now Gnome Do comes up on the left monitor and I’d like it to come up on the right but I can live with that for now
I was reading on the urban terror forums that in order for this to work you have to have metamodes in xorg.conf so maybe that’s the issue anyway thought I would post the relative section for you or anyone else interested.
# Removed Option “metamodes” “DFP-0: 1680×1050 +0+0, DFP-1: 1280×1024_75 +1680+0; DFP-0: 1280×1024 +0+0, DFP-1: nvidia-auto-select +1280+0; DFP-0: 1024×768 +0+0, DFP-1: 1280×1024 +1024+0; DFP-0: 800×600 +0+0; DFP-0: 640×480 +0+0″
Identifier “Screen0″
Device “Videocard0″
Monitor “Monitor0″
DefaultDepth 24
Option “AddARGBVisuals” “True”
Option “AddARGBGLXVisuals” “True”
Option “NoLogo” “True”
Option “DRI” “true”
Option “XAANoOffscreenPixmaps” “true”
Option “TwinView” “1″
Option “metamodes” “DFP-0: 1680×1050 +0+0, DFP-1: 1280×1024_60 +1680+0; DFP-0: 1280×1024 +0+0, DFP-1: nvidia-auto-select +1280+0; DFP-0: 1024×768 +0+0, DFP-1: 1280×1024 +1024+0; DFP-0: 800×600 +0+0, DFP-1: NULL; DFP-0: 640×480 +0+0, DFP-1: NULL”
SubSection “Display”
Depth 24
EndSubSection
EndSection
Here’s a link to my xorg.conf file. I couldn’t get what I wanted out of the Nvidia-Settings.
I’ve got two monitors on one video card and a third on a second video card. It was a bit tricky but it all works really well. Twinview on the two on the same card, and a separate screen on the third (separate card).
Hopefully it’ll help.
http://phpfi.com/329606