Recently, I added a new monitor, so I also have two monitors, one of which needs to be set up, but after setting up, restart, double display settings fail. After some troubles, we finally found the right way to set it up.
1,xorg.conf
/ etc/X11/xorg.conf is a file that stores a series of hardware configurations, and the configuration of the display is also saved in it. Here's a single-monitor xorg.conf
Manual editing of xorg.conf should be avoided as far as possible. To modify manually, you need to back up the original xorg.conf.
2. Using nvidia-settings to set up multi-monitor
Because my graphics card is NVIDIA, so I installed Ubuntu's graphics driver, so I can use nvidia-settings to set up multi-monitor. Open the terminal and enter
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.m_backup # Back up the original configuration sudo -H nvidia-settings
The following settings will be opened
Click on "X Server Display Configuration" to enter the following interface
Then in the "Layout" box, click on the monitor you want to set as the main monitor. For example, if I want to set "AOC 2491W" as the main monitor, I will click "AOC 2491W". After clicking, the following settings will change. Then in the "Configuration" drop-down menu, select "X screen 0" and the other settings will remain the default ("Resolution"). ” It's resolution, followed by refresh rate; the first box behind Orientation is rotation, and the next box is mirror.
After the above steps are completed, click on another monitor in "Layout". For example, my name is "AOC 2270W", and the following image will appear.
At this point, in the drop-down box behind "Configuration", select "New X screen (required X restart)" and the following figure appears
In the above interface, check "Enable Xinerama". Other settings remain default.
Then select "X screen 1" from "Selection" and enter the following interface
Make sure that the option for the drop-down box behind "Position" is "Right of" (meaning "X screen 1" (the second display), to the right of "X screen 0" (the main display).
Click Apply to see if the display is normal. If it's normal, click Save to X Configuration File to save the configuration. If it's not, adjust the resolution and try again.
” "X Configuration File" is / etc/X11/xorg.conf. When the above steps are completed, xorg.conf is similar to the following file.
# nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 390.77 (buildmeister@swio-display-x64-rhel04-14) Tue Jul 10 23:18:15 PDT 2018 ## Two#It's a comment I added. It's not in the original file. ## Display layout Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" RightOf "Screen0" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "1" EndSection Section "Files" EndSection ## Input device mouse Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection ## Input device keyboard Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection ## Display 0 Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "AOC 2491W" HorizSync 30.0 - 83.0 VertRefresh 50.0 - 76.0 Option "DPMS" EndSection ## Display 1 Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor1" VendorName "Unknown" ModelName "AOC 2270W" HorizSync 30.0 - 83.0 VertRefresh 50.0 - 76.0 Option "DPMS" EndSection ## Device graphics card Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 980 Ti" BusID "PCI:6:0:0" Screen 0 EndSection ## Device graphics card Section "Device" Identifier "Device1" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 980 Ti" BusID "PCI:6:0:0" Screen 1 EndSection ## Screen 0 Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "nvidiaXineramaInfoOrder" "DFP-1" Option "metamodes" "HDMI-0: nvidia-auto-select +0+0 {AllowGSYNC=Off}" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection ## Screen 1 Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 Option "Stereo" "0" Option "metamodes" "DVI-I-0: 1680x1050 +0+0 {AllowGSYNC=Off}" Option "SLI" "Off" Option "MultiGPU" "Off" Option "BaseMosaic" "off" SubSection "Display" Depth 24 EndSubSection EndSection
Restart again to see if the multi-monitor settings are in effect.