Dual monitors on dual video cards on Ubuntu

5,681

Use nvidia-settings to configure your display adapter. Maybe you should try installing the latest proprietary NVIDIA driver.

After googling for a while, I learned that if I want to use two displays, I have to enable TwinView or Xinerama in nvidia-settings. Xinerama is out of question because it disables compiz. If you don't want to use compositing, which is required for compiz, just use Xinerama.

I have 2 video cards and if I turned on TwinView for both of them, Unity panel stretched on the whole 2 monitor desktop and app windows kept opening in the middle near the edge of the two displays.

Finally I decided to stick with separate X screens. The problem with this was compiz only started on the primary screen only, so I had to write two scripts to start it on Screen1 and Screen2 (I’m not using Screen3):

#!/bin/bash
DISPLAY=`echo $DISPLAY | sed s/[.]0$//`.1
compiz --replace &
sleep 5
google-chrome --user-data-dir=/home/nonoo/.config/google-chrome1 &

#!/bin/bash
DISPLAY=`echo $DISPLAY | sed s/[.]0$//`.2
compiz --replace &
sleep 5
google-chrome --user-data-dir=/home/nonoo/.config/google-chrome2 &

As you can see, the scripts also autostart Chrome on those displays automatically. The sleep lines are needed because without them Chrome’s window titlebar will show up behind the Unity panel.

I had another problem: there was no wallpaper on the screens, just a solid white background. To fix this, I installed “Advanced Settings” in the Software Center, and switched off “Have file manager handle the desktop”.

Share:
5,681

Related videos on Youtube

Jeff Schaller
Author by

Jeff Schaller

Unix Systems administrator http://www.catb.org/esr/faqs/smart-questions.html http://unix.stackexchange.com/help/how-to-ask http://sscce.org/ http://stackoverflow.com/help/mcve

Updated on September 18, 2022

Comments

  • Jeff Schaller
    Jeff Schaller over 1 year

    I have been trying this to no avail. I am new to Linux, so a step by step explanation would be greatly appreciated. I have two NVIDIA GeForce 8600 GT video cards. I want a monitor to run on each card, so Twinview cannot be used because my understanding that is only for single video cards.

    I went to the system monitors tab and my second display is detected but disabled. So I enabled it by clicking configure. It says switch to XScreen (requires restart of x server) and I set up my settings so that the new monitor is to the left of the main one. I apply the changes by updating the xorg.conf file which is what it says to do after you click apply.

    When I reboot, I can't even login to the desktop. The GUI is all messed up and goes to the command line. It has to do apparently with the new changes made to the xorg.conf file, so I have a back up and just put the old one back and then I can get back to the GUI.

    I have done this several times with several different variations of setting up the monitor and I run into the same problem. I even tried to restart gdm without rebooting and it actually does nothing or resets all the monitor configurations that I made.

    I would like to use dual monitors in Ubuntu.

    • Admin
      Admin over 12 years
      Have you tried the nvidia-settings program?