How to Set Up Multiple Monitors in Linux

339,303

66

41

Posted

Introduction: How to Set Up Multiple Monitors in Linux

this tutorial will show you how to set up a multi-head system in most linux distros, primarily ubuntu. please note, this is still largely unfinished.

Step 1: Install Your Hardware.

the title explains it. i'm assuming you know how to open the case and install the cards. just make a note of which card is where and which monitor is on which card. FYI: my system uses one Nvidia riva tnt2, one nvidia riva tnt, and one 3dfx voodoo3. (in that order on the pci bus)

Step 2: Boot Up and Get X Going

if X fails and drops to the terminal type in:
sudo dpkg-reconfigure -phigh xserver-xorg
(if you're already root, don't use sudo)
use the wizard to set up drivers for whatever monitor the wizard is showing up on. (usually the first on the bus)
reboot to start x

Step 3: Check the Order and Find the Addresses

by now you should be looking at your linux desktop on one boring screen.
open a terminal and type
lspci
you should now see a list of devices and their bus id. find the graphics cards and write down the bus id's you'll need them later.

Step 4: Set Up X for Multiple Screens

open your xorg.conf for editing.
in ubuntu, open a terminal and type
sudo gedit /etc/X11/xorg.conf
(again, if you're already root, don't use sudo)
save it as xorg.conf.backup or something simular, i can gaurentee the next step won't work the first time.
now, go back to that list of cards and addresses you made. make a device section for each. like this:

Section "device"
identifier "name for card here"
driver "card driver name here"
BusID "X:Y:Z"
EndSection

replace x:y:z with the bus id of the card, you can replace "name for card here" with anything, but make sure you're using the proper driver for your hardware.

now make a monitor section for each monitor

Section "Monitor"
Identifier "monitor name here"
HorizSync 28.0 - 51.0
VertRefresh 43.0 - 60.0
Option "DPMS"
EndSection

if your monitor has dpms, you can omit the sync and refresh. if it doesn't, remove the dpms line.

Now make a Screen for each card/monitor pair

Section "Screen"
Identifier "screen name here"
Device "card name here"
Monitor "monitor name here"
DefaultDepth X
SubSection "Display"
Depth 4
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 8
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 15
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubSection
SubSection "Display"
Depth 24
Modes "1024x768" "800x600" "640x480"
EndSubSection
EndSection

replace X with whatever color depth your hardware can handle.
under each subsection list all the available modes and sizes for each mode.
you can get away with just listing one display section and one resolution, if that's all you'll use, or if you're lazy. try to keep the default depth and highest resolution the same for each 'screen', it makes things much easier.

now, find the ServerLayout section, and add the screens

Screen "first screen name" 0 0
Screen "Second screen name"" RightOf "left"
Screen "third screen name" RightOf "center"

it should now look something remotely like this

Section "ServerLayout"
Identifier "Default Layout"
Screen "first screen name" 0 0
Screen "Second screen name"" RightOf "left"
Screen "third screen name" RightOf "center"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
EndSection

add as many screens as you want. use RightOf or LeftOf to tell the computer where the monitors are relative to each other. don't touch the InputDevices and make sure the Identifier is "Default Layout"

Step 5: Cross Your Fingers!

restart x! (in ubuntu just hit control-alt-backspace)
if it works, you'll have a desktop across all (or most) monitors. move the mouse across each to make sure they're in the right order! if they're not, go to the previous step and switch them around in the server layout. if you have one (or more) monitor that won't show anything (and the mouse skips it) make sure you used the correct bus id and driver in the device section. also try checking the bios settings. on my computer i had to set the oldest card (riva tnt) as the primary boot device under pci vga settings in the bios. (even though the newest is used as the primary in ubuntu) if the screen is still blank, but you loose the mouse in it, check the cables and make sure the monitor is on!
from here on, just expiriment with different configurations and arrangements until you find one you like.

now, get yourself some kickin' multi-screen wallpapers!
http://www.triplemonitorbackgrounds.com/
digital blasphemy
deviant art

Step 6: Add Menus (optional)

this only applies to Gnome based distros.
right click on any panel and select new panel
drag it to annother screen, right click on it and add to the menu.
you can also make it look really cool by setting the background color to semi-transparent.

Share

    Recommendations

    • Science of Cooking

      Science of Cooking
    • Pocket-Sized Contest

      Pocket-Sized Contest
    • Spotless Contest

      Spotless Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    41 Comments

    For reference.

    Just switched from a single dual-port card (VGA + DVI) with two monitors to a setup with two identical single port cheap and ancient geforce cards. All I had to do after plugging in the hardware was to reboot. It automatically updated the X configuration, and switched both monitors to the maximum available resolution.

    OS is Ubuntu 14.04 (it's a LTS release, so I won't drop it too soon).

    All I had to do manually after reboot was to readjust each monitor anew via the controls of the monitor, and reconfigure tilda - the different screen resolutions meant it no longer showed where and how I wanted it to.

    Can this work with a raspberry pi?

    Sure. Provided you find a way to add additional video adapters to a rasp.pi.

    Hello i am going to run a system with 10 monitors will it work or do need to make something diffrent

    Depending on the video cards you're going to use and the software you're going to run, the IO of your system might become a bit stressed ...

    beware this is at least 9 years old (according to the age of some comments)

    things have changed. A LOT. so unless you have an OLD pc, this is completely outdated.

    as of 2016, the way to go seems to be managing everything through XRANDR (I still gotta try, lol).

    awsm yrrr i reallly like it nd i made it

    when i tried, LeftOf was buggy (or i didnt use it properly) caused X to crash with cursor blinking between the screens. using SUSE 11.2/3

    i used to like PCI cards but they are getting harder to get and they happen to break down if you get an accelerator unless you like the 2mb's (most of which Ms dropped support for after W98). there is a even NEATER way to get triple multi monitor now a days (if you havnt got two long pcie slots) and that is get a soldering iron (if you havnt already got one), and another pcie video board and use the soldering iron to remove the end of the slot so the pcie card fits in (choose a place that has room behind the slot!) and it will work (make sure you have removed enough plastic else it will push the slot apart) and the PC will see it, my PC boots on the Pcie 1x slot tho.... however what i cant say will work (in linux) is if you have ATI and Nvidia cards as i do...... im seeing if i can migrate to linux with my setup.... X700 and GF7800GTX, and maybe choose my funny refresh rates etc.

    Linux mint has some support for multiple monitors with its workspaces.