KMSCON(1)

NAME
kmscon - KMS/DRM based System Console

SYNOPSIS

kmscon [OPTIONS...]

kmscon -l [OPTIONS...] -- /bin/login [/bin/login-OPTIONS...]

DESCRIPTION

KMSCON is a KMS/DRM-based system console with an integrated terminal emulator for Linux operating systems. It was designed as a replacement for the Linux kernel console and virtual terminals.

When run in default mode, KMSCON allocates a virtual terminal and provides a terminal emulator on it. It can thus be used as replacement for the Linux console and agetty(1) on virtual terminals. Compared to the Linux console, KMSCON provides a rich set of enhanced features including full internationalized keyboard support, full UTF-8 input/font support, hardware-accelerated rendering, multi-seat support and more.

When run in listener mode, KMSCON watches the system for new seats and automatically provides a system console on it.

OPTIONS

Boolean options take no arguments. If the default value is true, then you can disable the option by prefixing it with no-.

General Options:

-h, --help
    Print a short help text and exit.

-v, --verbose
    Be more verbose. (default: off)

--debug
    Print debug messages. Works only if KMSCON was compiled with debug mode enabled. (default: off)

--silent
    Suppress notices and warnings. (default: off)

--configdir {/path/to/config/dir/}
    Specify path to config directory. (default: /etc/kmscon)

--listen
    Run KMSCON in listen-mode. See section below for more information. (default: off)

Seat Options:

--vt {/path/to/vt|ttyX|X}
    Use this VT. The argument is either the full path `/dev/ttyX', the device name `ttyX' or just the tty number. If not specified, KMSCON tries to find a VT by itself. On seats without VTs, KMSCON simply activates itself automatically without using any VT. Please note that you cannot use this option if KMSCON runs on multiple seats (see --seats). To avoid this, specify this option in a seat configuration /etc/kmscon/{seat}.kmscon.conf.

    You must not run multiple applications on a single VT, otherwise, you might get an unresponsive system. Also note, by default, KMSCON tries to use it's controlling terminal as VT and if that fails, it tries to allocate a new unused VT.

--switchvt
    If KMSCON is started on a VT that is currently not active, this option makes KMSCON activate this VT during startup. The same way, during shutdown KMSCON will reactivate the VT that was previously active. (default: on)

