Xorg: Difference between revisions

From Alpine Linux
(Add installation and start session sections)
(added troubelshooting section with clarity on video drivers and links)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[https://www.x.org/wiki/ Xorg] is an open source implementation of the X Window System. It used to be the de-facto standard way to launch graphical applications. [[Wayland]] is its recent alternative. [https://gitlab.freedesktop.org/wayback/wayback Wayback] is a X11 compatibility layer which allows for running full X11 desktop environments using Wayland components.
Xorg is a x.org implementation of X window system.
It is de-facto standard way to launch graphical applications.
Its most popular alternative is [https://wiki.alpinelinux.org/wiki/Wayland Wayland]


== Installation ==
== Installation ==


Can be installed automatically with [https://wiki.alpinelinux.org/wiki/Alpine_setup_scripts#setup-xorg-base setup-xorg-base]
Xorg can be installed automatically by running the [[Alpine_setup_scripts#setup-xorg-base|setup-xorg-base]] script as follows:{{Cmd|# setup-xorg-base}}
 
{{Note|ensure you have the necessary video drivers}}
 
== Start session ==


Xorg can be started via [https://wiki.alpinelinux.org/wiki/Display_manager display manager]
The above command installs the following packages {{pkg|xorg-server}}, {{pkg|xf86-input-libinput}}, {{pkg|xinit}}, {{pkg|eudev}}, {{pkg|mesa-dri-gallium}} and Sets up [[Include:Setup Device Manager|eudev]]
or manually with command:
{{Cmd|# startx }}


{{Note| startx is intended to run as user.}}
Install atleast one X11 based [[Desktop environments and Window managers|desktop]] before proceeding further.


You may also want per-user configuration:
== Configuration ==
{{Cmd|# cp /etc/X11/xinit/xinitrc ~/.xinitrc}}


{{Warning| carefully read the default configuration, it may look for itself to execute,
You may also want per-user configuration. Create the {{Path|~/.xinitrc}} file to start the window manager with <code>startx</code> or <code>xinit</code>. If you installed {{pkg|cwm}} desktop, the {{Path|~/.xinitrc}} file should be as follows:{{Cat|~/.xinitrc|exec cwm}}
which causes terminal to hang!
}}


== Video Drivers ==
If [[D-Bus#Installation|D-Bus]] is installed and enabled along with {{pkg|cwm}} desktop, the {{Path|~/.xinitrc}} file should be as follows:{{Cat|~/.xinitrc|exec dbus-launch --exit-with-session cwm}}
{{Main|Graphics driver}}


To install X11 based [[Desktop environments and Window managers|desktop]], you may want to install specific Xorg xf86 driver packages for your video card's chipset, as they may support specific features, effects and acceleration modes, and avoid error messages during X initialization. However, the most basic X features should work fine with just using the default kernel video-modesetting drivers.
Xorg sessions can be started via [[Display_manager|display manager]] or manually with command: {{Cmd|$ startx }}


{{Tip| xf86 driver packages follow standard naming conventions. So information found in  [https://wiki.archlinux.org/title/Xorg#Driver_installation ArchWiki], or [https://packages.gentoo.org/categories/x11-drivers Gentoo wiki] are to a large degree, also applicable to configuring the video hardware on Alpine Linux, except for proprietary drivers which are not available.}}
== Video drivers ==


To see available xf86 video driver packages run:
Most basic X features should work fine with just using the default [[#Kernel Modesetting|kernel video-modesetting]] drivers.
{{cmd|$ apk search xf86-video}}


* For Sis video chipset install {{pkg|xf86-video-sis}}
For better performance, you may want to choose appropriate drivers for your hardware. For legacy driver support or in case of errors, refer to [[Xf86 Video]] page or Graphics driver|graphics drivers]] page for current video drivers.  
* For VMware guests use {{pkg|xf86-video-vmware}}
* For VirtualBox guests use {{pkg|xf86-video-vboxvideo}}. Refer [[VirtualBox_guest_additions|VirtualBox guest additions]]
* For Hyper-V guests use {{pkg|xf86-video-fbdev}}. Refer [[Hyper-V_guest_services|Hyper-V guest services]].
* For KVM/QEMU guests refer [[QEMU#Using_Xorg_inside_Qemu|Xorg within QEMU]]


== Input packages ==
== Input packages ==


If the <b>Numlock</b> settings are not working, or getting <b>'setleds not found'</b> errors:
You probably at least want {{pkg|xf86-input-libinput}} or {{pkg|xf86-input-evdev}}. The former is for Wayland with wrapper for Xorg and is installed by the [[#Installation|setup-xorg-base]] script. The {{pkg|xf86-input-evdev}} package is Xorg only.


{{cmd|# apk add kbd}}
For touchpad tapping support on many laptops:{{Cmd|# apk add xf86-input-synaptics}}


If some input device is not working at all, the available xf86-input drivers can be listed with:
If the <b>Numlock</b> settings are not working, or getting <b>'setleds not found'</b> errors: {{cmd|# apk add kbd}}
{{cmd|$ apk search xf86-input}}


You probably at least want {{cmd| xf86-input-libinput}} or {{cmd| xf86-input-evdev}}  
If some input device is not working at all, the available xf86-input drivers can be listed with: {{cmd|$ apk search xf86-input}}


libinput is for Wayland with wrapper for Xorg. evdev is Xorg only.<br><br>
The following legacy drivers are not packaged at least as of 2/2022:
* xf86-input-mouse
* xf86-input-keyboard


Typical legacy drivers (not packaged. at least as of 2/2022):
== Configure xorg-server (optional) ==
 
{{cmd|# apk add xf86-input-mouse xf86-input-keyboard}}
 
And for touchpad tapping support on many laptops, also:


{{Cmd|# apk add xf86-input-synaptics}}
On most systems, xorg should be able to autodetect all devices. However you can still configure xorg-server by hand by launching: {{Cmd|# Xorg -configure}}


== Configure xorg-server (optional) ==
This will create a {{Path|/root/xorg.conf.new}} file. You can modify this file to fit your needs. When finished modifying and testing the above configuration file, move it to {{Path|/etc/X11/xorg.conf}} for normal usage.
 
On most systems, xorg should be able to autodetect all devices. However you can still configure xorg-server by hand by launching:
{{Cmd|# Xorg -configure}}
This will create a {{Path|/root/xorg.conf.new}} file. You can modify this file to fit your needs.<BR>
(When finished modifying and testing the above configuration file, move it to {{Path|/etc/X11/xorg.conf}} for normal usage.)


== Keyboard Layout (optional) ==
== Keyboard Layout (optional) ==


If you use a keyboard layout different than "us", and you are using a window manager or desktop environment that does not support to configure the keyboard layout itself, then you need to
If you use a keyboard layout different than "us", and you are using a window manager or desktop environment that does not support to configure the keyboard layout itself, then you need to install {{pkg|setxkbmap}} package: {{Cmd|# apk add setxkbmap}}
 
* [[Repositories#Enabling_the_community_repository|Enable the "community" repository]]
 
and install setxkbmap:
 
{{Cmd|# apk add setxkbmap}}
 
Then try
{{Cmd|# setxkbmap <%a language layout from /usr/share/X11/xkb/rules/xorg.lst%>}}


Then try {{Cmd|# setxkbmap <%a language layout from /usr/share/X11/xkb/rules/xorg.lst%>}}


In order to make it persistent add this section to {{Path|/etc/X11/xorg.conf}}:
In order to make it persistent add this section to {{Path|/etc/X11/xorg.conf}}:
Line 91: Line 57:
}}
}}


Another way to change the keymap when logging into X is to use {{Path|~/.xinitrc}}. The following example loads a British keymap, simply add this line to the beginning of the file:
Another way to change the keymap when logging into X is to use {{Path|~/.xinitrc}}. The following example loads a British keymap, simply add this line to the beginning of the file as follows :{{Cat|~/.xinitrc|setxkbmap gb &
<code>setxkbmap gb &</code>
...}}
 
== Troubleshooting ==
 
If the <b>Numlock</b> settings are not working, or getting <b>'setleds not found'</b> errors, refer to [[#Input packages|Input packages]] section above.


If some input device is not working at all, refer to [[#Input packages|Input packages]] section above for various options to resolve this.


If you need to create the {{Path|~/.xinitrc}} file, you may also want to add a second line like <code>exec openbox-session</code> to still start the window manager with <code>startx</code> or <code>xinit</code>.
In case of errors, refer to [[Xf86 Video]] page for legacy video hardware driver support  or [[Graphics driver|graphics drivers]] page for current video drivers.  


<br>
== See also ==


[[category:Graphics]]
* [[Xf86 Video]]
[[category: Drivers]]
* [https://www.x.org/wiki/ Xorg Wiki]
* [[Wayland]]
* [[Kodi]]
[[category: Desktop]]
[[category: Desktop]]

Latest revision as of 02:57, 4 May 2026

Xorg is an open source implementation of the X Window System. It used to be the de-facto standard way to launch graphical applications. Wayland is its recent alternative. Wayback is a X11 compatibility layer which allows for running full X11 desktop environments using Wayland components.

Installation

Xorg can be installed automatically by running the setup-xorg-base script as follows:

# setup-xorg-base

The above command installs the following packages xorg-server, xf86-input-libinput, xinit, eudev, mesa-dri-gallium and Sets up eudev

Install atleast one X11 based desktop before proceeding further.

Configuration

You may also want per-user configuration. Create the ~/.xinitrc file to start the window manager with startx or xinit. If you installed cwm desktop, the ~/.xinitrc file should be as follows:

Contents of ~/.xinitrc

exec cwm

If D-Bus is installed and enabled along with cwm desktop, the ~/.xinitrc file should be as follows:

Contents of ~/.xinitrc

exec dbus-launch --exit-with-session cwm

Xorg sessions can be started via display manager or manually with command:

$ startx

Video drivers

Most basic X features should work fine with just using the default kernel video-modesetting drivers.

For better performance, you may want to choose appropriate drivers for your hardware. For legacy driver support or in case of errors, refer to Xf86 Video page or Graphics driver|graphics drivers]] page for current video drivers.

Input packages

You probably at least want xf86-input-libinput or xf86-input-evdev. The former is for Wayland with wrapper for Xorg and is installed by the setup-xorg-base script. The xf86-input-evdev package is Xorg only.

For touchpad tapping support on many laptops:

# apk add xf86-input-synaptics

If the Numlock settings are not working, or getting 'setleds not found' errors:

# apk add kbd

If some input device is not working at all, the available xf86-input drivers can be listed with:

$ apk search xf86-input

The following legacy drivers are not packaged at least as of 2/2022:

  • xf86-input-mouse
  • xf86-input-keyboard

Configure xorg-server (optional)

On most systems, xorg should be able to autodetect all devices. However you can still configure xorg-server by hand by launching:

# Xorg -configure

This will create a /root/xorg.conf.new file. You can modify this file to fit your needs. When finished modifying and testing the above configuration file, move it to /etc/X11/xorg.conf for normal usage.

Keyboard Layout (optional)

If you use a keyboard layout different than "us", and you are using a window manager or desktop environment that does not support to configure the keyboard layout itself, then you need to install setxkbmap package:

# apk add setxkbmap

Then try

# setxkbmap <%a language layout from /usr/share/X11/xkb/rules/xorg.lst%>

In order to make it persistent add this section to /etc/X11/xorg.conf:

Section "InputClass" Identifier "Keyboard Default" MatchIsKeyboard "yes" Option "XkbLayout" "<%a language layout from /usr/share/X11/xkb/rules/xorg.lst%>" EndSection

Another way to change the keymap when logging into X is to use ~/.xinitrc. The following example loads a British keymap, simply add this line to the beginning of the file as follows :

Contents of ~/.xinitrc

setxkbmap gb & ...

Troubleshooting

If the Numlock settings are not working, or getting 'setleds not found' errors, refer to Input packages section above.

If some input device is not working at all, refer to Input packages section above for various options to resolve this.

In case of errors, refer to Xf86 Video page for legacy video hardware driver support or graphics drivers page for current video drivers.

See also