[CentOS] How to configure display on CentOS 6?

Fri Jan 25 18:22:51 UTC 2013
Cal Webster <cwebster at ec.rr.com>

On Wed, 2013-01-23 at 09:33 -0500, Scot P. Floess wrote:
> I think you can also use
> 
> X --config
> 
> That should build an /etc/X11/xorg.conf file for you...

That's a good start (the command is actually "Xorg -configure") but it
may leave open questions to the OP and others who may consult this
thread in the future.

We've had occasion to use 4 different methods of X-Windows configuration
in EL6, without the old system-config-display tool. The choices are:

1. Accept the Xorg auto-detected, "built-in" configuration. If it works,
why mess with it?
2. Generate and customize your own xorg.conf file.
3. Use Xorg "hot-plug" config (/etc/X11/xorg.conf.d/) to replace only
part of the built-in configuration.
4. Use a proprietary video driver and X configurator. This may be
necessary with high-end video cards and/or multiple displays.


I've outlined choices #2 and #3 below, as they are probably going to be
of primary interest to the OP.

I hope this information is of some use.


./Cal

(I work on a restricted, isolated network without direct Internet access
so I may not be able to respond to replies quickly.)



=========================================
[Generate and customize a xorg.conf file]
=========================================

# Save the Xorg log file to capture any errors (as root):

cd /var/log/
cp Xorg.0.log Xorg.0.log.beforeConfigure

# Drop to run level 3 or boot into run level 3

cd
init 3

# Tell Xorg to generate the config file:

Xorg -configure

# Make a copy to work on:

cp -p /root/xorg.conf.new /root/xorg.conf

# Look at the created config - get rid of extra screens and unnecessary
data

- Use for reference any xorg.conf in similar machines if you have them
available
- There should be one section for "Monitor", "Device" (video card), and
"Screen" to match the "ServerLayout" section.
- See sample below

==========================================
[/Generate and customize a xorg.conf file]
==========================================


=============================
[Xorg "hot-plug" config file]
=============================

# Use the same steps as above to get something to start with or to
ensure proper formatting.
- We just extracted the data we needed from the Xorg.0.log to create a
hot-plug file, then dropped it into /etc/X11/xorg.conf.d/.
- We were only interested in getting the vnc module to load and
vncpassword to work so ours probably has more in it than we need but it
works.

Xorg will pull anything not listed in the hot-plug files from its
built-in configuration.
All the same rules apply to a hot-plug file as do for xorg.conf

See the sample hot-plug file below.

==============================
[/Xorg "hot-plug" config file]
==============================



==================
[Sample xorg.conf]
==================

## This is an edited, auto-generated xorg.conf from a Dell PowerEdge
2800 running CentOS 6.3

- We were interested in running the native VNC X server
(tigervnc-server-module) so we added those entries in the appropriate
places.
- If you look at the top of your Xorg.0.log you'll see what the Xorg
server has auto-detected. It's usually very good at detecting your video
hardware. Armed with that information, you should be able to select and
load the correct driver.
- Some of our machines have high-end nVidia graphics cards so we opted
to use the proprietary video drivers from nVidia to maximize the use of
dual screens and high resolution. We've found that the open source
drivers can sometimes be problematic, like on some of our Dell Precision
T3400 machines.
- The ATI Radeon driver was automatically listed and configured on this
machine. According to our documentation, this machine had a "Radeon
7000" chipset so it matched.

[root at pegasus log]# lspci | grep -i radeon
10:0d.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI
RV100 QY [Radeon 7000/VE]

# From the Xorg.0.log
---------------------
[    97.240] (--) RADEON(0): Chipset: "ATI Radeon VE/7000 QY
(AGP/PCI)" (ChipID = 0x5159)
---------------------

vi /root/xorg.conf
------------------
Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen      0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
	ModulePath   "/usr/lib/xorg/modules"
	FontPath     "catalogue:/etc/X11/fontpath.d"
	FontPath     "built-ins"
EndSection

Section "Module"
	Load  "dbe"
	Load  "record"
	Load  "dri"
	Load  "vnc"
	Load  "extmod"
	Load  "glx"
	Load  "dri2"
EndSection

Section "InputDevice"
	Identifier  "Keyboard0"
	Driver      "kbd"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver      "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/input/mice"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
	Identifier   "Monitor0"
	VendorName   "Monitor Vendor"
	ModelName    "Monitor Model"
EndSection

Section "Device"
	Identifier  "Card0"
	Driver      "radeon"
	BusID       "PCI:16:13:0"
	VendorName  "Advanced Micro Devices - AMD"
	BoardName   "ATI Radeon 7000"
