Difference between revisions of "Xorg"

From ArchWiki
Jump to navigation Jump to search
(update Pkg/AUR templates)
Tag: wiki-scripts
 
(364 intermediate revisions by 72 users not shown)
Line 1: Line 1:
[[Category:X Server]]
+
[[Category:X server]]
[[Category:Graphics]]
 
 
[[cs:Xorg]]
 
[[cs:Xorg]]
 
[[da:Xorg]]
 
[[da:Xorg]]
Line 12: Line 11:
 
[[pl:Xorg]]
 
[[pl:Xorg]]
 
[[pt:Xorg]]
 
[[pt:Xorg]]
[[ro:Xorg]]
 
 
[[ru:Xorg]]
 
[[ru:Xorg]]
[[tr:X_Sunucusu]]
+
[[uk:Xorg]]
[[zh-CN:Xorg]]
+
[[zh-hans:Xorg]]
[[zh-TW:Xorg]]
+
[[zh-hant:Xorg]]
 
{{Related articles start}}
 
{{Related articles start}}
{{Related|Start X at Login}}
 
 
{{Related|Autostarting}}
 
{{Related|Autostarting}}
 
{{Related|Display manager}}
 
{{Related|Display manager}}
 
{{Related|Window manager}}
 
{{Related|Window manager}}
 
{{Related|Font configuration}}
 
{{Related|Font configuration}}
{{Related|Cursor Themes}}
+
{{Related|Cursor themes}}
 
{{Related|Desktop environment}}
 
{{Related|Desktop environment}}
 
{{Related|Wayland}}
 
{{Related|Wayland}}
{{Related|Mir}}
+
{{Related|xinit}}
 +
{{Related|xrandr}}
 
{{Related articles end}}
 
{{Related articles end}}
From http://www.x.org/wiki/:
+
From https://www.x.org/wiki/:
:''The X.Org project provides an open source implementation of the X Window System. The development work is being done in conjunction with the freedesktop.org community. The X.Org Foundation is the educational non-profit corporation whose Board serves this effort, and whose Members lead this work.''
+
:The X.Org project provides an open source implementation of the [[Wikipedia:X Window System|X Window System]]. The development work is being done in conjunction with the freedesktop.org community. The X.Org Foundation is the educational non-profit corporation whose Board serves this effort, and whose Members lead this work.
  