--seats {list,of,seats}
    List of seats KMSCON will run on. Use `all' to make KMSCON run on all seats. Use `all,' to make KMSCON run on a seat called `all' (empty entries are ignored). Use `current' to make kmscon run on the current seat. (default: current)

    If KMSCON runs on multiple seats, all seats are independent of each other. You can either run a different KMSCON process on each seat or make a single KMSCON process run on multiple seats. In the latter case, global state can be shared to reduce memory consumption (like glyph-caches).

Session Options:

--session-max {num}
    Change the maximum number of sessions that are allowed on each seat. Use '0' for no limit. (default: 50)

--session-control
    Allow keyboard-shortcuts to control the session manager. This allows the use to create new sessions, kill sessions and switch sessions via keyboard input. (default: off)

--terminal-session
    Start a terminal session after setup is done. (default: on)

Terminal Options:

-l, --login
    Specify the application that is started on new terminal sessions. This takes no argument but instead everything left after all options have been parsed is used as argument to this option. Note that nothing after two dashes -- is parsed as regular option by kmscon. (default: /bin/login -p)

    If this option is specified in the configuration file, the argument is split into words using the rules of the POSIX shell. It is possible to include whitespace in arguments by enclosing the argument in double or single quotes or by prepending it with a backslash.

    This example starts '/bin/bash -i' on each new terminal session: ./kmscon --login --debug --no-switchvt -- /bin/bash -i

-t {term}, --term {term}
    Specify the $TERM environment variable that is set on new terminal sessions. (default: xterm-256color)

--reset-env
    Reset environment before spawning the child process. (default: on)

--sb-size {size}
    Specify the size of the scrollback buffer (in lines). (default: 1000)

Input Options:

--xkb-model {model}
    Specify the keyboard (xkb) model. This should normally not be changed. (default: {xkb default})

--xkb-layout {layout}
    Specify the keyboard (xkb) layout. (default: {xkb default})

    German keyboard example: --xkb-layout=de

--xkb-variant {variant}
    Speicfy the keyboard (xkb) variant. (default: {xkb default})

--xkb-options {options}
    Specify other keyboard (xkb) options. (default: {xkb default})

--xkb-keymap {file}
    Path to a single predefined keymap file. This takes precedence over the above options. An empty path "" is interpreted as not using a keymap. (default: not used)

--xkb-compose-file {file}
    Path to a single predefined compose file. An empty path "" is interpreted as using the default compose file. The default compose file search order is described in Compose(5). The locale is determined from the first of LC_ALL, LC_CTYPE, or LANG that's set to a non-empty value. If the locale cannot be determined, C is assumed. If no compose file is found, composing is disabled. (default: search the compose file corresponding to the current locale)

--xkb-repeat-delay {delay}
    Delay after key was pressed until key-repeat starts (in milliseconds). (default: 250)

--xkb-repeat-rate {rate}
    Time between two key repeats (in milliseconds). (default: 50)

--mouse
    Enable mouse/touchpad/trackpoint in kmscon (default: off). It allows to select, and copy/paste text with a pointing device, and also to scroll with the mouse wheel. It's still experimental, and may not work with specific devices.

Grabs / Keyboard Shortcuts:

All keyboard shortcuts (here: grabs) in KMSCON can be modified with these options. The argument to such an option is a list of comma-separated keyboard shortcuts that should trigger the specified action.

To disable a shortcut, pass an empty argument (empty list). A keyboard shortcut consists of a list of modifiers followed by a single key. All modifiers must be down when the key is pressed for the shortcut to be detected. A modifier is surrounded by '<' and '>' (like '<shift>'). A key is the name of a keysym (like 'a' or 'Return'). Keysyms are case-sensitive and KMSCON will suggest a keysym name if you entered a wrong case. However, KMSCON can not always guess the right case as lower-case-only keysyms are ambiguous.

If a key generates multiple keysyms in your keyboard layout, you can match these keys by concatenating the keysyms with a '+' (like 'H+E+L+L+O'). This does not mean that all the listed keys must be pressed! It's rather a way to match multi-keysym keys.

Valid modifiers: Shift, Control/Ctrl, Alt, Logo (Windows/Apple key).

--grab-scroll-up {grab}
    Scroll up in scrollback buffer by one line. (default: <Shift>Up)

--grab-scroll-down {grab}
    Scroll down in scrollback buffer by one line. (default: <Shift>Down)

--grab-page-up {grab}
    Scroll up in scrollback buffer by one page. (default: <Shift>Prior/PageUp)

--grab-page-down {grab}
    Scroll down in scrollback buffer by one page. (default: <Shift>Next/PageDown)

--grab-zoom-in {grab}
    Increase font size of the current terminal. (default: <Ctrl>plus)

--grab-zoom-out {grab}
    Decrease font size of the current terminal. (default: <Ctrl>minus)

--grab-session-next {grab}
    Switch to the next session. (default: <Ctrl><Logo>Right)

--grab-session-prev {grab}
    Switch to the previous session. (default: <Ctrl><Logo>Left)

--grab-session-dummy {grab}
    Switch to a dummy session (blank screen). (default: <Ctrl><Logo>Escape)

--grab-session-close {grab}
    Press twice to close the current session. (default: <Ctrl><Logo>BackSpace)

--grab-terminal-new {grab}
    Create new terminal session next to current session. (default: <Ctrl><Logo>Return)

--grab-rotate-cw {grab}
    Rotate output clock-wise: Normal -> Right -> Inverted -> Left and so on. (default: <Logo>Plus)

--grab-rotate-ccw {grab}
    Rotate output counter-clock-wise: Normal -> Left -> Inverted -> Right and so on. (default: <Logo>Minus)

Video Options:

--drm
    Use DRM (direct rendering manager) devices (usually GPUs) as display devices. fbdev (framebuffer) devices are always used, but DRM devices are only used if this option is enabled. (default: on)

--hwaccel
    Use 3D hardware acceleration. On newer hardware, this can speed up rendering by multiple orders of magnitude. However, on older hardware this might slow down rendering speed. (default: off)

    Note: This option should be enabled in conjunction with --drm

--gpus {all,aux,primary}
    Specify which GPU(s) could be used for terminal output. If `all' is specified, then all GPUs found are used. If `aux' is specified, then both primary and auxiliary GPUs are used. If `primary' is specified, then only primary GPUs are used. (default: all)

    Note: Primary GPUs are the default GPU on a seat. There is always only one primary GPU on a seat. Auxiliary GPUs are hot- pluggable GPUs that provide additional independent displays.

--render-engine {engine}
    Specify console the rendering engine. Available engines are `bbulk', and `gltex'. (default: detect by GPU type)

