Dual screens with NVIDIA in Linux
In a previous post, I wrote about dual screens with NVIDIA in Linux, including how to set up NVIDIA Twinview in Intrepid. In this post, I will continue with how to set up Separate X screen in Intrepid.
Hardware
I have a PC with a LCD monitor as the primary screen connected to the DVI port, and a LCD TV as the secondary screen connected to the VGA port. For completeness, here is the information on my graphics hardware.
00:05.0 VGA compatible controller: nVidia Corporation C51PV [GeForce 6150] (rev a2)
Things you should not do with NVIDIA in Intrepid
First, the “Save to X Configuration File” button in nvidia-settings could cause breakage in Intrepid. The xorg.conf generated by nvidia-settings cannot be used as it is in Intrepid.
Second, do not use the Ubuntu Screen Resolution tool (found under: Main Panel Menu > System > Preferences). At best, it would not do anything. At worst, it might confuse the NVIDIA driver and cause other problems.
Manually add Separate X screen into xorg.conf
The starting point is a fresh install of Intrepid beta. Attach only one display during install. After first boot and grabbing all updates, enable the NVIDIA restricted driver. Then, following another reboot, you should now have an xorg.conf that looked like this.
Section "Monitor" Identifier "Configured Monitor" EndSection Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" DefaultDepth 24 EndSection Section "Module" Load "glx" Disable "dri2" EndSection Section "Device" Identifier "Configured Video Device" Driver "nvidia" Option "NoLogo" "True" EndSection
Before continuing any further, back-up the current working xorg.conf. This gives you a fall back option in case you messed up.
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.original-working-backup
1. First, we want to generate an example xorg.conf using nvidia-settings. Connect the second display. Run nvidia-settings without root privilege. You can do this via:
Top Panel Menu > System > Administration > NVIDIA X Server Settings
or via command:
nvidia-settings
Reminder: run without root privilege. We want to generate an example xorg.conf to help us in the manual configuration, and do not want to accidentally overwrite the xorg.conf file.
2. Select “X Server Display Configuration” on the left pane.

3. Click “Detect Displays” button. The second display should now appear in “Layout”.

4. Select the second display (red highlight), then click “Configure” button.

5. Select “Separate X screen (requires X restart)”, then click “OK” button.

6. Depending on your display, the correct resolution might not be detected. Click “Resolution” dropdown and select your preferred resolution.

7. Click “Apply” button.

8. Click “Save to X Configuration File” button. You might get an error messagebox; ignore it and click “OK” button.

9. Click “Show Preview” button.

10. The dialogbox will expand and reveal the xorg.conf generated by nvidia-settings.

11. Now, leave the nvidia-settings for a moment, and open xorg.conf (in gedit) with root privilege.
gksudo gedit /etc/X11/xorg.conf
12. We will now copy/paste lines from nvidia-settings to gedit (with xorg.conf). Copy these Section “ServerLayout” lines from nvidia-settings, and paste them to the bottom of xorg.conf file. Note that the lines for InputDevice should be discarded.
Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen0" EndSection
These lines will set the correct left-right order of displays vs screens, where the display connected to the DVI port will be the primary screen on the left-hand side, and the display connected to the VGA port will be the secondary screen on the right-hand side. This is especially useful if you have a laptop, with an external display connected on VGA port. You would be able to retain the laptop’s internal display as the primary screen.
13. Append the lines from Section “Monitor”, Section “Device” and Section “Screen”. There should be two of each (in total, six sections). Here is how mine looked like (yours may vary depending on the NVIDIA chipset and display hardware).
Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "Samsung SyncMaster" HorizSync 30.0 - 81.0 VertRefresh 56.0 - 75.0 Option "DPMS" EndSection Section "Monitor" # HorizSync source: builtin, VertRefresh source: builtin Identifier "Monitor1" VendorName "Unknown" ModelName "CRT-0" HorizSync 28.0 - 55.0 VertRefresh 43.0 - 72.0 Option "DPMS" EndSection Section "Device" Identifier "Videocard0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 6150" BusID "PCI:0:5:0" Screen 0 EndSection Section "Device" Identifier "Videocard1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 6150" BusID "PCI:0:5:0" Screen 1 EndSection Section "Screen" Identifier "Screen0" Device "Videocard0" Monitor "Monitor0" DefaultDepth 24 Option "TwinView" "0" Option "metamodes" "DFP: nvidia-auto-select +0+0" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen1" Device "Videocard1" Monitor "Monitor1" DefaultDepth 24 Option "TwinView" "0" Option "metamodes" "CRT: 1360x768 +0+0" SubSection "Display" Depth 24 EndSubSection EndSection
14. Save the xorg.conf changes in the text editor. Click “Cancel” in the nvidia-settings dialogbox, then “Quit” to close.
Here is how my final xorg.conf looked like.
Section "Monitor" Identifier "Configured Monitor" EndSection Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" Device "Configured Video Device" DefaultDepth 24 EndSection Section "Module" Load "glx" Disable "dri2" EndSection Section "Device" Identifier "Configured Video Device" Driver "nvidia" Option "NoLogo" "True" EndSection # Separate X screen Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen0" EndSection Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "Samsung SyncMaster" HorizSync 30.0 - 81.0 VertRefresh 56.0 - 75.0 Option "DPMS" EndSection Section "Monitor" # HorizSync source: builtin, VertRefresh source: builtin Identifier "Monitor1" VendorName "Unknown" ModelName "CRT-0" HorizSync 28.0 - 55.0 VertRefresh 43.0 - 72.0 Option "DPMS" EndSection Section "Device" Identifier "Videocard0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 6150" BusID "PCI:0:5:0" Screen 0 EndSection Section "Device" Identifier "Videocard1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 6150" BusID "PCI:0:5:0" Screen 1 EndSection Section "Screen" Identifier "Screen0" Device "Videocard0" Monitor "Monitor0" DefaultDepth 24 Option "TwinView" "0" Option "metamodes" "DFP: nvidia-auto-select +0+0" SubSection "Display" Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen1" Device "Videocard1" Monitor "Monitor1" DefaultDepth 24 Option "TwinView" "0" Option "metamodes" "CRT: 1360x768 +0+0" SubSection "Display" Depth 24 EndSubSection EndSection
Reboot, and you should now have Separate X screen.