EndSection

Section "Screen"
	Identifier "Screen0"
	Device     "Card0"
	Monitor    "Monitor0"
	SubSection "Display"
		Viewport   0 0
		Depth     1
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     4
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     8
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     15
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     16
	EndSubSection
	SubSection "Display"
		Viewport   0 0
		Depth     24
	EndSubSection
	Option "SecurityTypes" "VncAuth"
	Option "UserPasswdVerifier" "VncAuth"
	Option "PasswordFile" "/root/.vnc/passwd"
EndSection

------------------

# Copied to where it belongs and set SELinux context

cp xorg.conf /etc/X11/

restorecon /etc/X11/xorg.conf

===================
[/Sample xorg.conf]
===================



======================
[Sample hot-plug file]
======================

This hotplug file was created for a headless PowerEdge 2600 for use with
remote access vi the native VNC X server (tigervnc-server-module).
Because we're using a hotplug file, we didn't have to specify input
devices.
We didn't really need all the screens either but left them in for
redundancy.

10-vnc.conf
===========
Section "ServerLayout"
	Identifier      "Builtin Default Layout"
	Screen  "Builtin Default ati Screen 0"
	Screen  "Builtin Default vesa Screen 0"
	Screen  "Builtin Default fbdev Screen 0"
EndSection
Section "Module"
	Load  "vnc"
EndSection
Section "Device"
	Identifier      "Builtin Default ati Device 0"
	Driver  "ati"
EndSection
Section "Screen"
        Identifier "Builtin Default ati Screen 0"
	Device  "Builtin Default ati Device 0"
        Option "SecurityTypes" "VncAuth"
        Option "UserPasswdVerifier" "VncAuth"
        Option "PasswordFile" "/root/.vnc/passwd"
EndSection
Section "Device"
	Identifier      "Builtin Default vesa Device 0"
	Driver  "vesa"
EndSection
Section "Screen"
        Identifier "Builtin Default vesa Screen 0"
	Device  "Builtin Default vesa Device 0"
        Option "SecurityTypes" "VncAuth"
        Option "UserPasswdVerifier" "VncAuth"
        Option "PasswordFile" "/root/.vnc/passwd"
EndSection
Section "Device"
	Identifier      "Builtin Default fbdev Device 0"
	Driver  "fbdev"
EndSection
Section "Screen"
        Identifier "Builtin Default fbdev Screen 0"
	Device  "Builtin Default fbdev Device 0"
        Option "SecurityTypes" "VncAuth"
        Option "UserPasswdVerifier" "VncAuth"
        Option "PasswordFile" "/root/.vnc/passwd"
EndSection
===========

=======================
[/Sample hot-plug file]
=======================



===========================
[Sample Xorg.0.log excerpt]
===========================

# Example of the auto-deteced "built-in configuration":

Xorg.0.log.beforeConfigure
--------------------------
...
[    96.996] (==) --- Start of built-in configuration ---
[    96.996]    Section "Device"
[    96.996]            Identifier      "Builtin Default ati Device 0"
[    96.996]            Driver  "ati"
[    96.996]    EndSection
[    96.996]    Section "Screen"
[    96.996]            Identifier      "Builtin Default ati Screen 0"
[    96.996]            Device  "Builtin Default ati Device 0"
[    96.996]    EndSection
[    96.996]    Section "Device"
[    96.996]            Identifier      "Builtin Default vesa Device 0"
[    96.996]            Driver  "vesa"
[    96.996]    EndSection
[    96.996]    Section "Screen"
[    96.996]            Identifier      "Builtin Default vesa Screen 0"
[    96.996]            Device  "Builtin Default vesa Device 0"
[    96.996]    EndSection
[    96.996]            Identifier      "Builtin Default fbdev Device 0"
[    96.996]            Driver  "fbdev"
[    96.996]    EndSection
[    96.997]    Section "Screen"
[    96.997]            Identifier      "Builtin Default fbdev Screen 0"
[    96.997]            Device  "Builtin Default fbdev Device 0"
[    96.997]    EndSection
[    96.997]    Section "ServerLayout"
[    96.997]            Identifier      "Builtin Default Layout"
[    96.997]            Screen  "Builtin Default ati Screen 0"
[    96.997]            Screen  "Builtin Default vesa Screen 0"
[    96.997]            Screen  "Builtin Default fbdev Screen 0"
[    96.997]    EndSection
[    96.997] (==) --- End of built-in configuration ---
...
--------------------------

============================
[/Sample Xorg.0.log excerpt]
============================