henriquemaia
May 4th, 2005, 09:23 AM
Disclaimer:
This worked for me. You should use it at your own risk. This only provides a rough guide, as you should attend to the differences of your own hardware.
This HowTo only covers xinerama/two desktops with TWO cards.
Hardware:
2 video cards. 2 monitors. Please make sure that everything is properly connected (cards in computer, monitors to the cards and monitors to the electricity).
First things first - Backup your xorg.conf file:
On a terminal (gnome-terminal, for instance), type:
cd /etc/X11/
sudo cp xorg.conf xorg.conf.backup
[note: if something goes wrong with your xorg setup, you just have to revert the last command to restore your xorg.conf file - eg:
cd /etc/X11/
sudo cp xorg.conf.backup xorg.conf]
Editing/creating your xinerama xorg.conf file:
Run:
sudo gedit /etc/X11/xorg.conf
Now you have to add the specific data for your second card. You use your xorg.conf file as basis because the data of your main card is already there. You don't have to worry about messing with xorg.conf because you have a backup copy ;)
Take a look at xorg.conf file. You're going add some bits to it, your secondary card info and your secondary monitor info. For that you're going use your main card and monitor info as basis, copying and pasting them, and then change this info to match the exact details of your secondary device.
You see something like this:
Section "Device"
Identifier "agp"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "RenderAccel" "true"
Option "NvAGP" "3"
EndSection
Just make a copy of that section just bellow that one. Now, change the Identifier field of both sections "Device" so that you can easily understand what they represent. In my case, I named the first device "primary" and "secondary". These names are just representative, so you can put whatever you want:
Section "Device"
Identifier "primary"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "RenderAccel" "true"
Option "NvAGP" "3"
EndSection
Section "Device"
Identifier "secondary"
Driver "vesa"
BusID "PCI:0:13:0"
EndSection
My first card uses nvidia driver and as such uses nvidia driver specific Options. You can delete that on your secondary if it uses a different driver.
Now you need the specific info of your secondary device, the driver and the BusID. First, to figure out the BusID, you have to run a specific X command:
sudo X :1 -scanpci
this will give you something like this (my case):
Probing for PCI devices (Bus:Device:Function)
(0:0:0) Silicon Integrated Systems [SiS] 735 Host
(0:1:0) Silicon Integrated Systems [SiS] SiS 530 Virtual PCI-to-PCI bridge (AGP)(0:2:0) Silicon Integrated Systems [SiS] SiS85C503/5513 (LPC Bridge)
(0:2:1) unknown chip (DeviceId 0x0016) from Silicon Integrated Systems [SiS]
(0:2:2) unknown card (0x1019/0x0a14) using a Silicon Integrated Systems [SiS] USB 1.0 Controller
(0:2:3) unknown card (0x1019/0x0a14) using a Silicon Integrated Systems [SiS] USB 1.0 Controller
(0:2:5) unknown card (0x1039/0x5513) using a Silicon Integrated Systems [SiS] 5513 [IDE]
(0:13:0) S3 Inc. 86c864 [Vision 864 DRAM] vers 1
(0:15:0) unknown card (0x1102/0x8027) using a Creative Labs SB Live! EMU10k1
(0:15:1) unknown card (0x1102/0x0020) using a Creative Labs SB Live! MIDI/Game Port
(0:17:0) unknown card (0x10ec/0x8139) using a Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
(1:0:0) nVidia Corporation NV11 [GeForce2 MX/MX 400]
Now, as you'll notice in bold, you see my main video card as well as my secondary one. You shall easily understand your own hardware as well.
Between the first parenthesis you see some numbers in this format 0:13:0 - this indicates your BusID of your devices. (this is my secondary card BusID).
My secondary card is a S3 Inc. 86c864 [Vision 864 DRAM] vers 1. Its driver is vesa. How do I know this? On a terminal, if you type:
man xorg.conf
you'll see the manual page for this file. Scroll down to the bottom of this info and in the end of it you'll find this:
Display drivers: apm(4x), . chips(4x), cirrus(4x), cyrix(4x), fbdev(4x), glide(4x), glint(4x), i128(4x), i740(4x), i810(4x), imstt(4x), mga(4x), neomagic(4x), nv(4x), r128(4x), endition(4x), savage(4x), s3virge(4x), siliconmotion(4x), sis(4x), sunbw2(4x), suncg14(4x), suncg3(4x), suncg6(4x), sunffb(4x), sunleo(4x), suntcx(4x), tdfx(4x), tga(4x), trident(4x), tseng(4x), vesa(4x), vga(4x), via(4x), vmware(4x).
You just have to find out what driver suits your device best. You don't have to worry if you can't figure out what to use, as you'll shall have the opportunity to do some trial and error with your configuration until everything gets ok. If your card is an old one, use vesa or vga first, as these should work fine.
So now you have your secondary device with something like this:
Section "Device"
Identifier "pci"
Driver "vesa"
BusID "PCI:0:13:0"
EndSection
Its now time to add your primary and secondary monitor info. Please attend to your hardware and monitor specs when configuring this part. Here's a sample Section "Monitor". This should go right after the last Section "Device" (your secondary card configuration).
Section "Monitor"
Identifier "tft"
HorizSync 30-70
VertRefresh 50-160
Option "DPMS"
EndSection
Section "Monitor"
Identifier "crt"
HorizSync 30-70
VertRefresh 50-160
Option "DPMS"
EndSection
Again, as before, change the Identifier entries to whatever you like, having in mind that you should use names that make you easily recognize. I used "tft" and "crt" because these are their main characteristic (mine are both from LG and both Flattron). You can put whatever you want (eg: their brands, for instance, or their positions, like "left" or "right"). This is important because you're going to tell in the next entry which monitor you're going to use for each screen X displays.
Please consult your monitor's manual when filling the values of HorizSync and VertRefresh. Option DPMS stands for Display Power Managment Signaling. Use it if your monitor is energy saving aware. There are more Options you can use here, but these are the same you would use in a normal xorg.conf configuration. You just have to remember that you have to fill each monitor Section with its appropriate features.
Now you have the Section "Screen". Just make a copy of that Section (from your original xorg.conf file) and put it just bellow. The Section "Screen" looks like this:
Section "Screen"
Identifier "first"
Device "primary"
Monitor "tft"
DefaultDepth 16
SubSection "Display"
Depth 1
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
EndSection
Again, change the names of the Identifier entries in a way that it is easily understandable for you. I named them "first" and "second". You can put whatever you want.
Please note that you have to edit both "Screen" sections if you changed the name of your primary device and the monitor name (the Identifier). Just as an example, I'm going to assume you used "primary" as the name of your primary device and "tft" as name of the first monitor. Remember to fill with YOUR appropriate names. Do the same with your secondary. Like this:
Section "Screen"
Identifier "first"
Device "primary"
...
Section "Screen"
Identifier "second"
Device "secondary"
...
Now change the monitor entries of both Section "Screen" with the names you chose. Like this:
Section "Screen"
Identifier "first"
Device "primary"
Monitor "tft"
...
Section "Screen"
Identifier "second"
Device "secondary"
Monitor "crt"
...
Now you have the DefaultDepth entry. If you're going to use xinerama (big desktop across both monitors), you have to use the same depth for both screens, otherwise it doesn't work (X limitation). If your secondary card is limited to some depth (like an old one, for instance) and can only display 8 or 15 of depth, you put both screen sections using the same value of the less powerful card (don't worry if you don't know this, as you can change these values later in a trial and error manner until you get things the way that best suits you. So now you'll have:
Section "Screen"
Identifier "first"
Device "primary"
Monitor "tft"
DefaultDepth 16
...
Section "Screen"
Identifier "second"
Device "secondary"
Monitor "crt"
DefaultDepth 16
...
Now comes the resolutions part. You have to attend to the values your cards and monitor can support. In xinerama, only the depth must be the same, and you can use different resolutions for each monitor. I assume you have equally powerful monitors, so you leave both sections with the same resolutions values. If your monitors are different, you can edit the second screen part to match your second monitor specs. Again, you can find this by trial and error. We talk about this again later.
Now we're close to the end. You have to edit this part:
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection
to tell xorg.conf where to put the different screens and how to do it (Xinerama or non-Xinerarma). As such, you'll have:
Section "ServerLayout"
Identifier "Default Layout"
Screen "first"
Screen "second" LeftOf "first"
Option "Xinerama" "On"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection
You have to adjust the entry Screen "second" LeftOf "first" to your own needs, according to the position of your monitors, It can be "second" RightOf "first", or Above or Bellow. In general, LeftOf and RightOf suits our needs best.
Option "Xinerama" "On" tells whether you want to use Xinerama or not (Xinerama - desktop stretched across both monitors). If you prefer, you can have two separate screens. To get that, just type "Off" after "Xinerama". This can have some advantages and disadvantages to Xinerama. It's totally up to you. If you want to know more about multiple screens vs Xinerama, please read this page (http://da.gentoo-wiki.com/HOWTO_Dual_Monitors#Using_multiple_screens)
You've done it! (almost). Now we're going to test this configuration to see if it works. For that, you have to place your new xorg.conf file in its place, by running:
sudo cp ~/xorg.conf /etc/X11/xorg.conf
Now the test. Under a console - Press ctrl + alt + F1 , log in and run:
xinit -- :2
[note: to get back to your X session, just press ctrl + alt + F7 to get back to it - this is how you're going to fine tune your xorg.conf file, by jumping between X sessions. Your normal X session is under ctrl + alt + F7 . The new session will be on ctrl + alt + F8 ]
This will start a new X session. Make sure that both monitors are on. Your screen is going to blank. Soon you'll see your second monitor displaying the secondary card bios info (this shows you that you have selected the correct driver). If everything is ok, a new session starts, and you see a ugly greyish background and a terminal, but now with your desktop across both monitors. If the second monitor don't show up anything, the xorg.conf is not correct, so you have to correct it. Press ctrl + alt + F7 to get back to your session and fine tune the xorg.conf file. Verify if the BusID and the driver of the second card is ok. Press ctrl + alt + F1 to get back to the console, press ctrl + c to stop the second X session and rerun startx -- :2. Do this as many times as you need until you fine tune everything (resolution, colour depth, options)
[note: I use xinit because it just starts the basic X session without any desktop environment, which is much faster than startx. It's just for testing purposes.]
I hope this helps. As stated before, this is only a rough guide to get xinerama /dual head working. I like to thank everyone in #ubuntu at freenode that gave me valuable hints on how to get this xinerama working. Also, I have found this site (http://da.gentoo-wiki.com/HOWTO_Dual_Monitors#Introduction) very useful. Many thanks to its authors.
[last note: if you find any mistake or want to add something that might be useful for this purpose, please send me a PM or post it on the thread.]
This worked for me. You should use it at your own risk. This only provides a rough guide, as you should attend to the differences of your own hardware.
This HowTo only covers xinerama/two desktops with TWO cards.
Hardware:
2 video cards. 2 monitors. Please make sure that everything is properly connected (cards in computer, monitors to the cards and monitors to the electricity).
First things first - Backup your xorg.conf file:
On a terminal (gnome-terminal, for instance), type:
cd /etc/X11/
sudo cp xorg.conf xorg.conf.backup
[note: if something goes wrong with your xorg setup, you just have to revert the last command to restore your xorg.conf file - eg:
cd /etc/X11/
sudo cp xorg.conf.backup xorg.conf]
Editing/creating your xinerama xorg.conf file:
Run:
sudo gedit /etc/X11/xorg.conf
Now you have to add the specific data for your second card. You use your xorg.conf file as basis because the data of your main card is already there. You don't have to worry about messing with xorg.conf because you have a backup copy ;)
Take a look at xorg.conf file. You're going add some bits to it, your secondary card info and your secondary monitor info. For that you're going use your main card and monitor info as basis, copying and pasting them, and then change this info to match the exact details of your secondary device.
You see something like this:
Section "Device"
Identifier "agp"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "RenderAccel" "true"
Option "NvAGP" "3"
EndSection
Just make a copy of that section just bellow that one. Now, change the Identifier field of both sections "Device" so that you can easily understand what they represent. In my case, I named the first device "primary" and "secondary". These names are just representative, so you can put whatever you want:
Section "Device"
Identifier "primary"
Driver "nvidia"
BusID "PCI:1:0:0"
Option "RenderAccel" "true"
Option "NvAGP" "3"
EndSection
Section "Device"
Identifier "secondary"
Driver "vesa"
BusID "PCI:0:13:0"
EndSection
My first card uses nvidia driver and as such uses nvidia driver specific Options. You can delete that on your secondary if it uses a different driver.
Now you need the specific info of your secondary device, the driver and the BusID. First, to figure out the BusID, you have to run a specific X command:
sudo X :1 -scanpci
this will give you something like this (my case):
Probing for PCI devices (Bus:Device:Function)
(0:0:0) Silicon Integrated Systems [SiS] 735 Host
(0:1:0) Silicon Integrated Systems [SiS] SiS 530 Virtual PCI-to-PCI bridge (AGP)(0:2:0) Silicon Integrated Systems [SiS] SiS85C503/5513 (LPC Bridge)
(0:2:1) unknown chip (DeviceId 0x0016) from Silicon Integrated Systems [SiS]
(0:2:2) unknown card (0x1019/0x0a14) using a Silicon Integrated Systems [SiS] USB 1.0 Controller
(0:2:3) unknown card (0x1019/0x0a14) using a Silicon Integrated Systems [SiS] USB 1.0 Controller
(0:2:5) unknown card (0x1039/0x5513) using a Silicon Integrated Systems [SiS] 5513 [IDE]
(0:13:0) S3 Inc. 86c864 [Vision 864 DRAM] vers 1
(0:15:0) unknown card (0x1102/0x8027) using a Creative Labs SB Live! EMU10k1
(0:15:1) unknown card (0x1102/0x0020) using a Creative Labs SB Live! MIDI/Game Port
(0:17:0) unknown card (0x10ec/0x8139) using a Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+
(1:0:0) nVidia Corporation NV11 [GeForce2 MX/MX 400]
Now, as you'll notice in bold, you see my main video card as well as my secondary one. You shall easily understand your own hardware as well.
Between the first parenthesis you see some numbers in this format 0:13:0 - this indicates your BusID of your devices. (this is my secondary card BusID).
My secondary card is a S3 Inc. 86c864 [Vision 864 DRAM] vers 1. Its driver is vesa. How do I know this? On a terminal, if you type:
man xorg.conf
you'll see the manual page for this file. Scroll down to the bottom of this info and in the end of it you'll find this:
Display drivers: apm(4x), . chips(4x), cirrus(4x), cyrix(4x), fbdev(4x), glide(4x), glint(4x), i128(4x), i740(4x), i810(4x), imstt(4x), mga(4x), neomagic(4x), nv(4x), r128(4x), endition(4x), savage(4x), s3virge(4x), siliconmotion(4x), sis(4x), sunbw2(4x), suncg14(4x), suncg3(4x), suncg6(4x), sunffb(4x), sunleo(4x), suntcx(4x), tdfx(4x), tga(4x), trident(4x), tseng(4x), vesa(4x), vga(4x), via(4x), vmware(4x).
You just have to find out what driver suits your device best. You don't have to worry if you can't figure out what to use, as you'll shall have the opportunity to do some trial and error with your configuration until everything gets ok. If your card is an old one, use vesa or vga first, as these should work fine.
So now you have your secondary device with something like this:
Section "Device"
Identifier "pci"
Driver "vesa"
BusID "PCI:0:13:0"
EndSection
Its now time to add your primary and secondary monitor info. Please attend to your hardware and monitor specs when configuring this part. Here's a sample Section "Monitor". This should go right after the last Section "Device" (your secondary card configuration).
Section "Monitor"
Identifier "tft"
HorizSync 30-70
VertRefresh 50-160
Option "DPMS"
EndSection
Section "Monitor"
Identifier "crt"
HorizSync 30-70
VertRefresh 50-160
Option "DPMS"
EndSection
Again, as before, change the Identifier entries to whatever you like, having in mind that you should use names that make you easily recognize. I used "tft" and "crt" because these are their main characteristic (mine are both from LG and both Flattron). You can put whatever you want (eg: their brands, for instance, or their positions, like "left" or "right"). This is important because you're going to tell in the next entry which monitor you're going to use for each screen X displays.
Please consult your monitor's manual when filling the values of HorizSync and VertRefresh. Option DPMS stands for Display Power Managment Signaling. Use it if your monitor is energy saving aware. There are more Options you can use here, but these are the same you would use in a normal xorg.conf configuration. You just have to remember that you have to fill each monitor Section with its appropriate features.
Now you have the Section "Screen". Just make a copy of that Section (from your original xorg.conf file) and put it just bellow. The Section "Screen" looks like this:
Section "Screen"
Identifier "first"
Device "primary"
Monitor "tft"
DefaultDepth 16
SubSection "Display"
Depth 1
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 4
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 8
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 15
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 16
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1152x864" "1024x768"
EndSubSection
EndSection
Again, change the names of the Identifier entries in a way that it is easily understandable for you. I named them "first" and "second". You can put whatever you want.
Please note that you have to edit both "Screen" sections if you changed the name of your primary device and the monitor name (the Identifier). Just as an example, I'm going to assume you used "primary" as the name of your primary device and "tft" as name of the first monitor. Remember to fill with YOUR appropriate names. Do the same with your secondary. Like this:
Section "Screen"
Identifier "first"
Device "primary"
...
Section "Screen"
Identifier "second"
Device "secondary"
...
Now change the monitor entries of both Section "Screen" with the names you chose. Like this:
Section "Screen"
Identifier "first"
Device "primary"
Monitor "tft"
...
Section "Screen"
Identifier "second"
Device "secondary"
Monitor "crt"
...
Now you have the DefaultDepth entry. If you're going to use xinerama (big desktop across both monitors), you have to use the same depth for both screens, otherwise it doesn't work (X limitation). If your secondary card is limited to some depth (like an old one, for instance) and can only display 8 or 15 of depth, you put both screen sections using the same value of the less powerful card (don't worry if you don't know this, as you can change these values later in a trial and error manner until you get things the way that best suits you. So now you'll have:
Section "Screen"
Identifier "first"
Device "primary"
Monitor "tft"
DefaultDepth 16
...
Section "Screen"
Identifier "second"
Device "secondary"
Monitor "crt"
DefaultDepth 16
...
Now comes the resolutions part. You have to attend to the values your cards and monitor can support. In xinerama, only the depth must be the same, and you can use different resolutions for each monitor. I assume you have equally powerful monitors, so you leave both sections with the same resolutions values. If your monitors are different, you can edit the second screen part to match your second monitor specs. Again, you can find this by trial and error. We talk about this again later.
Now we're close to the end. You have to edit this part:
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection
to tell xorg.conf where to put the different screens and how to do it (Xinerama or non-Xinerarma). As such, you'll have:
Section "ServerLayout"
Identifier "Default Layout"
Screen "first"
Screen "second" LeftOf "first"
Option "Xinerama" "On"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
EndSection
You have to adjust the entry Screen "second" LeftOf "first" to your own needs, according to the position of your monitors, It can be "second" RightOf "first", or Above or Bellow. In general, LeftOf and RightOf suits our needs best.
Option "Xinerama" "On" tells whether you want to use Xinerama or not (Xinerama - desktop stretched across both monitors). If you prefer, you can have two separate screens. To get that, just type "Off" after "Xinerama". This can have some advantages and disadvantages to Xinerama. It's totally up to you. If you want to know more about multiple screens vs Xinerama, please read this page (http://da.gentoo-wiki.com/HOWTO_Dual_Monitors#Using_multiple_screens)
You've done it! (almost). Now we're going to test this configuration to see if it works. For that, you have to place your new xorg.conf file in its place, by running:
sudo cp ~/xorg.conf /etc/X11/xorg.conf
Now the test. Under a console - Press ctrl + alt + F1 , log in and run:
xinit -- :2
[note: to get back to your X session, just press ctrl + alt + F7 to get back to it - this is how you're going to fine tune your xorg.conf file, by jumping between X sessions. Your normal X session is under ctrl + alt + F7 . The new session will be on ctrl + alt + F8 ]
This will start a new X session. Make sure that both monitors are on. Your screen is going to blank. Soon you'll see your second monitor displaying the secondary card bios info (this shows you that you have selected the correct driver). If everything is ok, a new session starts, and you see a ugly greyish background and a terminal, but now with your desktop across both monitors. If the second monitor don't show up anything, the xorg.conf is not correct, so you have to correct it. Press ctrl + alt + F7 to get back to your session and fine tune the xorg.conf file. Verify if the BusID and the driver of the second card is ok. Press ctrl + alt + F1 to get back to the console, press ctrl + c to stop the second X session and rerun startx -- :2. Do this as many times as you need until you fine tune everything (resolution, colour depth, options)
[note: I use xinit because it just starts the basic X session without any desktop environment, which is much faster than startx. It's just for testing purposes.]
I hope this helps. As stated before, this is only a rough guide to get xinerama /dual head working. I like to thank everyone in #ubuntu at freenode that gave me valuable hints on how to get this xinerama working. Also, I have found this site (http://da.gentoo-wiki.com/HOWTO_Dual_Monitors#Introduction) very useful. Many thanks to its authors.
[last note: if you find any mistake or want to add something that might be useful for this purpose, please send me a PM or post it on the thread.]