--use-original-mode
    Use original KMS mode to prevent modesetting. (default: on)

    This option is incompatible with --mode.

--mode {width}x{height}
    Set the desired output mode. The given width and height must match a supported more exactly for this option to have any effect; if there is no supported mode that matches exactly, or if there is an error when using the desired mode, then the default mode (first valid mode found) will be used.

    --use-original-mode must be disabled in order to use this option.

    Modesetting is only supported in DRM mode, so this option does nothing with fbdev. However, fbset can still be used to externally set the mode when fbdev is in use.

    Other system components may need configuration in order to use the desired mode effectively. For example, the `video={width}x{height}` kernel parameter may be required in order to ensure that there is enough memory to store the framebuffers for a large resolution.

--rotate {orientation}
    Select the desired orientation of the output. Available orientations are 'normal' meaning output is not rotated, 'right' meaning output is rotated 90° clock-wise, 'upside-down' meaning output is rotated 180° clock-wise and 'left' meaning output is rotated 90° counter clock-wise. This has only effect for the 'gltex' render-engine. (default: 'normal')

Font Options:

--font-engine {engine}
    Specify the font rendering engine. Available engines are `pango', `unifont', and `8x16'. (default: pango)

--font-size {points}
    Font size in points (pt). (default: 12)

--font-name {name}
    Name of the font to be used, note that Fontconfig fallback may be used if the `pango' font rendering engine is specified. (default: monospace)

--font-dpi {dpi}
    DPI (dots-per-inch) used for font-rendering. Per monitor DPI values override this global default. (default: 96)

Palette Options:

--palette {name}
    Specify the default color palette. Specify custom to make use of the color palette from the following options.

In the following options, colors are specified in RGB color value, written in three comma-separated integers between 0 and 255 inclusive.

--palette-black {color}
    Specify the black color in the custom palette to color. (default: 0, 0, 0)

--palette-red {color}
    Specify the red color in the custom palette to color. (default: 205, 0, 0)

--palette-green {color}
    Specify the green color in the custom palette to color. (default: 0, 205, 0)

--palette-yellow {color}
    Specify the yellow color in the custom palette to color. (default: 205, 205, 0)

--palette-blue {color}
    Specify the blue color in the custom palette to color. (default: 0, 0, 238)

--palette-magenta {color}
    Specify the magenta color in the custom palette to color. (default: 205, 0, 205)

--palette-cyan {color}
    Specify the cyan color in the custom palette to color. (default: 0, 205, 205)

--palette-light-grey {color}
    Specify the light grey color in the custom palette to color. (default: 229, 229, 229)

--palette-dark-grey {color}
    Specify the dark grey color in the custom palette to color. (default: 127, 127, 127)

--palette-light-red {color}
    Specify the light red color in the custom palette to color. (default: 255, 0, 0)

--palette-light-green {color}
    Specify the light green color in the custom palette to color. (default: 0, 255, 0)

--palette-light-yellow {color}
    Specify the light yellow color in the custom palette to color. (default: 255, 255, 0)

--palette-light-blue {color}
    Specify the light blue color in the custom palette to color. (default: 92, 92, 255)

--palette-light-magenta {color}
    Specify the light magenta color in the custom palette to color. (default: 255, 0, 255)

--palette-light-cyan {color}
    Specify the light cyan color in the custom palette to color. (default: 0, 255, 255)

--palette-white {color}
    Specify the white color in the custom palette to color. (default: 255, 255, 255)

--palette-foreground {color}
    Specify the default foreground color in the custom palette to color. (default: 229, 229, 229)

--palette-background {color}
    Specify the default background color in the custom palette to color. (default: 0, 0, 0)

CONFIGURATION

The default configuration directory is /etc/kmscon and the main configuration file is named /etc/kmscon/kmscon.conf. You can provide an additional configuration file for each seat via /etc/kmscon/{seatname}.kmscon.conf. Any command-line option that can be passed to KMSCON can also be put into those configuration files. For example:

          font-name=Meslo LG M
          font-size=14
          login=/bin/bash -i
          palette-foreground=255, 0, 0

Command-line options override configuration file options. And per-seat configuration files override the global configuration file.

DEFAULT MODE

In default mode, KMSCON acts as a replacement for agetty(1). KMSCON opens a virtual terminal and provides a system console on it. It replaces the linux-console on this VT. You can select the virtual terminal via the --vt option. KMSCON will seamlessly integrate into existing setups so you can use X, Wayland or any other Graphics Systems simultaneously. You can even use the linux-console on all the other virtual terminals.

By default, KMSCON runs on seat0 but you can change the seat via the --seats option. For seats without virtual terminals, KMSCON will automatically activate itself and run exclusively on that seat. If the virtual terminal or the seat that kmscon runs on is gone, KMSCON will automatically exit. See the Listener-Mode to avoid this.

KMSCON spawns login(1) on each new terminal. After a session exits, KMSCON automatically respawns the next session. You can change the program that is spawned with the --login option. To stop kmscon, send SIGTERM to the KMSCON process.

Keyboard input is done by libxkbcommon. This provides the same features as the X11 Keyboard System but without any dependencies on X11 libraries. See the --xkb-{option} options for ways to change the keyboard layout, model, repeat rates and more. For instance --xkb-layout=de changes the keyboard layout to German.

KMSCON uses KMS/DRM to access graphics devices (like the X-Server does). Compared to the Linux console this allows KMSCON to provide much better font-rendering and enhanced monitor control. However, for backwards compatibility, KMSCON can also use fbdev devices. Hotpluggable graphics devices are marked as auxiliary devices, primary GPUs on a seat are marked as primary. Other GPUs stay unmarked. By default KMSCON uses all graphics devices but you can make it use only primary or auxiliary devices with the --gpus option.

LISTENER MODE

If started in listen-mode (--listen), KMSCON will run as system daemon and provide a system console on each seat that shows up if that seat does not have virtual terminals. On seats with virtual terminals you should run KMSCON in default mode.

Several options are exclusively limited to listen-mode, other than these, KMSCON behaves the same way as in default-mode.

SESSIONS

If KMSCON is active on a seat, the internal session-manager is woken up. At most times, only the terminal-session is active, but KMSCON can also support any other session type. You can switch between sessions with keyboard-shortcuts and you can create/destroy sessions during runtime.

Dummy sessions simply show a black screen and are used if no other session is available. Otherwise, dummy sessions are hidden from the user so they cannot switch to it.

Terminal sessions provide a terminal emulator. They are the main session type and provide all the terminal-emulation functionality.

VIRTUAL TERMINALS

Historically, Linux provides virtual terminals (VT) only on seat seat0. This is because only one VT can be active at a time but in multi-seat environments you want multiple active VTs, one per seat. It is easy to run KMSCON on seat0 on a VT, however, if you want to run KMSCON on another seat, there are no VTs. This means, you can only run one application that uses graphics devices on these seats. In most environments this is the X-Server. But if you want to run KMSCON together with the X-Server (or any other graphics server), you need a mechanism to notify these servers when they are active. This is done via VT APIs on seat0. But note that if the kernel is compiled without CONFIG_VT (which controls whether VTs are available), then even seat0 does not have VTs.

SEE ALSO

console(4), Compose(5)