This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Xorg/Guide

From Gentoo Wiki (test)
< Xorg
Jump to:navigation Jump to:search
This page is a translated version of the page Xorg/Guide and the translation is 47% complete.
Outdated translations are marked like this.

Xorg is the X Window server which allows users to have a graphical environment at their fingertips. This guide explains what Xorg is, how to install it, and the various configuration options.

Was ist der X Window Server?

Grafisch gegen Kommandozeile

Der durchschnittliche Benutzer mag vielleicht bei dem Gedanken beängstigt sein, Befehle eintippen zu müssen. Warum sollte er sich nicht per grafischer Benutzeroberfläche seinen Weg durch die Freiheit von Gentoo (und Linux im allgemeinen) klicken können? Nun, natürlich können sie das machen! Linux bietet eine grosse Auswahl an auffälligen Benutzerschnittstellen und Umgebungen, die Sie auf der Basis Ihrer vorhandenen Installation installieren können.

Dies ist eine der grössten Überraschungen auf die neue Benutzer stossen: Eine grafische Benutzerschnittstelle ist nichts anderes als ein Programm, das auf Ihrem System läuft. Es ist kein Teil des Linux Kernel oder irgendein anderes Interna des Systems. Es ist ein mächtiges Werkzeug, das die grafischen Fähigkeiten Ihres Arbeitsplatzrechners ermöglicht.

Weil Standards wichtig sind, wurde ein Standard für die Darstellung und das Verschieben von Fenstern auf einem Bildschirm, die Interaktion mit dem Benutzer über Maus, Keyboard und andere Grundlagen, aber dennoch wichtige Aspekte geschaffen und als X Window System bezeichnet; Allgemein abgekürzt als X11 oder nur X. Es wird auf Unix, Linux und Unix-ähnlichen Betriebssystemen überall auf der Welt verwendet.

Das Programm das Linux Nutzern die Möglichkeit bietet grafische Benutzerschnittstellen zu verwenden und das den X11 Standard nutzt ist Xorg-X11, eine Abspaltung des XFree86 Projektes. XFree86 hat sich dazu entschlossen eine Lizenz zu verwenden, die möglicherweise nicht mit der GPL Lizenz kompatibel ist. Es wird daher empfohlen Xorg zu verwenden. Der offizielle Portage-Tree stellt keine XFree86 Paket mehr zur Verfügung.

Das X.org Projekt

Das X.org Projekt erschuf und pflegt eine frei verteilbare Open Source Implementierung des X11 Systems. Es ist eine Open Source X11-basierte Desktop Infrastruktur.

Xorg bietet eine Schnittstelle zwischen Ihrer Hardware und der grafischen Software, die sie benutzen wollen. Zudem ist Xorg komplett "Netzwerk-bewusst". Das bedeutet, dass sie eine Anwendung auf einem System laufen lassen können, während Sie sie auf einem anderen betrachten.

Installation

Before you can install Xorg, you need to prepare your system for it. First, we'll set up the kernel to support input devices and video cards. Then we'll prepare /etc/portage/make.conf so that the right drivers and Xorg packages are built and installed.

Eingabetreiber-Unterstützung

Support for Event interface (CONFIG_INPUT_EVDEV) needs to be activated by making a change to the kernel configuration. Read the Kernel Configuration Guide if you don't know how to setup your kernel.

KERNEL evdev im Kernel aktivieren
'"`UNIQ--pre-00000001-QINU`"'

Kernel Mode-Setting

Modern open source video drivers rely on kernel mode setting (KMS). KMS provides an improved graphical boot with less flickering, faster user switching, a built-in framebuffer console, seamless switching from the console to Xorg, and other features.

Wichtig
KMS conflicts with legacy framebuffer drivers, which must remain disabled in the kernel configuration.

First prepare the kernel for KMS. This step regardless of which Xorg video driver will be used:

KERNEL Disable legacy framebuffer support and enable basic console FB support
Device Drivers --->
   Graphics support --->
      Frame Buffer Devices --->
         <*> Support for frame buffer devices --->
         ## (Disable all drivers, including VGA, Intel, nVidia, and ATI, except EFI-based Framebuffer Support, only if you are using UEFI)
 
    ## (Further down, enable basic console support. KMS uses this.)
    Console display driver support --->
      <*>  Framebuffer Console Support