'''Xorg''' is the public, open-source implementation of the X window system version 11. Since Xorg is the most popular choice among Linux users, its ubiquity has led to making it an ever-present requisite for GUI applications, resulting in massive adoption from most distributions. See the [[Wikipedia:X.Org Server|Xorg]] Wikipedia article or visit the [http://www.x.org/wiki/ Xorg website] for more details.
+
'''Xorg''' (commonly referred as simply '''X''') is the most popular display server among Linux users. Its ubiquity has led to making it an ever-present requisite for GUI applications, resulting in massive adoption from most distributions. See the [[Wikipedia:X.Org Server|Xorg]] Wikipedia article or visit the [https://www.x.org/wiki/ Xorg website] for more details.
  
 
== Installation ==
 
== Installation ==
  
You will need to [[pacman|install]] the essential package {{Pkg|xorg-server}}, available in the [[official repositories]].
+
Xorg can be [[install]]ed with the {{Pkg|xorg-server}} package.
  
Additionally, the {{Pkg|xorg-server-utils}} meta-package pulls in the most useful packages for certain configuration tasks, they are pointed out in the relevant sections. Some other useful packages are part of the {{Grp|xorg-apps}} group.
+
Additionally, some packages from the {{Grp|xorg-apps}} group are necessary for certain configuration tasks, they are pointed out in the relevant sections.
  
{{Tip|The default X environment is rather bare, and you will typically seek to install a [[Window manager|window manager]] or a [[Desktop environment|desktop environment]] to supplement X.}}
+
Finally, an {{Grp|xorg}} group is also available, which includes Xorg server packages, packages from the {{Grp|xorg-apps}} group and fonts.
 +
 
 +
{{Tip|You will typically seek to install a [[window manager]] or a [[desktop environment]] to supplement X.}}
  
 
=== Driver installation ===
 
=== Driver installation ===
Line 47: Line 47:
 
First, identify your card:
 
First, identify your card:
  
  $ lspci | grep VGA
+
  $ lspci | grep -e VGA -e 3D
 
 
{{Note| if you don't get any output, try looking for a 3D controller instead
 
$ lspci <nowiki>|</nowiki> grep 3D
 
}}
 
  
 
Then install an appropriate driver. You can search the package database for a complete list of open-source video drivers:
 
Then install an appropriate driver. You can search the package database for a complete list of open-source video drivers:
Line 57: Line 53:
 
  $ pacman -Ss xf86-video
 
  $ pacman -Ss xf86-video
  
The default graphics driver is ''vesa'' (package {{Pkg|xf86-video-vesa}}), which handles a large number of chipsets but does not include any 2D or 3D acceleration. If a better driver cannot be found or fails to load, Xorg will fall back to ''vesa''.
+
Xorg searches for installed drivers automatically:
 +
 
 +
* If it cannot find the specific driver installed for the hardware (listed below), it first searches for ''fbdev'' ({{pkg|xf86-video-fbdev}}).
 +
* If that is not found, it searches for ''vesa'' ({{pkg|xf86-video-vesa}}), the generic driver, which handles a large number of chipsets but does not include any 2D or 3D acceleration.
 +
* If ''vesa'' is not found, Xorg will fall back to [[kernel mode setting]], which includes GLAMOR acceleration (see {{man|4|modesetting}}).
  
 
In order for video acceleration to work, and often to expose all the modes that the GPU can set, a proper video driver is required:
 
In order for video acceleration to work, and often to expose all the modes that the GPU can set, a proper video driver is required:
 
{{Note| If you have a  NVIDIA Optimus enabled laptop; one that uses an integrated video card combined with a dedicated GPU, then you might want to look at [[Bumblebee]].}}
 
  
 
{| class="wikitable"  style="text-align:center"
 
{| class="wikitable"  style="text-align:center"
 
|-
 
|-
! Brand !! Type !! Driver !! [[Multilib]] Package<br><span style="font-weight: normal; font-size: 0.8em;">(for 32-bit applications on Arch x86_64)</span> !! &nbsp;Documentation&nbsp;
+
! Brand !! Type !! Driver !! OpenGL !! OpenGL ([[multilib]]) !! Documentation
 
|-
 
|-
| rowspan="2" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">&nbsp;AMD/ATI&nbsp;</span>'''
+
! rowspan="2" | AMD / ATI
| &nbsp;Open source&nbsp; || {{Pkg|xf86-video-ati}} || {{Pkg|lib32-ati-dri}} || [[ATI]]
+
| rowspan="2" | Open source || {{Pkg|xf86-video-amdgpu}} || rowspan="2" | {{Pkg|mesa}} || rowspan="2" | {{Pkg|lib32-mesa}} || [[AMDGPU]]
 
|-
 
|-
| Proprietary || {{AUR|catalyst}} || {{AUR|lib32-catalyst-utils}} || [[AMD Catalyst]]
+
| {{Pkg|xf86-video-ati}} || [[ATI]]
 
|-
 
|-
| bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''
+
! Intel
| Open source
+
| Open source || {{Pkg|xf86-video-intel}} || {{Pkg|mesa}} || {{Pkg|lib32-mesa}} || [[Intel graphics]]
| {{Pkg|xf86-video-intel}} || {{Pkg|lib32-intel-dri}} || [[Intel Graphics]]
 
 
|-
 
|-
| rowspan="5" bgcolor=#e3f7e6| '''<span style="color: #409044;">Nvidia</span>'''
+
! rowspan="4" | NVIDIA
| Open source
+
| Open source || {{Pkg|xf86-video-nouveau}} || {{Pkg|mesa}} || {{Pkg|lib32-mesa}} || [[Nouveau]]
| {{Pkg|xf86-video-nouveau}} || {{Pkg|lib32-nouveau-dri}} || [[Nouveau]]
 
 
|-
 
|-
| rowspan="4"| Proprietary || {{Pkg|nvidia}} || {{Pkg|lib32-nvidia-libgl}} || rowspan="4"| [[NVIDIA]]
+
| rowspan="3" | Proprietary || {{Pkg|nvidia}} || {{Pkg|nvidia-utils}} || {{Pkg|lib32-nvidia-utils}} || rowspan="3" | [[NVIDIA]]
 
|-
 
|-
| {{Pkg|nvidia-304xx}} || {{Pkg|lib32-nvidia-304xx-libgl}}
+
| {{Pkg|nvidia-390xx}} || {{Pkg|nvidia-390xx-utils}} || {{Pkg|lib32-nvidia-390xx-utils}}
|-
 
| {{AUR|nvidia-173xx}} || {{AUR|lib32-nvidia-173xx-utils}}
 
|-
 
| {{AUR|nvidia-96xx}} || {{AUR|lib32-nvidia-96xx-utils}}
 
|-
 
| bgcolor=#f7f2e3| '''<span style="color: #9a4e16;">VIA</span>'''
 
| Open source || {{Pkg|xf86-video-openchrome}} || – || [[Via|VIA]]
 
 
|}
 
|}
  
Xorg should run smoothly without closed source drivers, which are typically needed only for advanced features such as fast 3D-accelerated rendering for games, dual-screen setups, and TV-out.
+
{{Note|
 +
* For NVIDIA Optimus enabled laptop which uses an integrated video card combined with a dedicated GPU, see [[NVIDIA Optimus]] or [[Bumblebee]].
 +
* For Intel graphics on 4th generation and above, see [[Intel graphics#Installation]] for available drivers.
 +
}}
  
== Running ==
+
Other video drivers can be found in the {{Grp|xorg-drivers}} group.
  
=== Display manager ===
+
Xorg should run smoothly without closed source drivers, which are typically needed only for advanced features such as fast 3D-accelerated rendering for games. The exceptions to this rule are recent GPUs (especially NVIDIA GPUs), that are not supported by the open source drivers.
  
A convenient way to start X, but one that requires an additional application and dependencies, is by using a [[display manager]] such as [[GDM]], [[KDM]] or [[SLiM]].
+
=== AMD ===
  
=== Manually ===
+
{| class="wikitable"  style="text-align:center"
 +
|-
 +
! GPU architecture !! Radeon cards !! Open-source driver !! Proprietary driver
 +
|-
 +
| GCN 4<br/>and newer || rowspan=4 | [[wikipedia:List of AMD graphics processing units|various]] || [[AMDGPU]] || [[AMDGPU PRO]]
 +
|-
 +
| GCN 3 || [[AMDGPU]] || [[Catalyst]] /<br/>[[AMDGPU PRO]]
 +
|-
 +
| GCN 2 || [[AMDGPU]]* / [[ATI]] || [[Catalyst]]
 +
|-
 +
| GCN 1 || [[AMDGPU]]* / [[ATI]] || [[Catalyst]]
 +
|-
 +
| TeraScale 2&3 || HD 5000 - HD 6000 || rowspan=3 | [[ATI]] || [[Catalyst]]
 +
|-
 +
| TeraScale 1 || HD 2000 - HD 4000 || [[Catalyst]] legacy
 +
|-
 +
| Older || X1000 and older || ''not available''
 +
|-
 +
|}
 +
: *: Experimental
  
If you want to start X without a display manager, install the package {{Pkg|xorg-xinit}} which provides the ''startx'' and ''xinit'' commands (the ''startx'' script is merely a front end to the ''xinit'' command).
+
== Running ==
  
To determine the client to run, ''startx''/''xinit'' will first try to parse a {{ic|~/.xinitrc}} file in the user's home directory. In the absence of {{ic|~/.xinitrc}}, ''startx''/''xinit'' defaults to parsing the global file {{ic|/etc/X11/xinit/xinitrc}}, which starts a basic environment with the [[Twm]] window manager, [[Wikipedia:Xclock|Xclock]] and [[Xterm]]: this requires the packages {{Pkg|xorg-twm}}, {{Pkg|xorg-xclock}} and {{Pkg|xterm}} to be installed. See [[xinitrc]] for information on how to initialize and configure it.
+
The {{man|1|Xorg}} command is usually not run directly, instead the X server is started with either a [[display manager]] or [[xinit]].
 
 
To launch the X server and clients, simply run:
 
 
 
$ startx
 
 
 
{{Tip|You can exploit the global file {{ic|/etc/X11/xinit/xinitrc}} to quickly test X in a minimal environment, especially immediately after installing it or for other debugging purposes: simply rename your {{ic|~/.xinitrc}} file to temporarily disable it. After running {{ic|startx}}, a few movable windows should show up, and your mouse should work. To quit this environment, issue the {{ic|exit}} command into the terminals until you return to the virtual console.}}
 
 
 
See also [[Start X at Login]].
 
 
 
{{Note|
 
* By default, due to permissions on console devices, the X display needs to be on the same tty where the login occurred. This is handled by the default {{ic|/etc/X11/xinit/xserverrc}}. See [[General troubleshooting#Session permissions]] for details.
 
* If you wish to have the X display on a separate console from the one where the server is invoked, you can do so by using the X server wrapper provided by {{ic|/usr/lib/systemd/systemd-multi-seat-x}}. For convenience, ''startx'' can be set up to use this wrapper by modifying your {{ic|~/.xserverrc}}.
 
* If you choose to use ''xinit'' instead of ''startx'', you are responsible for passing {{ic|-nolisten tcp}} and ensuring the session does not break by starting X on a different tty.
 
}}
 
 
 
{{Moveto|#Troubleshooting|The following notes are for troubleshooting, maybe they belong better there. We could provide a link to such section here instead. Note there's also [[#Common problems]] there.}}
 
 
 
{{Note|
 
* If a problem occurs, then view the log at {{ic|/var/log/Xorg.0.log}}. Be on the lookout for any lines beginning with {{ic|(EE)}}, which represent errors, and also {{ic|(WW)}}, which are warnings that could indicate other issues.
 
* If there is an ''empty'' {{ic|.xinitrc}} file in your {{ic|$HOME}}, either delete or edit it in order for X to start properly. If you do not do this X will show a blank screen with what appears to be no errors in your {{ic|Xorg.0.log}}. Simply deleting it will get it running with a default X environment.
 
* If the screen goes black, you may still attempt to switch to a different virtual console (e.g. {{ic|Ctrl+Alt+F2}}), and blindly log in as root. You can do this by typing "root" (press {{ic|Enter}} after typing it) and entering the root password (again, press {{ic|Enter}} after typing it).
 
 
 
: You may also attempt to kill the X server with:
 
: {{bc|# pkill X}}
 
: If this does not work, reboot blindly with:
 
: {{bc|# reboot}}
 
}}
 
  
 
== Configuration ==
 
== Configuration ==
  
{{Note|Arch supplies default configuration files in {{ic|/usr/share/X11/xorg.conf.d}}, and no extra configuration is necessary for most setups.}}
+
{{Note|Arch supplies default configuration files in {{ic|/usr/share/X11/xorg.conf.d/}}, and no extra configuration is necessary for most setups.}}
  
Xorg uses a configuration file called {{ic|xorg.conf}} and files ending in the suffix {{ic|.conf}} for its initial setup: the complete list of the folders where these files are searched can be found at [http://www.x.org/releases/current/doc/man/man5/xorg.conf.5.xhtml] or by running {{ic|man xorg.conf}}, together with a detailed explanation of all the available options.
+
Xorg uses a configuration file called {{ic|xorg.conf}} and files ending in the suffix {{ic|.conf}} for its initial setup: the complete list of the folders where these files are searched can be found in {{man|5|xorg.conf}}, together with a detailed explanation of all the available options.
  
 
=== Using .conf files ===
 
=== Using .conf files ===
  
The {{ic|/etc/X11/xorg.conf.d/}} directory stores host-specific configuration. You are free to add configuration files there, but they must have a {{ic|.conf}} suffix: the files are read in ASCII order, and by convention their names start with {{ic|''XX''-}} (two digits and a hyphen, so that for example 10 is read before 20). These files are parsed by the X server upon startup and are treated like part of the traditional {{ic|xorg.conf}} configuration file. The X server essentially treats the collection of configuration files as one big file with entries from {{ic|xorg.conf}} at the end.
+
The {{ic|/etc/X11/xorg.conf.d/}} directory stores host-specific configuration. You are free to add configuration files there, but they must have a {{ic|.conf}} suffix: the files are read in ASCII order, and by convention their names start with {{ic|''XX''-}} (two digits and a hyphen, so that for example 10 is read before 20). These files are parsed by the X server upon startup and are treated like part of the traditional {{ic|xorg.conf}} configuration file. Note that on conflicting configuration, the file read ''last'' will be processed. For that reason the most generic configuration files should be ordered first by name. The configuration entries in the {{ic|xorg.conf}} file are processed at the end.
 +
 
 +
For option examples to set, see also the [https://fedoraproject.org/wiki/Input_device_configuration#xorg.conf.d Fedora wiki].
  
 
=== Using xorg.conf ===
 
=== Using xorg.conf ===
Line 150: Line 136:
  
 
This should create a {{ic|xorg.conf.new}} file in {{ic|/root/}} that you can copy over to {{ic|/etc/X11/xorg.conf}}.
 
This should create a {{ic|xorg.conf.new}} file in {{ic|/root/}} that you can copy over to {{ic|/etc/X11/xorg.conf}}.
 +
 +
{{Tip|If you are already running an X server, use a different display, for example {{ic|Xorg :2 -configure}}.}}
  
 
Alternatively, your proprietary video card drivers may come with a tool to automatically configure Xorg: see the article of your video driver, [[NVIDIA]] or [[AMD Catalyst]], for more details.
 
Alternatively, your proprietary video card drivers may come with a tool to automatically configure Xorg: see the article of your video driver, [[NVIDIA]] or [[AMD Catalyst]], for more details.
Line 155: Line 143:
 
{{Note|Configuration file keywords are case insensitive, and "_" characters are ignored. Most strings (including Option names) are also case insensitive, and insensitive to white space and "_" characters.}}
 
{{Note|Configuration file keywords are case insensitive, and "_" characters are ignored. Most strings (including Option names) are also case insensitive, and insensitive to white space and "_" characters.}}
  
=== Sample configurations ===
+
== Input devices ==
  
* {{ic|xorg.conf}}
+
For input devices the X server defaults to the libinput driver ({{Pkg|xf86-input-libinput}}), but {{Pkg|xf86-input-evdev}} and related drivers are available as alternative.[https://www.archlinux.org/news/xorg-server-1191-is-now-in-extra/]
: [http://pastebin.com/raw.php?i=EuSKahkn Sample 1]
 
: {{Note|Sample configuration file using {{ic|/etc/X11/xorg.conf.d/10-evdev.conf}} for the keyboard layouts. Note the commented out {{ic|InputDevice}} sections.}}
 
* {{ic|/etc/X11/xorg.conf.d/10-evdev.conf}}
 
: [http://pastebin.com/raw.php?i=4mPY35Mw Sample 1]
 
: {{Note|This is the {{ic|10-evdev.conf}} file that goes with the xorg.conf sample 1.}}
 
* {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}
 
:# [http://pastebin.com/raw.php?i=fJv8EXGb VMware]
 
:# [http://pastebin.com/raw.php?i=NRz7v0Kn KVM]
 
:# [https://gist.github.com/daemox/6325050 NVIDIA]
 
: {{Note|nvidia-ck binary drivers (v325); Dual GPU, Dual Monitor, Dual Screen; No Twinview, No Xinerama; Rotated and vertically placed screen1 above screen0.}}
 
  
== Input devices ==
+
[[Udev]], which is provided as a systemd dependency, will detect hardware and both drivers will act as hotplugging input driver for almost all devices, as defined in the default configuration files {{ic|10-quirks.conf}} and {{ic|40-libinput.conf}} in the {{ic|/usr/share/X11/xorg.conf.d/}} directory.
 +
 
 +
After starting X server, the log file will show which driver hotplugged for the individual devices (note the most recent log file name may vary):
 +
$ grep -e "Using input driver " Xorg.0.log
 +
 
 +
If both do not support a particular device, install the needed driver from the {{Grp|xorg-drivers}} group. The same applies, if you want to use another driver.
 +
 
 +
To influence hotplugging, see [[#Configuration]].
  
[[Udev]] will detect your hardware and [[Wikipedia:evdev|evdev]] will act as the hotplugging input driver for almost all devices. Udev is provided by {{Pkg|systemd}} and {{Pkg|xf86-input-evdev}} is required by {{Pkg|xorg-server}}, so there is no need to explicitly install those packages. If evdev does not support your device, install the needed driver from the {{Grp|xorg-drivers}} group.
+
For specific instructions, see also the [[libinput]] article, the following pages below, or the [https://fedoraproject.org/wiki/Input_device_configuration Fedora wiki] entry for more examples.
  
You should have {{ic|10-evdev.conf}} in the {{ic|/etc/X11/xorg.conf.d/}} directory, which manages keyboards, mice, touchpads and touchscreens.
+
=== Input identification ===
  
See the following pages for specific instructions, or the [https://fedoraproject.org/wiki/Input_device_configuration Fedora wiki] entry for more examples.
+
See [[Keyboard input#Identifying keycodes in Xorg]].
  
 
=== Mouse acceleration ===
 
=== Mouse acceleration ===
  
See the main page: [[Mouse acceleration]]
+
See [[Mouse acceleration]].
  
 
=== Extra mouse buttons ===
 
=== Extra mouse buttons ===
  
See the main page: [[All Mouse Buttons Working]]
+
See [[Mouse buttons]].
  
=== Touchpad Synaptics ===
+
=== Touchpad ===
  
See the main page: [[Touchpad Synaptics]]
+
See [[libinput]] or [[Synaptics]].
 +
 
 +
=== Touchscreen ===
 +
 
 +
See [[Touchscreen]].
  
 
=== Keyboard settings ===
 
=== Keyboard settings ===
  
See the main page: [[Keyboard configuration in Xorg]]
+
See [[Keyboard configuration in Xorg]].
  
 
== Monitor settings ==
 
== Monitor settings ==
  
=== Getting started ===
+
=== Manual configuration ===
  
{{Note|Newer versions of Xorg are auto-configuring, you should not need to use this.}}
+
{{Note|
 +
* Newer versions of Xorg are auto-configuring, so manual configuration should not be needed.
 +
* If Xorg is unable to detect any monitor or to avoid auto-configuring, a configuration file can be used. A common case where this is necessary is a headless system, which boots without a monitor and starts Xorg automatically, either from a [[Automatic login to virtual console|virtual console]] at [[Start X at login|login]], or from a [[display manager]].
 +
}}
  
First, create a new config file, such as {{ic|/etc/X11/xorg.conf.d/10-monitor.conf}}.
+
For a headless configuration the {{pkg|xf86-video-dummy}} driver is necessary; [[install]] it and create a configuration file, such as the following:
  
{{hc|/etc/X11/xorg.conf.d/10-monitor.conf|<nowiki>
+
{{hc|/etc/X11/xorg.conf.d/10-headless.conf|
 
Section "Monitor"
 
Section "Monitor"
    Identifier             "Monitor0"
+
        Identifier "dummy_monitor"
 +
        HorizSync 28.0-80.0
 +
        VertRefresh 48.0-75.0
 +
        Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
 
EndSection
 
EndSection
  
 
Section "Device"
 
Section "Device"
    Identifier             "Device0"
+
        Identifier "dummy_card"
    Driver                 "vesa" #Choose the driver used for this monitor
+
        VideoRam 256000
 +
        Driver "dummy"
 
EndSection
 
EndSection
  
 
Section "Screen"
 
Section "Screen"
    Identifier             "Screen0" #Collapse Monitor and Device section to Screen section
+
        Identifier "dummy_screen"
    Device                 "Device0"
+
        Device "dummy_card"
    Monitor               "Monitor0"
+
        Monitor "dummy_monitor"
    DefaultDepth          16 #Choose the depth (16||24)
+
        SubSection "Display"
    SubSection             "Display"
+
         EndSubSection
         Depth              16
 
        Modes              "1024x768_75.00" #Choose the resolution
 
    EndSubSection
 
 
EndSection
 
EndSection
</nowiki>}}
+
}}
  
 
=== Multiple monitors ===
 
=== Multiple monitors ===
Line 228: Line 221:
  
 
See also GPU-specific instructions:
 
See also GPU-specific instructions:
 +
 
* [[NVIDIA#Multiple monitors]]
 
* [[NVIDIA#Multiple monitors]]
* [[Nouveau#Dual Head]]
+
* [[Nouveau#Dual head]]
 
* [[AMD Catalyst#Double Screen (Dual Head / Dual Screen / Xinerama)]]
 
* [[AMD Catalyst#Double Screen (Dual Head / Dual Screen / Xinerama)]]
* [[ATI#Dual Head setup]]
+
* [[ATI#Multihead setup]]
  
 
==== More than one graphics card ====
 
==== More than one graphics card ====
Line 253: Line 247:
 
To get your bus ID:
 
To get your bus ID:
  
{{hc|<nowiki>$ lspci | grep VGA</nowiki>|<nowiki>
+
{{hc|$ lspci {{!}} grep VGA|
 
01:00.0 VGA compatible controller: nVidia Corporation G96 [GeForce 9600M GT] (rev a1)
 
01:00.0 VGA compatible controller: nVidia Corporation G96 [GeForce 9600M GT] (rev a1)
</nowiki>}}
+
}}
  
 
The bus ID here is 1:0:0.
 
The bus ID here is 1:0:0.
Line 261: Line 255:
 
=== Display size and DPI ===
 
=== Display size and DPI ===
  
{{Accuracy|1=Xorg always sets dpi to 96. See [https://bugs.freedesktop.org/show_bug.cgi?id=23705 this], [https://bugs.freedesktop.org/show_bug.cgi?id=41115 this] and finally [http://pastebin.com/vtzyBK6e this].}}
+
{{Accuracy|1=Xorg always sets dpi to 96. See [https://bugs.freedesktop.org/show_bug.cgi?id=23705 this], [https://gitlab.freedesktop.org/xorg/xserver/issues/253 this] and finally [https://pastebin.com/vtzyBK6e this].}}
  
 
The DPI of the X server is determined in the following manner:
 
The DPI of the X server is determined in the following manner:
# The -dpi command line option has highest priority.
+
 
# If this is not used, the DisplaySize setting in the X config file is used to derive the DPI, given the screen resolution.
+
# The {{ic|-dpi}} command line option has highest priority.
# If no DisplaySize is given, the monitor size values from DDC are used to derive the DPI, given the screen resolution.
+
# If this is not used, the {{ic|DisplaySize}} setting in the X config file is used to derive the DPI, given the screen resolution.
 +
# If no {{ic|DisplaySize}} is given, the monitor size values from [[Wikipedia:Display Data Channel|DDC]] are used to derive the DPI, given the screen resolution.
 
# If DDC does not specify a size, 75 DPI is used by default.
 
# If DDC does not specify a size, 75 DPI is used by default.
  
In order to get correct dots per inch (DPI) set, the display size must be recognized or set. Having the correct DPI is especially necessary where fine detail is required (like font rendering). Previously, manufacturers tried to create a standard for 96 DPI (a 10.3" diagonal monitor would be 800x600, a 13.2" monitor 1024x768). These days, screen DPIs vary and may not be equal horizontally and vertically. For example, a 19" widescreen LCD at 1440x900 may have a DPI of 89x87. To be able to set the DPI, the Xorg server attempts to auto-detect your monitor's physical screen size through the graphic card with [[wikipedia:Display_Data_Channel|DDC]].  <s>When the Xorg server knows the physical screen size, it will be able to set the correct DPI depending on resolution size.</s>
+
In order to get correct dots per inch (DPI) set, the display size must be recognized or set. Having the correct DPI is especially necessary where fine detail is required (like font rendering). Previously, manufacturers tried to create a standard for 96 DPI (a 10.3" diagonal monitor would be 800x600, a 13.2" monitor 1024x768). These days, screen DPIs vary and may not be equal horizontally and vertically. For example, a 19" widescreen LCD at 1440x900 may have a DPI of 89x87. To be able to set the DPI, the Xorg server attempts to auto-detect your monitor's physical screen size through the graphic card with DDC.  <s>When the Xorg server knows the physical screen size, it will be able to set the correct DPI depending on resolution size.</s>
  
 
To see if your display size and DPI are detected/calculated correctly:
 
To see if your display size and DPI are detected/calculated correctly:
Line 277: Line 272:
 
Check that the dimensions match your display size.  If the Xorg server is not able to correctly calculate the screen size, it will default to 75x75 DPI and you will have to calculate it yourself.
 
Check that the dimensions match your display size.  If the Xorg server is not able to correctly calculate the screen size, it will default to 75x75 DPI and you will have to calculate it yourself.
  
If you have specifications on the physical size of the screen, they can be entered in the Xorg configuration file so that the proper DPI is calculated:
+
If you have specifications on the physical size of the screen, they can be entered in the Xorg configuration file so that the proper DPI is calculated (adjust identifier to your xrandr output) :
  
 
{{bc|
 
{{bc|
 
Section "Monitor"
 
Section "Monitor"
     Identifier            "Monitor0"
+
     Identifier            "DVI-D-0"
 
     DisplaySize            286 179    # In millimeters
 
     DisplaySize            286 179    # In millimeters
 
EndSection
 
EndSection
Line 308: Line 303:
 
==== Setting DPI manually ====
 
==== Setting DPI manually ====
  
{{Accuracy|The following option is reported to work only with [[NVIDIA]] proprietary drivers.|Talk:Xorg#Setting_DPI_manually}}
+
{{Note|While you can set any dpi you like and applications using Qt and GTK will scale accordingly, it's recommended to set it to 96, 120 (25% higher), 144 (50% higher), 168 (75% higher), 192 (100% higher) etc., to reduce scaling artifacts to GUI that use bitmaps. Reducing it below 96 dpi may not reduce size of graphical elements of GUI as typically the lowest dpi the icons are made for is 96.}}
  
DPI can be set manually if you only plan to use one resolution ([http://pxcalc.com/ DPI calculator]):
+
For RandR compliant drivers (for example the open source ATI driver), you can set it by:
 +
 
 +
$ xrandr --dpi 144
 +
 
 +
{{Note|Applications that comply with the setting will not change immediately. You have to start them anew.}}
 +
 
 +
To make it permanent, see [[Autostarting#On Xorg startup]].
 +
 
 +
===== Proprietary NVIDIA driver =====
 +
 
 +
DPI can be set manually if you only plan to use one resolution ([https://www.pxcalc.com/ DPI calculator]):
  
 
{{bc|
 
{{bc|
Line 319: Line 324:
 
}}
 
}}
  
If you use an NVIDIA card, you can manually set the DPI adding the options bellow on {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}} (inside '''Device''' section):
+
You can manually set the DPI adding the options below on {{ic|/etc/X11/xorg.conf.d/20-nvidia.conf}} (inside '''Device''' section):
  
 
  Option              "UseEdidDpi" "False"
 
  Option              "UseEdidDpi" "False"
 
  Option              "DPI" "96 x 96"
 
  Option              "DPI" "96 x 96"
  
For RandR compliant drivers, you can set it by:
+
===== Manual DPI Setting Caveat =====
  
$ xrandr --dpi 96
+
GTK very often overrides the server's DPI via the optional Xresource {{ic|Xft.dpi}}. To find out whether this is happening to you, check with:
  
See [[Execute commands after X start]] to make it permanent.
+
$ xrdb -query | grep dpi
  
{{Note|While you can set any dpi you like and applications using Qt and GTK will scale accordingly, it's recommended to set it to 96, 120 (25% higher), 144 (50% higher), 168 (75% higher), 192 (100% higher) etc., to reduce scaling artifacts to GUI that use bitmaps. Reducing it below 96 dpi may not reduce size of graphical elements of GUI as typically the lowest dpi the icons are made for is 96.}}
+
With GTK library versions since 3.16, when this variable is not otherwise explicitly set, GTK sets it to 96. To have GTK apps obey the server DPI you may need to explictly set Xft.dpi to the same value as the server. The Xft.dpi resource is the method by which some desktop environments optionally force DPI to a particular value in personal settings. Among these are [[KDE]] and [[TDE]].
  
=== DPMS ===
+
=== Display Power Management ===
  
DPMS (Display Power Management Signaling) is a technology that allows power saving behaviour of monitors when the computer is not in use. This will allow you to have your monitors automatically go into standby after a predefined period of time. See: [[DPMS]]
+
[[DPMS]] (Display Power Management Signaling) is a technology that allows power saving behaviour of monitors when the computer is not in use. This will allow you to have your monitors automatically go into standby after a predefined period of time.
  
 
== Composite ==
 
== Composite ==
  
The Composite extension for X causes an entire sub-tree of the window hierarchy to be rendered to an off-screen buffer. Applications can then take the contents of that buffer and do whatever they like. The off-screen buffer can be automatically merged into the parent window or merged by external programs, called compositing managers. See the wikipedia article [[Wikipedia:Compositing window manager]] for more information.
+
The Composite extension for X causes an entire sub-tree of the window hierarchy to be rendered to an off-screen buffer. Applications can then take the contents of that buffer and do whatever they like. The off-screen buffer can be automatically merged into the parent window or merged by external programs, called compositing managers. See the following article for more information: [[Wikipedia:Compositing window manager|compositing window manager]]
 +
 
 +
Some window managers (e.g. [[Compiz]], [[Enlightenment]], KWin, Marco, Metacity, Muffin, Mutter, [[Xfwm]]) do compositing on their own. For other window managers, a standalone composite manager can be used.
  
 
=== List of composite managers ===
 
=== List of composite managers ===
  
* {{App|[[Xcompmgr]]|Composite Window-effects manager for X.org.|http://cgit.freedesktop.org/xorg/app/xcompmgr/|{{Pkg|xcompmgr}}}}
+
* {{App|[[Compton]]|Compositor (a fork of xcompmgr-dana)|https://github.com/yshui/compton|{{Pkg|compton}}{{Broken package link|replaced by {{Pkg|picom}}}}}}
* {{App|[[Compiz]]|Composite manager for Aiglx and Xgl, with plugins and CCSM|http://www.compiz.org/|{{AUR|compiz-core-devel}}}}
+
* {{App|[[Xcompmgr]]|Composite window-effects manager|https://cgit.freedesktop.org/xorg/app/xcompmgr/|{{Pkg|xcompmgr}}}}
* {{App|[[Compton]]|X Compositor (a fork of xcompmgr-dana)|https://github.com/chjj/compton|{{AUR|compton}}}}
+
* {{App|Unagi|Modular compositing manager which aims written in C and based on XCB|https://projects.mini-dweeb.org/projects/unagi|{{AUR|unagi}}}}
* {{App|[[Cairo Compmgr|Cairo Composite Manager]]|Cairo based composite manager|http://cairo-compmgr.tuxfamily.org/|{{AUR|cairo-compmgr-git}}}}
 
  
 
== Tips and tricks ==
 
== Tips and tricks ==
  
=== X startup tweaking (startx) ===
+
{{Expansion|Mention {{Pkg|xorg-xkill}}.}}
  
{{Accuracy|{{ic|/usr/bin/startx}} should not be modified, ''startx'' recognises the options as command line arguments}}
+
=== Automation ===
  
For X's option reference see:
+
This section lists utilities for automating keyboard / mouse input and window operations (like moving, resizing or raising).
$ man Xserver
 
  
The following options have to be appended to the variable {{ic|"defaultserverargs"}} in the {{ic|/usr/bin/startx}} file:
+
{| class="wikitable"
 +
! Tool !! Package !! Manual !! [[Keysym]]<br>input !! Window<br>operations !! Note
 +
|-
 +
! xautomation
 +
| {{Pkg|xautomation}} || {{man|1|xte}} || {{Yes}} || {{No}} || Also contains screen scraping tools. Cannot simulate F13+.
 +
|-
 +
! xdo
 +
| {{AUR|xdo-git}} || {{man|1|xdo}} || {{No}} || {{Yes}} || Small X utility to perform elementary actions on windows.
 +
|-
 +
! xdotool
 +
| {{Pkg|xdotool}} || {{man|1|xdotool}} || {{Yes}} || {{Yes}} || [https://github.com/jordansissel/xdotool/issues Very buggy] and not in active development, e.g: has broken CLI parsing.[https://github.com/jordansissel/xdotool/issues/14#issuecomment-327968132][https://github.com/jordansissel/xdotool/issues/71]
 +
|-
 +
! xvkbd
 +
| {{AUR|xvkbd}} || {{man|1|xvkbd|url=http://t-sato.in.coocan.jp/xvkbd/#option}} || {{Yes}} || {{No}} || Virtual keyboard for Xorg, also has the {{ic|-text}} option for sending characters.
 +
|}
  
* Enable deferred glyph loading for 16 bit fonts:
+
See also [[Clipboard#Tools]] and [https://venam.nixers.net/blog/unix/2019/01/07/win-automation.html an overview of X automation tools].
-deferglyphs 16
 
 
 
{{Note|If you start X with kdm, the startx script does not seem to be executed. X options must be appended to the variable {{ic|ServerArgsLocal}} in the {{ic|/usr/share/config/kdm/kdmrc}} file.}}
 
  
 
=== Nested X session ===
 
=== Nested X session ===
Line 368: Line 384:
  
 
To run a nested session of another desktop environment:
 
To run a nested session of another desktop environment:
 +
 
  $ /usr/bin/Xnest :1 -geometry 1024x768+0+0 -ac -name Windowmaker & wmaker -display :1
 
  $ /usr/bin/Xnest :1 -geometry 1024x768+0+0 -ac -name Windowmaker & wmaker -display :1
  
Line 376: Line 393:
 
=== Starting GUI programs remotely ===
 
=== Starting GUI programs remotely ===
  
See main article: [[SSH#X11 forwarding]].
+
See main article: [[OpenSSH#X11 forwarding]].
  
 
=== On-demand disabling and enabling of input sources ===
 
=== On-demand disabling and enabling of input sources ===
Line 382: Line 399:
 
With the help of ''xinput'' you can temporarily disable or enable input sources. This might be useful, for example, on systems that have more than one mouse, such as the ThinkPads and you would rather use just one to avoid unwanted mouse clicks.
 
With the help of ''xinput'' you can temporarily disable or enable input sources. This might be useful, for example, on systems that have more than one mouse, such as the ThinkPads and you would rather use just one to avoid unwanted mouse clicks.
  
[[pacman|Install]] the {{Pkg|xorg-xinput}} package from the [[official repositories]].
+
[[Install]] the {{Pkg|xorg-xinput}} package.
  
Find the ID of the device you want to disable:
+
Find the name or ID of the device you want to disable:
  
 
  $ xinput
 
  $ xinput
Line 404: Line 421:
 
</nowiki>}}
 
</nowiki>}}
  
Disable the device with {{ic|xinput --disable ''device_id''}}, where ''device_id'' is the device ID you want to disable. In this example we will disable the Synaptics Touchpad, with the ID 10:
+
Disable the device with {{ic|xinput --disable ''device''}}, where ''device'' is the device ID or name of the device you want to disable. In this example we will disable the Synaptics Touchpad, with the ID 10:
  
 
  $ xinput --disable 10
 
  $ xinput --disable 10
Line 412: Line 429:
 
  $ xinput --enable 10
 
  $ xinput --enable 10
  
== Troubleshooting ==
+
Alternatively using the device name, the command to disable the touchpad would be:
 +
 
 +
$ xinput --disable "SynPS/2 Synaptics TouchPad"
 +
 
 +
=== Killing application with hotkey ===
 +
 
 +
Run script on hotkey:
 +
 
 +
#!/bin/bash
 +
windowFocus=$(xdotool getwindowfocus);
 +
pid=$(xprop -id $windowFocus | grep PID);
 +
kill -9 $pid
 +
 
 +
Deps: {{Pkg|xorg-xprop}}, {{Pkg|xdotool}}
 +
 
 +
=== Block TTY access ===
 +
 
 +
{{Expansion|Why would you want to do this?}}
  
=== Common problems ===
+
To block tty access when in an X add the following to [[#Configuration|xorg.conf]]:
  
If Xorg will not start, the screen is completely black, the keyboard and mouse are not working, etc., first take these simple steps:
+
{{bc|
*Check the log file: {{ic|cat /var/log/Xorg.0.log}}
+
Section "ServerFlags"
*Check specific pages in [[:Category:Input devices]] if you have issues with keyboard, mouse, touchpad etc.
+
    Option "DontVTSwitch" "True"
*Finally, search for common problems in [[ATI]], [[Intel]] and [[NVIDIA]] articles.
+
EndSection
 +
}}
  
=== CTRL right key does not work with oss keymap ===
+
=== Prevent a user from killing X ===
  
{{Accuracy|The file will be overwritten on {{Pkg|xkeyboard-config}} update; for such simple task should be used [[Xmodmap]].}}
+
To prevent a user from killing when it is running add the following to [[#Configuration|xorg.conf]]:
  
Edit as root {{ic|/usr/share/X11/xkb/symbols/fr}}, and change the line:
+
{{bc|
 +
Section "ServerFlags"
 +
    Option "DontZap"      "True"
 +
EndSection
 +
}}
  
include "level5(rctrl_switch)"
+
== Troubleshooting ==
  
to
+
=== General ===
  
// include "level5(rctrl_switch)"
+
If a problem occurs, view the log stored in either {{ic|/var/log/}} or, for the rootless X default since v1.16, in {{ic|~/.local/share/xorg/}}. [[GDM]] users should check the [[systemd journal]]. [https://bbs.archlinux.org/viewtopic.php?id=184639]
  
Then restart X, reboot or run
+
The logfiles are of the form {{ic|Xorg.n.log}} with {{ic|n}} being the display number. For a single user machine with default configuration the applicable log is frequently {{ic|Xorg.0.log}}, but otherwise it may vary. To make sure to pick the right file it may help to look at the timestamp of the X server session start and from which console it was started. For example:
  
setxkbmap fr oss
+
{{hc|$ grep -e Log -e tty Xorg.0.log|2=
 +
[    40.623] (==) Log file: "/home/archuser/.local/share/xorg/Xorg.0.log", Time: Thu Aug 28 12:36:44 2014
 +
[    40.704] (--) controlling tty is VT number 1, auto-enabling KeepTty
 +
}}
  
=== X clients started with "su" fail ===
+
* In the logfile then be on the lookout for any lines beginning with {{ic|(EE)}}, which represent errors, and also {{ic|(WW)}}, which are warnings that could indicate other issues.
 +
* If there is an ''empty'' {{ic|.xinitrc}} file in your {{ic|$HOME}}, either delete or edit it in order for X to start properly. If you do not do this X will show a blank screen with what appears to be no errors in your {{ic|Xorg.0.log}}. Simply deleting it will get it running with a default X environment.
 +
* If the screen goes black, you may still attempt to switch to a different virtual console (e.g. {{ic|Ctrl+Alt+F6}}), and blindly log in as root. You can do this by typing {{ic|root}} (press {{ic|Enter}} after typing it) and entering the root password (again, press {{ic|Enter}} after typing it).
  
If you are getting "Client is not authorized to connect to server", try adding the line:
+
: You may also attempt to kill the X server with:
 +
: {{bc|# pkill -x X}}
 +
: If this does not work, reboot blindly with:
 +
: {{bc|# reboot}}
  
session        optional        pam_xauth.so
+
* Check specific pages in [[:Category:Input devices]] if you have issues with keyboard, mouse, touchpad etc.
 +
* Search for common problems in [[ATI]], [[Intel]] and [[NVIDIA]] articles.
  
to {{ic|/etc/pam.d/su}}. {{ic|pam_xauth}} will then properly set environment variables and handle {{ic|xauth}} keys.
+
=== Black screen, No protocol specified.., Resource temporarily unavailable for all or some users ===
  
=== Program requests "font '(null)'" ===
+
X creates configuration and temporary files in current user's home directory. Make sure there is free disk space available on the partition your home directory resides in. Unfortunately, X server does not provide any more obvious information about lack of disk space in this case.
  
* Error message: "''unable to load font `(null)'.''"
+
=== DRI with Matrox cards stopped working ===
Some programs only work with bitmap fonts. Two major packages with bitmap fonts are available, {{Pkg|xorg-fonts-75dpi}} and {{Pkg|xorg-fonts-100dpi}}. You do not need both; one should be enough. To find out which one would be better in your case, try this:
 
  
$ xdpyinfo | grep resolution
+
If you use a Matrox card and DRI stopped working after upgrading to Xorg, try adding the line:
  
and use what is closer to you (75 or 100 instead of XX)
+
Option "OldDmaInit" "On"
  
# pacman -S xorg-fonts-XXdpi
+
to the Device section that references the video card in {{ic|xorg.conf}}.
  
 
=== Frame-buffer mode problems ===
 
=== Frame-buffer mode problems ===
Line 474: Line 521:
 
</nowiki>}}
 
</nowiki>}}
  
uninstall fbdev:
+
[[Uninstall]] the {{pkg|xf86-video-fbdev}} package.
  
# pacman -R xf86-video-fbdev
+
=== Program requests "font '(null)'" ===
  
=== DRI with Matrox cards stops working ===
+
Error message: {{ic|unable to load font `(null)'}}.
  
If you use a Matrox card and DRI stops working after upgrading to Xorg, try adding the line:
+
Some programs only work with bitmap fonts. Two major packages with bitmap fonts are available, {{Pkg|xorg-fonts-75dpi}} and {{Pkg|xorg-fonts-100dpi}}. You do not need both; one should be enough. To find out which one would be better in your case, try {{ic|xdpyinfo}} from {{Pkg|xorg-xdpyinfo}}, like this:
  
  Option "OldDmaInit" "On"
+
  $ xdpyinfo | grep resolution
  
to the Device section that references the video card in {{ic|xorg.conf}}.
+
and use what is closer to the shown value.
  
 
=== Recovery: disabling Xorg before GUI login ===
 
=== Recovery: disabling Xorg before GUI login ===
Line 491: Line 538:
  
 
* Change default target to rescue.target. See [[systemd#Change default target to boot into]].
 
* Change default target to rescue.target. See [[systemd#Change default target to boot into]].
* If you have not only a faulty system that makes Xorg unusable, but you have also set the GRUB menu wait time to zero, or cannot otherwise use GRUB to prevent Xorg from booting, you can use the Arch Linux live CD. Boot up the live CD and log in as root. You need a mount point, such as {{ic|/mnt}}, and you need to know the name of the partition you want to mount.
+
* If you have not only a faulty system that makes Xorg unusable, but you have also set the GRUB menu wait time to zero, or cannot otherwise use GRUB to prevent Xorg from booting, you can use the Arch Linux live CD. Follow the [[Installation_guide#Format the partitions|installation guide]] about how to mount and chroot into the installed Arch Linux. Alternatively try to switch into another [[tty]] with {{ic|Ctrl+Alt}} + function key (usually from {{ic|F1}} to {{ic|F7}} depending on which is not used by X), login as root and follow steps below.
  
You can use the command,
+
Depending on setup, you will need to do one or more of these steps:
  
# fdisk -l
+
* [[Disable]] the [[display manager]].
 +
* Disable the [[start X at login|automatic start of the X]].
 +
* Rename the {{ic|~/.xinitrc}} or comment out the {{ic|exec}} line in it.
  
to see your partitions. Usually, the one you want will be resembling {{ic|/dev/sda1}}. Then, to mount this to {{ic|/mnt}}, use
+
=== X clients started with "su" fail ===
  
# mount /dev/sda1 /mnt
+
If you are getting "Client is not authorized to connect to server", try adding the line:
  
Then your filesystem will show up under {{ic|/mnt}}. From here you can delete the {{ic|gdm}} daemon to prevent Xorg from booting up normally or make any other necessary changes to the configuration.
+
session        optional        pam_xauth.so
 +
 
 +
to {{ic|/etc/pam.d/su}} and {{ic|/etc/pam.d/su-l}}. {{ic|pam_xauth}} will then properly set environment variables and handle {{ic|xauth}} keys.
  
 
=== X failed to start: Keyboard initialization failed ===
 
=== X failed to start: Keyboard initialization failed ===
  
If your hard disk is full, startx will fail. {{ic|/var/log/Xorg.0.log}} will end with:
+
If the filesystem (specifically {{ic|/tmp}}) is full, {{ic|startx}} will fail. {{ic|/var/log/Xorg.0.log}} will end with:
  
{{bc|
+
{{bc|<nowiki>
 
(EE) Error compiling keymap (server-0)
 
(EE) Error compiling keymap (server-0)
 
(EE) XKB: Could not compile keymap
 
(EE) XKB: Could not compile keymap
Line 517: Line 568:
 
Fatal server error:
 
Fatal server error:
 
Failed to activate core devices.
 
Failed to activate core devices.
Please consult the The X.Org Foundation support at http://wiki.x.org
+
Please consult the The X.Org Foundation support at http://wiki.x.org
 
for help.
 
for help.
 
Please also check the log file at "/var/log/Xorg.0.log" for additional information.
 
Please also check the log file at "/var/log/Xorg.0.log" for additional information.
 
(II) AIGLX: Suspending AIGLX clients for VT switch
 
(II) AIGLX: Suspending AIGLX clients for VT switch
}}
+
</nowiki>}}
 +
 
 +
Make some free space on the relevant filesystem and X will start.
 +
 
 +
=== Rootless Xorg ===
 +
 
 +
Xorg may run with standard user privileges with the help of {{man|8|systemd-logind}}, see [https://fedoraproject.org/wiki/Changes/XorgWithoutRootRights] and {{Bug|41257}}. The requirements for this are:
 +
 
 +
* Starting X via [[xinit]]; display managers are not supported
 +
* [[Kernel mode setting]]; implementations in proprietary display drivers fail [https://cgit.freedesktop.org/xorg/xserver/tree/hw/xfree86/xorg-wrapper.c#n222 auto-detection] and require manually setting {{ic|1=needs_root_rights = no}} in {{ic|/etc/X11/Xwrapper.config}}.
 +
 
 +
If you do not fit these requirements, re-enable root rights in {{ic|/etc/X11/Xwrapper.config}}:
 +
 
 +
{{hc|/etc/X11/Xwrapper.config|2=
 +
needs_root_rights = ''yes''}}
 +
 
 +
See also {{man|1|Xorg.wrap}} and [[Systemd/User#Xorg as a systemd user service]].
 +
 
 +
[[GDM]] also runs Xorg without root privileges by default when [[Kernel mode setting]] is used.
 +
 
 +
==== Broken redirection ====
 +
 
 +
While user Xorg logs are stored in {{ic|~/.local/share/xorg/Xorg.log}}, they do not include the output from the X session. To re-enable redirection, start X with the {{ic|-keeptty}} flag:
 +
 
 +
exec startx -- -keeptty > ~/.xorg.log 2>&1
 +
 
 +
Or copy {{ic|/etc/X11/xinit/xserverrc}} to {{ic|~/.xserverrc}}, and append {{ic|-keeptty}}. See [https://bbs.archlinux.org/viewtopic.php?pid=1446402#p1446402].
 +
 
 +
=== A green screen whenever trying to watch a video===
 +
 
 +
Your color depth is set wrong. It may need to be 24 instead of 16, for example.
 +
 
 +
=== SocketCreateListener error ===
 +
 
 +
If X terminates with error message "SocketCreateListener() failed", you may need to delete socket files in {{ic|/tmp/.X11-unix}}. This may happen if you have previously run Xorg as root (e.g. to generate an {{ic|xorg.conf}}).
 +
 
 +
=== Invalid MIT-MAGIC-COOKIE-1 key when trying to run a program as root ===
 +
 
 +
That error means that only the current user has access to the X server. The solution is to give access to root:
 +
 
 +
$ xhost +si:localuser:root
 +
 
 +
That line can also be used to give access to X to a different user than root.
 +
 
 +
=== Xorg-server Fatal server error: (EE) AddScreen/ScreenInit ===
 +
 
 +
If the Xorg server is not working randomly and in the Xorg log you see:
 +
 
 +
systemd-logind: failed to take device /dev/dri/card0: Operation not permitted
 +
...
 +
AddScreen/ScreenInit failed for driver 0
  
Make some free space on your root partition and X will start.
+
Then, this problem may be caused by [https://github.com/systemd/systemd/issues/13943 systemd issue 13943]. Set up [[Kernel mode setting#Early KMS start|early KMS start]].
  
=== Black screen, No protocol specified.., Resource temporarily unavailable for all or some users ===
+
== See also ==
  
X creates configuration and temporary files in current user's home directory. Make sure there is free disk space available on the partition your home directory resides in. Unfortunately, X server does not provide any more obvious information about lack of disk space in this case.
+
* [https://magcius.github.io/xplain/article/ Xplain] - In-depth explanation of the X Window System
 +
* {{man|1|Xorg}} - Xorg's Manual Page
 +
* [https://wiki.gentoo.org/wiki/Xorg/Guide/en#Configuration Gentoo/Xorg#Configuration] - Gentoo Wiki's Xorg Configuration page

Latest revision as of 12:30, 30 November 2019

From https://www.x.org/wiki/:

The X.Org project provides an open source implementation of the X Window System. The development work is being done in conjunction with the freedesktop.org community. The X.Org Foundation is the educational non-profit corporation whose Board serves this effort, and whose Members lead this work.

Xorg (commonly referred as simply X) is the most popular display server among Linux users. Its ubiquity has led to making it an ever-present requisite for GUI applications, resulting in massive adoption from most distributions. See the Xorg Wikipedia article or visit the Xorg website for more details.

Installation

Xorg can be installed with the xorg-server package.

Additionally, some packages from the xorg-apps group are necessary for certain configuration tasks, they are pointed out in the relevant sections.

Finally, an xorg group is also available, which includes Xorg server packages, packages from the xorg-apps group and fonts.

Tip: You will typically seek to install a window manager or a desktop environment to supplement X.

Driver installation

The Linux kernel includes open-source video drivers and support for hardware accelerated framebuffers. However, userland support is required for OpenGL and 2D acceleration in X11.

First, identify your card:

$ lspci | grep -e VGA -e 3D

Then install an appropriate driver. You can search the package database for a complete list of open-source video drivers:

$ pacman -Ss xf86-video

Xorg searches for installed drivers automatically:

  • If it cannot find the specific driver installed for the hardware (listed below), it first searches for fbdev (xf86-video-fbdev).
  • If that is not found, it searches for vesa (xf86-video-vesa), the generic driver, which handles a large number of chipsets but does not include any 2D or 3D acceleration.
  • If vesa is not found, Xorg will fall back to kernel mode setting, which includes GLAMOR acceleration (see modesetting(4)).

In order for video acceleration to work, and often to expose all the modes that the GPU can set, a proper video driver is required:

Brand Type Driver OpenGL OpenGL (multilib) Documentation
AMD / ATI Open source xf86-video-amdgpu mesa lib32-mesa AMDGPU
xf86-video-ati ATI
Intel Open source xf86-video-intel mesa lib32-mesa Intel graphics
NVIDIA Open source xf86-video-nouveau mesa lib32-mesa Nouveau
Proprietary nvidia nvidia-utils lib32-nvidia-utils NVIDIA
nvidia-390xx nvidia-390xx-utils lib32-nvidia-390xx-utils
Note:

Other video drivers can be found in the xorg-drivers group.

Xorg should run smoothly without closed source drivers, which are typically needed only for advanced features such as fast 3D-accelerated rendering for games. The exceptions to this rule are recent GPUs (especially NVIDIA GPUs), that are not supported by the open source drivers.

AMD

GPU architecture Radeon cards Open-source driver Proprietary driver
GCN 4
and newer
various AMDGPU AMDGPU PRO
GCN 3 AMDGPU Catalyst /
AMDGPU PRO
GCN 2 AMDGPU* / ATI Catalyst
GCN 1 AMDGPU* / ATI Catalyst
TeraScale 2&3 HD 5000 - HD 6000 ATI Catalyst
TeraScale 1 HD 2000 - HD 4000 Catalyst legacy
Older X1000 and older not available
*: Experimental

Running

The Xorg(1) command is usually not run directly, instead the X server is started with either a display manager or xinit.

Configuration

Note: Arch supplies default configuration files in /usr/share/X11/xorg.conf.d/, and no extra configuration is necessary for most setups.

Xorg uses a configuration file called xorg.conf and files ending in the suffix .conf for its initial setup: the complete list of the folders where these files are searched can be found in xorg.conf(5), together with a detailed explanation of all the available options.

Using .conf files

The /etc/X11/xorg.conf.d/ directory stores host-specific configuration. You are free to add configuration files there, but they must have a .conf suffix: the files are read in ASCII order, and by convention their names start with XX- (two digits and a hyphen, so that for example 10 is read before 20). These files are parsed by the X server upon startup and are treated like part of the traditional xorg.conf configuration file. Note that on conflicting configuration, the file read last will be processed. For that reason the most generic configuration files should be ordered first by name. The configuration entries in the xorg.conf file are processed at the end.

For option examples to set, see also the Fedora wiki.

Using xorg.conf

Xorg can also be configured via /etc/X11/xorg.conf or /etc/xorg.conf. You can also generate a skeleton for xorg.conf with:

# Xorg :0 -configure

This should create a xorg.conf.new file in /root/ that you can copy over to /etc/X11/xorg.conf.

Tip: If you are already running an X server, use a different display, for example Xorg :2 -configure.

Alternatively, your proprietary video card drivers may come with a tool to automatically configure Xorg: see the article of your video driver, NVIDIA or AMD Catalyst, for more details.

Note: Configuration file keywords are case insensitive, and "_" characters are ignored. Most strings (including Option names) are also case insensitive, and insensitive to white space and "_" characters.

Input devices

For input devices the X server defaults to the libinput driver (xf86-input-libinput), but xf86-input-evdev and related drivers are available as alternative.[1]

Udev, which is provided as a systemd dependency, will detect hardware and both drivers will act as hotplugging input driver for almost all devices, as defined in the default configuration files 10-quirks.conf and 40-libinput.conf in the /usr/share/X11/xorg.conf.d/ directory.

After starting X server, the log file will show which driver hotplugged for the individual devices (note the most recent log file name may vary):

$ grep -e "Using input driver " Xorg.0.log

If both do not support a particular device, install the needed driver from the xorg-drivers group. The same applies, if you want to use another driver.

To influence hotplugging, see #Configuration.

For specific instructions, see also the libinput article, the following pages below, or the Fedora wiki entry for more examples.

Input identification

See Keyboard input#Identifying keycodes in Xorg.

Mouse acceleration

See Mouse acceleration.

Extra mouse buttons

See Mouse buttons.

Touchpad

See libinput or Synaptics.

Touchscreen

See Touchscreen.

Keyboard settings

See Keyboard configuration in Xorg.

Monitor settings

Manual configuration

Note:
  • Newer versions of Xorg are auto-configuring, so manual configuration should not be needed.
  • If Xorg is unable to detect any monitor or to avoid auto-configuring, a configuration file can be used. A common case where this is necessary is a headless system, which boots without a monitor and starts Xorg automatically, either from a virtual console at login, or from a display manager.

For a headless configuration the xf86-video-dummy driver is necessary; install it and create a configuration file, such as the following:

/etc/X11/xorg.conf.d/10-headless.conf
Section "Monitor"
        Identifier "dummy_monitor"
        HorizSync 28.0-80.0
        VertRefresh 48.0-75.0
        Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
EndSection

Section "Device"
        Identifier "dummy_card"
        VideoRam 256000
        Driver "dummy"
EndSection

Section "Screen"
        Identifier "dummy_screen"
        Device "dummy_card"
        Monitor "dummy_monitor"
        SubSection "Display"
        EndSubSection
EndSection

Multiple monitors

See main article Multihead for general information.

See also GPU-specific instructions:

More than one graphics card

You must define the correct driver to use and put the bus ID of your graphic cards.

Section "Device"
    Identifier             "Screen0"
    Driver                 "nouveau"
    BusID                  "PCI:0:12:0"
EndSection

Section "Device"
    Identifier             "Screen1"
    Driver                 "radeon"
    BusID                  "PCI:1:0:0"
EndSection

To get your bus ID:

$ lspci | grep VGA
01:00.0 VGA compatible controller: nVidia Corporation G96 [GeForce 9600M GT] (rev a1)

The bus ID here is 1:0:0.

Display size and DPI

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: Xorg always sets dpi to 96. See this, this and finally this. (Discuss in Talk:Xorg#)

The DPI of the X server is determined in the following manner:

  1. The -dpi command line option has highest priority.
  2. If this is not used, the DisplaySize setting in the X config file is used to derive the DPI, given the screen resolution.
  3. If no DisplaySize is given, the monitor size values from DDC are used to derive the DPI, given the screen resolution.
  4. If DDC does not specify a size, 75 DPI is used by default.

In order to get correct dots per inch (DPI) set, the display size must be recognized or set. Having the correct DPI is especially necessary where fine detail is required (like font rendering). Previously, manufacturers tried to create a standard for 96 DPI (a 10.3" diagonal monitor would be 800x600, a 13.2" monitor 1024x768). These days, screen DPIs vary and may not be equal horizontally and vertically. For example, a 19" widescreen LCD at 1440x900 may have a DPI of 89x87. To be able to set the DPI, the Xorg server attempts to auto-detect your monitor's physical screen size through the graphic card with DDC. When the Xorg server knows the physical screen size, it will be able to set the correct DPI depending on resolution size.

To see if your display size and DPI are detected/calculated correctly:

$ xdpyinfo | grep -B2 resolution

Check that the dimensions match your display size. If the Xorg server is not able to correctly calculate the screen size, it will default to 75x75 DPI and you will have to calculate it yourself.

If you have specifications on the physical size of the screen, they can be entered in the Xorg configuration file so that the proper DPI is calculated (adjust identifier to your xrandr output) :

Section "Monitor"
    Identifier             "DVI-D-0"
    DisplaySize             286 179    # In millimeters
EndSection

If you only want to enter the specification of your monitor without creating a full xorg.conf create a new config file. For example (/etc/X11/xorg.conf.d/90-monitor.conf):

Section "Monitor"
    Identifier             "<default monitor>"
    DisplaySize            286 179    # In millimeters
EndSection

If you do not have specifications for physical screen width and height (most specifications these days only list by diagonal size), you can use the monitor's native resolution (or aspect ratio) and diagonal length to calculate the horizontal and vertical physical dimensions. Using the Pythagorean theorem on a 13.3" diagonal length screen with a 1280x800 native resolution (or 16:10 aspect ratio):

$ echo 'scale=5;sqrt(1280^2+800^2)' | bc  # 1509.43698

This will give the pixel diagonal length and with this value you can discover the physical horizontal and vertical lengths (and convert them to millimeters):

$ echo 'scale=5;(13.3/1509)*1280*25.4' | bc  # 286.43072
$ echo 'scale=5;(13.3/1509)*800*25.4'  | bc  # 179.01920
Note: This calculation works for monitors with square pixels; however, there is the seldom monitor that may compress aspect ratio (e.g 16:10 aspect resolution to a 16:9 monitor). If this is the case, you should measure your screen size manually.

Setting DPI manually

Note: While you can set any dpi you like and applications using Qt and GTK will scale accordingly, it's recommended to set it to 96, 120 (25% higher), 144 (50% higher), 168 (75% higher), 192 (100% higher) etc., to reduce scaling artifacts to GUI that use bitmaps. Reducing it below 96 dpi may not reduce size of graphical elements of GUI as typically the lowest dpi the icons are made for is 96.

For RandR compliant drivers (for example the open source ATI driver), you can set it by:

$ xrandr --dpi 144
Note: Applications that comply with the setting will not change immediately. You have to start them anew.

To make it permanent, see Autostarting#On Xorg startup.

Proprietary NVIDIA driver

DPI can be set manually if you only plan to use one resolution (DPI calculator):

Section "Monitor"
    Identifier             "Monitor0"
    Option                 "DPI" "96 x 96"
EndSection

You can manually set the DPI adding the options below on /etc/X11/xorg.conf.d/20-nvidia.conf (inside Device section):

Option              "UseEdidDpi" "False"
Option              "DPI" "96 x 96"
Manual DPI Setting Caveat

GTK very often overrides the server's DPI via the optional Xresource Xft.dpi. To find out whether this is happening to you, check with:

$ xrdb -query | grep dpi

With GTK library versions since 3.16, when this variable is not otherwise explicitly set, GTK sets it to 96. To have GTK apps obey the server DPI you may need to explictly set Xft.dpi to the same value as the server. The Xft.dpi resource is the method by which some desktop environments optionally force DPI to a particular value in personal settings. Among these are KDE and TDE.

Display Power Management

DPMS (Display Power Management Signaling) is a technology that allows power saving behaviour of monitors when the computer is not in use. This will allow you to have your monitors automatically go into standby after a predefined period of time.

Composite

The Composite extension for X causes an entire sub-tree of the window hierarchy to be rendered to an off-screen buffer. Applications can then take the contents of that buffer and do whatever they like. The off-screen buffer can be automatically merged into the parent window or merged by external programs, called compositing managers. See the following article for more information: compositing window manager

Some window managers (e.g. Compiz, Enlightenment, KWin, Marco, Metacity, Muffin, Mutter, Xfwm) do compositing on their own. For other window managers, a standalone composite manager can be used.

List of composite managers

  • Compton — Compositor (a fork of xcompmgr-dana)
https://github.com/yshui/compton || compton[broken link: replaced by picom]
  • Xcompmgr — Composite window-effects manager
https://cgit.freedesktop.org/xorg/app/xcompmgr/ || xcompmgr
  • Unagi — Modular compositing manager which aims written in C and based on XCB
https://projects.mini-dweeb.org/projects/unagi || unagiAUR

Tips and tricks

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Mention xorg-xkill. (Discuss in Talk:Xorg#)

Automation

This section lists utilities for automating keyboard / mouse input and window operations (like moving, resizing or raising).

Tool Package Manual Keysym
input
Window
operations
Note
xautomation xautomation xte(1) Yes No Also contains screen scraping tools. Cannot simulate F13+.
xdo xdo-gitAUR xdo(1) No Yes Small X utility to perform elementary actions on windows.
xdotool xdotool xdotool(1) Yes Yes Very buggy and not in active development, e.g: has broken CLI parsing.[2][3]
xvkbd xvkbdAUR xvkbd(1) Yes No Virtual keyboard for Xorg, also has the -text option for sending characters.

See also Clipboard#Tools and an overview of X automation tools.

Nested X session

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: mention xephyr (Discuss in Talk:Xorg#)

To run a nested session of another desktop environment:

$ /usr/bin/Xnest :1 -geometry 1024x768+0+0 -ac -name Windowmaker & wmaker -display :1

This will launch a Window Maker session in a 1024 by 768 window within your current X session.

This needs the package xorg-server-xnest to be installed.

Starting GUI programs remotely

See main article: OpenSSH#X11 forwarding.

On-demand disabling and enabling of input sources

With the help of xinput you can temporarily disable or enable input sources. This might be useful, for example, on systems that have more than one mouse, such as the ThinkPads and you would rather use just one to avoid unwanted mouse clicks.

Install the xorg-xinput package.

Find the name or ID of the device you want to disable:

$ xinput

For example in a Lenovo ThinkPad T500, the output looks like this:

$ xinput
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=11   [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=10   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Sleep Button                              id=8    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=9    [slave  keyboard (3)]
    ↳ ThinkPad Extra Buttons                    id=12   [slave  keyboard (3)]

Disable the device with xinput --disable device, where device is the device ID or name of the device you want to disable. In this example we will disable the Synaptics Touchpad, with the ID 10:

$ xinput --disable 10

To re-enable the device, just issue the opposite command:

$ xinput --enable 10

Alternatively using the device name, the command to disable the touchpad would be:

$ xinput --disable "SynPS/2 Synaptics TouchPad"

Killing application with hotkey

Run script on hotkey:

#!/bin/bash
windowFocus=$(xdotool getwindowfocus);
pid=$(xprop -id $windowFocus | grep PID);
kill -9 $pid

Deps: xorg-xprop, xdotool

Block TTY access

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Why would you want to do this? (Discuss in Talk:Xorg#)

To block tty access when in an X add the following to xorg.conf:

Section "ServerFlags"
    Option "DontVTSwitch" "True"
EndSection

Prevent a user from killing X

To prevent a user from killing when it is running add the following to xorg.conf:

Section "ServerFlags"
    Option "DontZap"      "True"
EndSection

Troubleshooting

General

If a problem occurs, view the log stored in either /var/log/ or, for the rootless X default since v1.16, in ~/.local/share/xorg/. GDM users should check the systemd journal. [4]

The logfiles are of the form Xorg.n.log with n being the display number. For a single user machine with default configuration the applicable log is frequently Xorg.0.log, but otherwise it may vary. To make sure to pick the right file it may help to look at the timestamp of the X server session start and from which console it was started. For example:

$ grep -e Log -e tty Xorg.0.log
[    40.623] (==) Log file: "/home/archuser/.local/share/xorg/Xorg.0.log", Time: Thu Aug 28 12:36:44 2014
[    40.704] (--) controlling tty is VT number 1, auto-enabling KeepTty
  • In the logfile then be on the lookout for any lines beginning with (EE), which represent errors, and also (WW), which are warnings that could indicate other issues.
  • If there is an empty .xinitrc file in your $HOME, either delete or edit it in order for X to start properly. If you do not do this X will show a blank screen with what appears to be no errors in your Xorg.0.log. Simply deleting it will get it running with a default X environment.
  • If the screen goes black, you may still attempt to switch to a different virtual console (e.g. Ctrl+Alt+F6), and blindly log in as root. You can do this by typing root (press Enter after typing it) and entering the root password (again, press Enter after typing it).
You may also attempt to kill the X server with:
# pkill -x X
If this does not work, reboot blindly with:
# reboot

Black screen, No protocol specified.., Resource temporarily unavailable for all or some users

X creates configuration and temporary files in current user's home directory. Make sure there is free disk space available on the partition your home directory resides in. Unfortunately, X server does not provide any more obvious information about lack of disk space in this case.

DRI with Matrox cards stopped working

If you use a Matrox card and DRI stopped working after upgrading to Xorg, try adding the line:

Option "OldDmaInit" "On"

to the Device section that references the video card in xorg.conf.

Frame-buffer mode problems

If X fails to start with the following log messages,

(WW) Falling back to old probe method for fbdev
(II) Loading sub module "fbdevhw"
(II) LoadModule: "fbdevhw"
(II) Loading /usr/lib/xorg/modules/linux//libfbdevhw.so
(II) Module fbdevhw: vendor="X.Org Foundation"
       compiled for 1.6.1, module version=0.0.2
       ABI class: X.Org Video Driver, version 5.0
(II) FBDEV(1): using default device

Fatal server error:
Cannot run in framebuffer mode. Please specify busIDs for all framebuffer devices

Uninstall the xf86-video-fbdev package.

Program requests "font '(null)'"

Error message: unable to load font `(null)'.

Some programs only work with bitmap fonts. Two major packages with bitmap fonts are available, xorg-fonts-75dpi and xorg-fonts-100dpi. You do not need both; one should be enough. To find out which one would be better in your case, try xdpyinfo from xorg-xdpyinfo, like this:

$ xdpyinfo | grep resolution

and use what is closer to the shown value.

Recovery: disabling Xorg before GUI login

If Xorg is set to boot up automatically and for some reason you need to prevent it from starting up before the login/display manager appears (if the system is wrongly configured and Xorg does not recognize your mouse or keyboard input, for instance), you can accomplish this task with two methods.

  • Change default target to rescue.target. See systemd#Change default target to boot into.
  • If you have not only a faulty system that makes Xorg unusable, but you have also set the GRUB menu wait time to zero, or cannot otherwise use GRUB to prevent Xorg from booting, you can use the Arch Linux live CD. Follow the installation guide about how to mount and chroot into the installed Arch Linux. Alternatively try to switch into another tty with Ctrl+Alt + function key (usually from F1 to F7 depending on which is not used by X), login as root and follow steps below.

Depending on setup, you will need to do one or more of these steps:

X clients started with "su" fail

If you are getting "Client is not authorized to connect to server", try adding the line:

session        optional        pam_xauth.so

to /etc/pam.d/su and /etc/pam.d/su-l. pam_xauth will then properly set environment variables and handle xauth keys.

X failed to start: Keyboard initialization failed

If the filesystem (specifically /tmp) is full, startx will fail. /var/log/Xorg.0.log will end with:

(EE) Error compiling keymap (server-0)
(EE) XKB: Could not compile keymap
(EE) XKB: Failed to load keymap. Loading default keymap instead.
(EE) Error compiling keymap (server-0)
(EE) XKB: Could not compile keymap
XKB: Failed to compile keymap
Keyboard initialization failed. This could be a missing or incorrect setup of xkeyboard-config.
Fatal server error:
Failed to activate core devices.
Please consult the The X.Org Foundation support at http://wiki.x.org
for help.
Please also check the log file at "/var/log/Xorg.0.log" for additional information.
(II) AIGLX: Suspending AIGLX clients for VT switch

Make some free space on the relevant filesystem and X will start.

Rootless Xorg

Xorg may run with standard user privileges with the help of systemd-logind(8), see [5] and FS#41257. The requirements for this are:

  • Starting X via xinit; display managers are not supported
  • Kernel mode setting; implementations in proprietary display drivers fail auto-detection and require manually setting needs_root_rights = no in /etc/X11/Xwrapper.config.

If you do not fit these requirements, re-enable root rights in /etc/X11/Xwrapper.config:

/etc/X11/Xwrapper.config
needs_root_rights = yes

See also Xorg.wrap(1) and Systemd/User#Xorg as a systemd user service.

GDM also runs Xorg without root privileges by default when Kernel mode setting is used.

Broken redirection

While user Xorg logs are stored in ~/.local/share/xorg/Xorg.log, they do not include the output from the X session. To re-enable redirection, start X with the -keeptty flag:

exec startx -- -keeptty > ~/.xorg.log 2>&1

Or copy /etc/X11/xinit/xserverrc to ~/.xserverrc, and append -keeptty. See [6].

A green screen whenever trying to watch a video

Your color depth is set wrong. It may need to be 24 instead of 16, for example.

SocketCreateListener error

If X terminates with error message "SocketCreateListener() failed", you may need to delete socket files in /tmp/.X11-unix. This may happen if you have previously run Xorg as root (e.g. to generate an xorg.conf).

Invalid MIT-MAGIC-COOKIE-1 key when trying to run a program as root

That error means that only the current user has access to the X server. The solution is to give access to root:

$ xhost +si:localuser:root

That line can also be used to give access to X to a different user than root.

Xorg-server Fatal server error: (EE) AddScreen/ScreenInit

If the Xorg server is not working randomly and in the Xorg log you see:

systemd-logind: failed to take device /dev/dri/card0: Operation not permitted
...
AddScreen/ScreenInit failed for driver 0

Then, this problem may be caused by systemd issue 13943. Set up early KMS start.

See also