Comments 6
Many Thanks….
Ok i did the above…so how can i use this “Separate X screen” how do you log into it?
thanks
Posted 12 May 2009 at 7:41 am ¶hi Shane, thanks for reading.
As stated in the final line of the post, you merely need to reboot your PC.
Posted 12 May 2009 at 1:44 pm ¶thanks a lot. I took your config as a starting point. Then I have two seperate screens with my new Cintiq on the right. I can move my mouse from one screen to the other. In fact, I have two screens, 2 desktops (windows don’t cross) and 4 virtual desktops in each.
here is my xorg.conf:
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 1.0 (buildmeister@builder63) Wed May 27 03:16:54 PDT 2009
Section “ServerLayout”
Identifier “Layout0″
Screen 0 “Screen0″ 0 0
Screen 1 “Screen1″ RightOf “Screen0″
InputDevice “Keyboard0″ “CoreKeyboard”
InputDevice “Mouse0″ “CorePointer”
EndSection
Section “Files”
RgbPath “/etc/X11/rgb”
ModulePath “/usr/lib/xorg/modules”
FontPath “/usr/share/fonts/X11/misc”
FontPath “/usr/share/fonts/X11/cyrillic”
FontPath “/usr/share/fonts/X11/100dpi/:unscaled”
FontPath “/usr/share/fonts/X11/75dpi/:unscaled”
FontPath “/usr/share/fonts/X11/Type1″
FontPath “/usr/share/fonts/X11/100dpi”
FontPath “/usr/share/fonts/X11/75dpi”
FontPath “/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”
EndSection
Section “ServerFlags”
Option “Xinerama” “0″
EndSection
Section “InputDevice”
# generated from default
Identifier “Mouse0″
Driver “mouse”
Option “Protocol” “auto”
Option “Device” “/dev/psaux”
Option “Emulate3Buttons” “no”
Option “ZAxisMapping” “4 5″
EndSection
Section “InputDevice”
# generated from default
Identifier “Keyboard0″
Driver “kbd”
Option “XkbRules” “xorg”
Option “XkbModel” “pc105″
Option “XkbLayout” “be”
EndSection
Section “Monitor”
# HorizSync source: edid, VertRefresh source: edid
Identifier “Monitor1″
VendorName “Unknown”
ModelName “WAC Cintiq 12WX”
HorizSync 31.0 – 82.0
VertRefresh 56.0 – 75.0
Option “DPMS”
EndSection
Section “Monitor”
# HorizSync source: edid, VertRefresh source: edid
Identifier “Monitor0″
VendorName “Unknown”
ModelName “Hitachi CM766″
HorizSync 31.0 – 96.0
VertRefresh 50.0 – 180.0
Option “DPMS”
EndSection
Section “Device”
Identifier “Device1″
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce 6800″
BusID “PCI:1:0:0″
Screen 1
EndSection
Section “Device”
Identifier “Device0″
Driver “nvidia”
VendorName “NVIDIA Corporation”
BoardName “GeForce 6800″
BusID “PCI:1:0:0″
Screen 0
EndSection
Section “Screen”
Identifier “Screen1″
Device “Device1″
Monitor “Monitor1″
DefaultDepth 24
Option “TwinView” “1″
Option “metamodes” “DFP: nvidia-auto-select +0+0″
SubSection “Display”
Depth 24
EndSubSection
EndSection
Section “Screen”
Posted 10 Jul 2009 at 4:33 am ¶Identifier “Screen0″
Device “Device0″
Monitor “Monitor0″
DefaultDepth 24
Option “TwinView” “1″
Option “metamodes” “CRT: 1600x1280_70 +0+0; CRT: 1152×864 +0+0″
SubSection “Display”
Depth 24
EndSubSection
EndSection
hi guyr
Posted 10 Jul 2009 at 3:44 pm ¶Thanks for the feedback. I’m glad the instruction is useful.
This is very useful information. I did not understand how the nvidia-settings works. I noticed it messes things up but didn’t know why or how to fix it. Thanks!
Posted 23 Oct 2009 at 4:15 am ¶hi Rossen
Posted 23 Oct 2009 at 12:34 pm ¶I’m happy the instruction is useful!
Post a Comment