Next configure the kernel to use the proper KMS driver for the video card. Intel, nVidia, and AMD/ATI are the most common cards, so follow code listing for each card below.

For Intel cards see the kernel section of the Intel article.

Für nVidia Karten:

KERNEL nVidia settings
Device Drivers --->
   Graphics support --->
      <M/*>  Nouveau (nVidia) cards

Für neuere AMD/ATI Karten (RadeonHD 2000 und aufwärts), emergen Sie x11-drivers/radeon-ucode oder sys-kernel/linux-firmware. Sobald Sie eines dieser Pakete installiert haben, konfigurieren Sie den Kernel wie im Firmware-Abschnitt des Radeon Artikels beschrieben:

KERNEL AMD/ATI Radeon settings
## (Setup the kernel to use the radeon-ucode firmware)
Device Drivers --->
   Generic Driver Options --->
   [*]  Include in-kernel firmware blobs in kernel binary
  ## # ATI card specific, (see Radeon page for details which firmware files to include)
   (radeon/<CARD-MODEL>.bin ...)
  ## # Specify the root directory
   (/lib/firmware/) External firmware blobs to build into the kernel binary
 
## (Enable Radeon KMS support)
Device Drivers --->
   Graphics support --->
   <M/*>    ATI Radeon
   [*]      Enable modesetting on radeon by default
   [ ]      Enable userspace modesetting on radeon (DEPRECATED)
KERNEL AMDGPU settings
## (Setup the kernel to use the amdgpu firmware)
Device Drivers --->
   Generic Driver Options --->
   [*]  Include in-kernel firmware blobs in kernel binary
  ## # AMD card specific, (see AMDGPU page for details which firmware files to include)
   (amdgpu/<CARD-MODEL>.bin ...)
  ## # Specify the root directory
   (/lib/firmware/) External firmware blobs to build into the kernel binary
 
## (Enable Radeon KMS support)
Device Drivers --->
   Graphics support --->
   <M/*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
   <M/*> AMD GPU
         [ /*] Enable amdgpu support for SI parts
         [ /*] Enable amdgpu support for CIK parts 
         [*]   Enable AMD powerplay component  
         ACP (Audio CoProcessor) Configuration  ---> 
             [*] Enable AMD Audio CoProcessor IP support (CONFIG_DRM_AMD_ACP)
         Display Engine Configuration  --->
             [*] AMD DC - Enable new display engine
             [ /*] DC support for Polaris and older ASICs
             [ /*] AMD FBC - Enable Frame Buffer Compression
             [ /*] DCN 1.0 Raven family
   <M/*> HSA kernel driver for AMD GPU devices
Notiz
Old Radeon cards (X1900 series and older) do not need extra firmware or any firmware configuration. For them simply enable the Direct Rendering Manager (DRM) and ATI Radeon modesetting.
Notiz
Linux kernel >= 3.9 does not have the Enable modesetting on radeon by default since it is already implied by default. Do not be alarmed if you find this option missing in new kernels.
Notiz
Linux kernel >= 4.15 does include Display Core (DC) which is required for AMDGPU to work. This newer driver was written for GCN5.0 Vega and DCN1.0 Raven Ridge (APU), but also adds additional functionality for older Radeon graphics cards starting with GCN1.1 Southern Islands and newer. It is planned to make this additional support for older Radeon cards the standard, so do not be alarmed if you find this option missing in newer kernels.

Exit the kernel configuration, rebuild the kernel, and reboot.

Now that KMS has been set up, continue preparing /etc/portage/make.conf in the next section.

make.conf

Now that the kernel is prepared, two important variables in the /etc/portage/make.conf file must be configured before installing Xorg.

The first variable is VIDEO_CARDS. This is used to set the video drivers that you intend to use and is usually based on the kind of video card you have. The most common settings are nouveau for nVidia cards or radeon for ATI cards. Both have actively developed, well-supported open-source drivers. If you have a newer AMD video card (Southern Islands and up), you may also try the new open-source amdgpu driver. See the AMDGPU article for more details.

Notiz
Sie können ebenfalls die proprietären Treiber von nVidia und AMD/ATI, nvidia bzw. fglrx versuchen. Die Einrichtung der proprietären Treiber ist allerdings abseits des Fokus dieser Anleitung. Bitte lesen Sie den Gentoo Linux nVidia Leitfaden und die Gentoo Linux ATI FAQ. Wenn Sie nicht wissen für welchen Treiber Sie sich entscheiden sollen, schauen Sie sich diese Anleitungen an, um weitere Informationen zu erhalten.

Der intel Treiber kann für Desktop-PCs und Laptops mit gewöhnlichen integrierten Grafik-Chipsätzen von Intel verwendet werden.

Notiz
The VIDEO_CARDS variable may contain more than one value as long as each value is separated by a space.

The second variable is INPUT_DEVICES and is used to determine which drivers are to be built for input devices.

make.defaults has Libinput as the default input device driver.

To check what is presently activated, run:

user $portageq envvar INPUT_DEVICES

In case alternative input devices, such as a Synaptics touchpad for a laptop are needed, be sure to add them to INPUT_DEVICES the /etc/portage/make.conf file:

CODE make.conf Beispieleinträge
## (Für Maus, Tastatur und Synaptics Touchpad Unterstützung)
INPUT_DEVICES="evdev synaptics"
## (Für nVidia Karten)
VIDEO_CARDS="nouveau"
## (Für AMD/ATI Karten)
VIDEO_CARDS="radeon"

Wenn die vorgeschlagen Einstellungen nicht funktionieren, emergen Sie das Paket x11-base/xorg-drivers (siehe die Schritte unterhalb). Prüfen Sie alle verfügbaren Optionen und wählen Sie jene, die auf das System zutreffen. Dieses Beispiel ist auf ein System mit Keyboard, Maus, Synaptics Touchpad und Radeon Grafikkarte zugeschnitten.

root #emerge --ask --verbose x11-base/xorg-drivers
 
These are the packages that would be merged, in order:
 
Calculating dependencies... done!
[ebuild   R   ]  x11-base/xorg-drivers-1.9  INPUT_DEVICES="evdev synaptics
-acecad -aiptek -elographics% -fpit% -joystick -keyboard -mouse -penmount -tslib
-virtualbox -vmmouse -void -wacom"
VIDEO_CARDS="radeon -apm -ark -ast -chips -cirrus -dummy -epson -fbdev -fglrx
(-geode) -glint -i128 (-i740) (-impact) -intel -mach64 -mga -neomagic (-newport)
-nouveau -nv -nvidia -r128 -rendition -s3 -s3virge -savage -siliconmotion -sis
-sisusb (-sunbw2) (-suncg14) (-suncg3) (-suncg6) (-sunffb) (-sunleo) (-suntcx)
-tdfx -tga -trident -tseng -v4l -vesa -via -virtualbox -vmware (-voodoo) (-xgi)"
0 kB

Nach dem Setzen aller notwendiger Variablen kann Xorg installiert werden:

root #emerge --ask x11-base/xorg-server
Notiz
The x11-base/xorg-x11 meta-package could be installed instead of the more lightweight x11-base/xorg-server. Functionally x11-base/xorg-x11 and x11-base/xorg-server are the same, however x11-base/xorg-x11 brings in many more packages that most systems will probably not require. Additional packages include a large assortment of fonts in many languages. They are not necessary for a working X11 framework.

Wenn die Installation abgeschlossen ist, brauchen einige Umgebungsvariablen eine Reinitialisierung bevor es weiter geht. Lesen Sie das Profil mit diesem Befehl neu ein:

root #env-update
root #source /etc/profile

NVidia Benutzer

For NVidia users it might be beneficial to run nvidia-xconfig in order to generate a working xorg.conf file for the selected graphics card. Without this step the xorg.conf file will need to be created manually as described below. Missing the xorg.conf will sometimes generate a "No screens found" error to the terminal when attempting to startx.

Also the NVidia driver will only work after a reboot, so be sure to restart the system after running nvidia-xconfig.

root #nvidia-xconfig

Es ist möglich und empfehlenswert den OpenGL Renderer auf den Hardware-Renderer anstelle eines Software-Renderer einzustellen:

root #eselect opengl set nvidia

Konfiguration

The X server is designed to work out-of-the-box, with no need to manually edit Xorg's configuration files. It should detect and configure devices such as displays, keyboards, and mice.

Versuchen Sie startx ohne Bearbeitung einer Konfigurationsdatei zu benutzen. Wenn Xorg nicht startet oder es ein anderes Problem gibt, dann müssen Sie eine manuelle Konfiguration von Xorg vornehmen. Dies wird im folgenden Abschnitt erklärt.

Notiz
If changes have been made to the kernel, do not forget to restart the system before using startx in order to be using the newly built kernel. If the kernel was updated to a newer version in the process this will most likely require the bootloader's configuration files to be updated as well.

Das Verzeichnis xorg.conf.d

Wichtig
Configuring files in xorg.conf.d should be seen as a last resort option. If possible it is desirable to run Xorg without any special configuration.

Most of the configuration files for Xorg are stored in /etc/X11/xorg.conf.d/. Each file is given a unique name and ends in .conf. The file names in Xorg's configuration directory will be read in alpha numeric order. For example, 10-evdev.conf will be read before 20-synaptics.conf; a-evdev.conf will be read before b-synaptics.conf, and so on. The files in this directory are not required to be numbered, but doing so will help to keep them organized. Organization is helpful when debugging faulty configuration files.

Notiz
Xorg provides example configurations in /usr/share/doc/xorg-server-${version}/xorg.conf.example.bz2. These can be used to create custom configuration files in /etc/X11/xorg.conf.d/. The examples are heavily commented, but if more documentation regarding the syntax is needed, man xorg.conf is always available. Other examples can be found in the section Other resources at the end of this guide.

startx benutzen

Try startx to start up the X server. startx is a script (it's installed by x11-apps/xinit) that executes an X session; that is, it starts the X server and some graphical applications on top of it. It decides which applications to run using the following logic:

  • Wenn eine Datei mit dem Namen .xinitrc im Home-Verzeichnis existiert, wird es die hier aufgeführten Befehle ausführen.
  • Otherwise, it will read the value of the XSESSION variable from the /etc/env.d/90xsession file and execute the relevant session accordingly. Values for XSESSION are available in /etc/X11/Sessions/. To set a system wide default session run:
root #echo XSESSION="Xfce4" > /etc/env.d/90xsession
This will create the 90xsession file and set the default X session to Xfce. Remember to run env-update after making changes to 90xsession.
user $startx

Wenn kein Window Manager installiert ist, wird ein durchgängig schwarzer Bildschirm erscheinen. Weil dies ebenso ein Zeichen dafür sein kann, dass etwas nicht stimmt, können die Pakete x11-wm/twm und x11-terms/xterm dafür installiert werden um X zu testen.

Once the programs are installed, run startx again. A few xterm windows should appear, making it easy to verify the X server is working correctly. Once satisfied with the results, unmerge x11-wm/twm and x11-terms/xterm if installed in the step above to remove the testing packages. They will not be needed to setup a proper desktop environment.

The session (program to start) could also be given as an argument to startx:

user $startx /usr/bin/startfluxbox

You can also pass X11 server options, by preceding them with a double dash:

user $startx -- vt7

X Einstellungen optimieren

Bildschirmauflösung einstellen

If the screen resolution looks to be wrong, you will need to check two sections in your xorg.conf.d configuration. First of all, you have the Screen section which lists the resolutions that your X server will run at. This section might not list any resolutions at all. If this is the case, Xorg will estimate the resolutions based on the information in the second section, Monitor.

Now let us change the resolution. In the next example from /etc/X11/xorg.conf.d/40-monitor.conf we add the PreferredMode line so that our X server starts at 1440x900 by default. The Option in the Device section must match the name of your monitor (DVI-0), which can be obtained by running xrandr. Install xrandr (emerge xrandr) just long enough to get this information. The argument after the monitor name (in the Device section) must match the Identifier in the Monitor section.

root #nano -w /etc/X11/xorg.conf.d/40-monitor.conf
Section "Device"
  Identifier  "RadeonHD 4550"
  Option      "Monitor-DVI-0" "DVI screen"
EndSection
Section "Monitor"
  Identifier  "DVI screen"
  Option      "PreferredMode" "1440x900"
EndSection

Run X (startx) to discover it uses the desired resolution.

Mehrere Monitore

More than one monitor in can be established in /etc/X11/xorg.conf.d/. Give each monitor a unique identifier, then list its physical position, such as "RightOf" or "Above" another monitor. The following example shows how to configure a DVI and a VGA monitor, with the VGA monitor as the right-hand screen:

root #nano -w /etc/X11/xorg.conf.d/40-monitor.conf
Section "Device"
  Identifier "RadeonHD 4550"
  Option     "Monitor-DVI-0" "DVI screen"
  Option     "Monitor-VGA-0" "VGA screen"
EndSection
Section "Monitor"
  Identifier "DVI screen"
EndSection
Section "Monitor"
  Identifier "VGA screen"
  Option     "RightOf" "DVI screen"
EndSection

Tastatur konfigurieren

To setup X to use an international keyboard create the appropriate config file in /etc/X11/xorg.conf.d/. This example features a Czech keyboard layout:

root #nano -w /etc/X11/xorg.conf.d/30-keyboard.conf
Section "InputClass"
        Identifier "keyboard-all"
        Driver "evdev"
        Option "XkbLayout" "us,cz"
        Option "XkbModel" "logitech_g15"
        Option "XkbRules" "xorg"
        Option "XkbOptions" "grp:alt_shift_toggle,grp:switch,grp_led:scroll,compose:rwin,terminate:ctrl_alt_bksp"
        Option "XkbVariant" ",qwerty"
        MatchIsKeyboard "on"
EndSection

For methods of switching the keyboard layout see the Keyboard layout switching article.

Der "terminate" Befehl (terminate:ctrl_alt_bksp) erlaubt es den Benutzern die X Sitzung durch die Tastenkombination Ctrl+Alt+Backspace zu beenden. Allerdings beendet dies X schmachvoll -- etwas das der Nutzer möglicherweise vermeiden möchte. Es kann sinnvoll sein, wenn Programme den Bildschirm komplett eingefroren haben, oder beim Konfigurieren und Optimieren der Xorg Umgebung. Seien Sie jedoch vorsichtig beim Beenden der Desktop-Umgebung mit dieser Tastenkombination. Den meisten Programmen gefällt es nicht, auf diese Weise beendet zu werden. Einige, wenn nicht sogar alle Informationen die noch nicht auf die Festplatte geschrieben wurden sind verloren (die in "offenen Dokumenten" abgelegten Informationen).

Fertigstellung

Run startx and be happy about the result. Congratulations, you now (hopefully) have a working Xorg! The next step is to install a useful window manager or desktop environment such as KDE, GNOME, or Xfce. Information on installing these desktop environments can be found here on the wiki.

Siehe auch

Externe Ressourcen

Konfigurationsdateien erstellen und bearbeiten

man xorg.conf and man evdev provide quick yet complete references about the syntax used by these configuration files. Be sure to have them open on a terminal when editing Xorg configuration files!

Es gibt ebenfalls viele Online-Ressourcen über die Bearbeitung von Konfigurationsdateien in /etc/X11/. Nur wenige sind hier aufgeführt. Verwenden Sie eine Auswahl Ihrer Lieblingssuchmaschinen um weitere zu finden.

Weitere Hilfsmittel

More information about installing and configuring various graphical desktop environments and applications can be found in the section of our documentation.

When upgrading to xorg-server 1.9 or higher, be sure to read the migration guide.

X.org bietet viele FAQs auf ihrer Webseite, zusätzlich zu ihrer anderen Dokumentation.


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Sven Vermeulen (SwifT), Joshua Saddler (nightmorph)
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.