1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 Written 2012 by David Herrmann <dh.herrmann@googlemail.com>
7 Dedicated to the Public Domain
10 <refentry id="kmscon">
13 <productname>kmscon</productname>
14 <date>December 2012</date>
17 <contrib>Developer</contrib>
18 <firstname>David</firstname>
19 <surname>Herrmann</surname>
20 <email>dh.herrmann@googlemail.com</email>
26 <refentrytitle>kmscon</refentrytitle>
27 <manvolnum>1</manvolnum>
31 <refname>kmscon</refname>
32 <refpurpose>KMS/DRM based System Console</refpurpose>
37 <command>kmscon <arg choice="opt" rep="repeat">OPTIONS</arg></command>
40 <command>kmscon -l <arg choice="opt" rep="repeat">OPTIONS</arg> -- /bin/login <arg choice="opt" rep="repeat">/bin/login-OPTIONS</arg></command>
45 <title>Description</title>
46 <para>kmscon is a KMS/DRM-based system console with an integrated terminal
47 emulator for linux operating systems. It was designed as a replacement
48 for the linux kernel console and virtual terminals.</para>
50 <para>When run in default mode, kmscon allocates a virtual terminal and
51 provides a terminal emulator on it. It can thus be used as replacement
52 for the linux console and
53 <citerefentry><refentrytitle>agetty</refentrytitle><manvolnum>1</manvolnum></citerefentry>
55 Compared to the linux console, kmscon provides a rich set of enhanced
56 features including full internationalized keyboard support, full UTF-8
57 input/font support, hardware-accelerated rendering, multi-seat
58 support and more.</para>
60 <para>When run in listener mode, kmscon watches the system for new seats and
61 automatically provides a system console on it.</para>
65 <title>Options</title>
66 <para>Boolean options take no arguments. If the default value is true, then
67 you can disable the option by prefixing it with
68 <emphasis>no-</emphasis>.</para>
70 <para>General Options:</para>
74 <term><option>-h</option></term>
75 <term><option>--help</option></term>
77 <para>Prints a short help text and exits. (default: off)</para>
82 <term><option>-v</option></term>
83 <term><option>--verbose</option></term>
85 <para>Be more verbose. (default: off)</para>
90 <term><option>--debug</option></term>
92 <para>Print debug messages. Works only if kmscon was compiled with
93 debug mode enabled. (default: off)</para>
98 <term><option>--silent</option></term>
100 <para>Suppress notices and warnings. (default: off)</para>
105 <term><option>--configdir {/path/to/config/dir/}</option></term>
107 <para>Specify path to config directory. (default: /etc/kmscon/)</para>
112 <term><option>--listen</option></term>
114 <para>Run kmscon in listen-mode. See section below for more
115 information. (default: off)</para>
120 <para>Seat Options:</para>
124 <term><option>--vt {/path/to/vt}</option></term>
126 <para>Use this VT. If not specified, kmscon tries to find a VT by
127 itself. On seats without VTs, kmscon simply activates itself
128 automatically without using any VT. Please note that you cannot
129 use this option if kmscon runs on multiple seats
130 (see <option>--seats</option>). To avoid this, specify this
131 option in a seat configuration
132 <filename>/etc/kmscon/{seat}.kmscon.conf</filename>.</para>
133 <para>You must not run multiple applications on a single VT,
134 otherwise, you might get an unresponsive system. Also note, by
135 default, kmscon tries to use it's controlling terminal as VT and
136 if that fails, it tries to allocate a new unused VT.</para>
141 <term><option>--switchvt</option></term>
143 <para>If kmscon is started on a VT that is currently not active, this
144 option makes kmscon activate this VT during startup. The same
145 way, during shutdown kmscon will reactivate the VT that was
146 previously active. (default: on)</para>
151 <term><option>--seats {list,of,seats}</option></term>
153 <para>List of seats kmscon will run on. Use 'all' to make kmscon run
154 on all seats. Use 'all,' to make kmscon run on a seat called
155 'all' (empty entries are ignored). Use 'current' to make kmscon
156 run on the current seat. (default: "current")</para>
158 <para>If kmscon runs on multiple seats, all seats are independent of
159 each other. You can either run a different kmscon process on
160 ecah seat or make a single kmscon process run on multiple seats.
161 In the latter case, global state can be shared to reduce memory
162 consumption (like glyph-caches).</para>
167 <para>Session Options:</para>
171 <term><option>--session-max {num}</option></term>
173 <para>Change the maximum number of sessions that are allowed on each
174 seat. Use '0' for no limit. (default: 50)</para>
179 <term><option>--session-control</option></term>
181 <para>Allow keyboard-shortcuts to control the session manager. This
182 allows the use to create new sessions, kill sessions and switch
183 sessions via keyboard input. (default: off)</para>
188 <term><option>--terminal-session</option></term>
190 <para>Start a terminal session after setup is done.
196 <term><option>--cdev-session</option></term>
198 <para>Start cdev-VT-emulation session after setup is done. This is
200 <option>--listen</option> mode. (default: off)</para>
205 <para>Terminal Options:</para>
209 <term><option>-l</option></term>
210 <term><option>--login</option></term>
212 <para>Specify the application that is started on new terminal
213 sessions. This takes no argument but instead everything left
214 after all options have been parsed is used as argument to this
215 option. Note that nothing after two dashes <option>--</option>
216 is parsed as regular option by kmscon.
217 (default: /bin/login -p)</para>
219 <para>This example starts '/bin/bash -i' on each new terminal session:
220 ./kmscon --login --debug --no-switchvt -- /bin/bash -i</para>
225 <term><option>-t {term}</option></term>
226 <term><option>--term {term}</option></term>
228 <para>This changes the <varname>$TERM</varname> environment variable
229 that is set on new terminal sessions.
230 (default: xterm-256color)</para>
235 <term><option>--reset-env</option></term>
237 <para>Reset environment before spawning the child process.
243 <term><option>--palette {name}</option></term>
245 <para>Change the default color-palette. This shouldn't be used
246 anymore. Dynamic color palettes should be implemented
252 <term><option>--sb-size {size}</option></term>
254 <para>Maximum scrollback-buffer line count. (default: 1000)</para>
259 <para>Input Options:</para>
263 <term><option>--xkb-model {model}</option></term>
265 <para>Keyboard model. This should normally not be changed.
266 (default: {xkb default})</para>
271 <term><option>--xkb-layout {layout}</option></term>
273 <para>Keyboard layout. (default: {xkb default})</para>
274 <para>German keyboard example: --xkb-layout=de</para>
279 <term><option>--xkb-variant {variant}</option></term>
281 <para>Keyboard variant. (default: {xkb default})</para>
286 <term><option>--xkb-options {options}</option></term>
288 <para>Keyboard options. (default: {xkb default})</para>
293 <term><option>--xkb-keymap {file}</option></term>
295 <para>Path to a single predefined keymap file. This takes precedence
296 over the above options. An empty path "" is interpreted as not
297 using a keymap. (default: not used)</para>
302 <term><option>--xkb-repeat-delay {delay}</option></term>
304 <para>Delay after key was pressed until key-repeat starts (in
305 milliseconds). (default: 250)</para>
310 <term><option>--xkb-repeat-rate {rate}</option></term>
312 <para>Time between two key-repeats (in milliseconds).
318 <para>Grabs / Keyboard-Shortcuts:</para>
319 <para>All keyboard shortcuts (here: grabs) in kmscon can be modified with
320 these options. The argument to such an option is a list of
322 keyboard-shortcuts that should trigger the specified action. To
323 disable a shortcut, pass an empty argument (empty list). A keyboard
324 shortcut exists of a list of modifiers followed by a single key. All
325 modifiers must be down when the key is pressed for the shortcut to be
326 detected. A modifier is surrounded by '<' and '>' (like
327 '<shift>'). A key is the name of a keysym (like 'a' or
328 'Return'). Keysyms are case-sensitive and kmscon will suggest a keysym
329 name if you entered a wrong case. However, kmscon can not always guess
330 the right case as lower-case-only keysyms are ambiguous.</para>
332 <para>If a key generates multiple keysyms in your keyboard layout, you can
333 match these keys by concatenating the keysyms with a '+' (like
334 'H+E+L+L+O'). This does not mean that all the listed keys must be
335 pressed! It's rather a way to match multi-keysym keys.</para>
337 <para>Valid modifiers are: Shift, Control/Ctrl, Alt, Logo (Windows/Apple
342 <term><option>--grab-scroll-up {grab}</option></term>
344 <para>Scroll up in scrollback buffer by one line.
345 (default: <Shift>Up)</para>
350 <term><option>--grab-scroll-down {grab}</option></term>
352 <para>Scroll down in scrollback buffer by one line.
353 (default: <Shift>Down)</para>
358 <term><option>--grab-page-up {grab}</option></term>
360 <para>Scroll up in scrollback buffer by one page.
361 (default: <Shift>Prior/PageUp)</para>
366 <term><option>--grab-page-down {grab}</option></term>
368 <para>Scroll down in scrollback buffer by one page.
369 (default: <Shift>Next/PageDown)</para>
374 <term><option>--grab-zoom-in {grab}</option></term>
376 <para>Increase font size of the current terminal.
377 (default: <Ctrl>Plus)</para>
382 <term><option>--grab-zoom-out {grab}</option></term>
384 <para>Decrease font size of the current terminal.
385 (default: <Ctrl>Minus)</para>
390 <term><option>--grab-session-next {grab}</option></term>
392 <para>Switch to next session.
393 (default: <Ctrl><Logo>Right)</para>
398 <term><option>--grab-session-prev {grab}</option></term>
400 <para>Switch to previous session.
401 (default: <Ctrl><Logo>Left)</para>
406 <term><option>--grab-session-dummy {grab}</option></term>
408 <para>Switch to dummy session (black screen).
409 (default: <Ctrl><Logo>Escape)</para>
414 <term><option>--grab-session-close {grab}</option></term>
416 <para>Close current session (press twice to kill it).
417 (default: <Ctrl><Logo>BackSpace)</para>
422 <term><option>--grab-terminal-new {grab}</option></term>
424 <para>Create new terminal session next to current session.
425 (default: <Ctrl><Logo>Return)</para>
430 <para>Video Options:</para>
434 <term><option>--drm</option></term>
436 <para>Use DRM devices as display devices, too. fbdev devices are
437 always used, but DRM devices are only used if this option is on.
443 <term><option>--hwaccel</option></term>
445 <para>Use 3D hardware acceleration. Note that this should be used in
446 conjunction with <option>--drm</option>. On newer hardware, this
447 can speed up rendering by multiple orders of magnitude. However,
448 on older hardware this might even slow down rendering speed.
449 (default: off)</para>
454 <term><option>--gpus {all,aux,primary}</option></term>
456 <para>GPU selection algorithm. If 'all' then all found GPUs are used.
457 If 'aux' then primary and auxiliary GPUs are used. If 'primary'
458 then only primary GPUs are used. Primary GPUs are the default
459 GPU on a seat. There is always only one primary GPU on a seat.
460 Auxiliary GPUs are hotpluggable GPUs that provide additional
461 independent displays. (default: all)</para>
466 <term><option>--render-engine {engine}</option></term>
468 <para>Select console render engine. Available engines are 'bblit',
469 'bbulk' and 'gltex'. (default: detect by GPU type)</para>
474 <term><option>--render-timing</option></term>
476 <para>Display timing information of the render engines. This should
477 only be used to debug render engines. (default: off)</para>
482 <para>Font Options:</para>
486 <term><option>--font-engine {engine}</option></term>
488 <para>Select font-engine. Available engines are 'pango', 'freetype2',
489 'unifont' and '8x16'. (default: pango)</para>
494 <term><option>--font-size {points}</option></term>
496 <para>Font size in points. (default: 12)</para>
501 <term><option>--font-name {name}</option></term>
503 <para>Font name. (default: monospace)</para>
508 <term><option>--font-dpi {dpi}</option></term>
510 <para>DPI used for font-rendering. Per monitor DPI values overwrite
511 this global default. (default: 96)</para>
518 <title>Configuration</title>
519 <para>Default configuration directory is <filename>/etc/kmscon/</filename>
520 and the main configuration file is called
521 <filename>/etc/kmscon/kmscon.conf</filename>. You can provide an
522 additional configuration file for each seat via
523 <filename>/etc/kmscon/{seatname}.kmscon.conf</filename>.
524 Any command-line option that can be passed to kmscon can also be put
525 into those configuration files. For example:</para>
533 <para>Command-line options overwrite
534 configuration file options. And per-seat configuration files overwrite
535 the global configuration file.</para>
539 <title>Default Mode</title>
540 <para>In default mode, kmscon acts as a replacement for
541 <citerefentry><refentrytitle>agetty</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
542 kmscon opens a virtual terminal and
543 provides a system console on it. It replaces the linux-console on this
544 VT. You can select the virtual terminal
545 via the <option>--vt</option> option. kmscon will seamlessly integrate
546 into existing setups so you can use X, Wayland or any other Graphics
547 Systems simultaneously. You can even use the linux-console on all the
548 other virtual terminals.</para>
550 <para>By default, kmscon runs on
551 <emphasis>seat0</emphasis> but you can change the seat via the
552 <option>--seats</option> option. For seats without virtual terminals,
553 kmscon will automatically activate itself and run exclusively on that
554 seat. If the virtual terminal or the seat that kmscon
555 runs on is gone, kmscon will automatically exit. See the
556 <emphasis>Listener-Mode</emphasis> to avoid this.</para>
559 <citerefentry><refentrytitle>login</refentrytitle><manvolnum>1</manvolnum></citerefentry>
560 on each new terminal. After a session exits, kmscon automatically
561 respawns the next session. You can change the program that is spawned
562 with the <option>--login</option> option. To stop kmscon, send SIGTERM
563 to the kmscon process.</para>
565 <para>Keyboard input is done by <emphasis>libxkbcommon</emphasis>. This
566 provides the same features as the X11 Keyboard System but without any
567 dependencies on X11 libraries. See the
568 <emphasis>--xkb-{option}</emphasis> options for ways to change the
569 keyboard layout, model, repeat rates and more. For instance
570 <option>--xkb-layout=de</option> changes the keyboard layout to
573 <para>kmscon uses KMS/DRM to access graphics devices (like the X-Server
574 does). Compared to the linux console this allows kmscon to provide
575 much better font-rendering and enhanced monitor control. However, for
576 backwards compatibility, kmscon can also use fbdev devices.
577 Hotpluggable graphics devices are marked as auxiliary devices, primary
578 GPUs on a seat are marked as primary. Other GPUs stay unmarked. By
579 default kmscon uses all graphics devices but you can make it use only
580 primary or auxiliary devices with the <option>--gpus</option>
585 <title>Listener Mode</title>
586 <para>If started in listen-mode (<option>--listen</option>) kmscon will run
587 as system daemon and provide a system console on each seat that shows
588 up if that seat does not have virtual terminals. On seats with virtual
589 terminals you should run kmscon in default mode.</para>
591 <para>Several options are exclusively limited to listen-mode, other than
592 these, kmscon behaves the same way as in default-mode.</para>
596 <title>Sessions</title>
597 <para>If kmscon is active on a seat, the internal session-manager is woken
598 up. At most times, only the terminal-session is active, but kmscon can
599 also support any other session type. You can switch between sessions
600 with keyboard-shortcuts and you can create/destroy sessions during
603 <para>Dummy sessions simply show a black screen and are used if no other
604 session is available. Otherwise, dummy sessions are hidden from the
605 user so they cannot switch to it.</para>
607 <para>Terminal sessions provide a terminal emulator. They are the main
608 session type and provide all the terminal-emulation
609 functionality.</para>
611 <para>CDev sessions provide a way to hook-up external applications as kmscon
612 sessions. They provide fake virtual terminals on seats that don't have
613 them so you can switch between multiple graphics applications/servers
614 without needing VTs. See <emphasis>Virtual Terminals</emphasis>
619 <title>Virtual Terminals</title>
620 <para>Historically, linux provides virtual terminals (VT) only on seat
621 <emphasis>seat0</emphasis>. This is because only one VT can be active
622 at a time but in multi-seat environments you want multiple active VTs,
623 one per seat. It is easy to run kmscon on seat0 on a VT, however, if
624 you want to run kmscon on another seat, there are no VTs. This means,
625 you can only run one application that uses graphics devices on these
626 seats. In most environments this is the X-Server. But if you want to
627 run kmscon together with the X-Server (or any other graphics server),
628 you need a mechanism to notify these servers when they are active.
629 This is done via VT APIs on seat0. But note that if the kernel is
630 compiled without CONFIG_VT (which controls whether VTs are available),
631 then even seat0 does not have VTs.</para>
633 <para>On seats without VTs we need a replacement API. However, a new
634 API would require modifying every application that uses the VT API to
635 also support the new replacement if you want to run it on those seats.
636 Therefore, kmscon provides a backwards-compatible API. It uses the
637 linux CUSE API to create VTs for all seats that have no VTs. You need
638 to pass <option>--cdev-session</option> to kmscon to enable this.
639 kmscon will then create one cdev (<emphasis>c</emphasis>haracter
640 <emphasis>dev</emphasis>ice) for each seat and calls it
641 <filename>/dev/ttyF{seatname}</filename> ('F' for 'fake'). This
642 character device provides the same API as a VT so your X-Server (or
643 even kmscon in default-mode) can use it instead of a real VT.</para>
645 <para>In contrast to real VTs, each application that opens this fake VT will
646 get a different VT assigned. So you can use multiple X-Servers all
647 opening <filename>/dev/ttyF{seatname}</filename> and they will each
648 show up as different kmscon session. But note that not all TTY ioctls
649 are available on fake VTs. kmscon only emulates the API that is
650 currently used by most VT users. If you want to run an application
651 that needs more functionality, please open a bug-report.</para>
653 <para>Switching VTs is done by signaling the active process to go asleep and
654 signaling the new VT to wake up. If kmscon emulates VTs, it needs to
655 be able to send these signals to the processes running on fake VTs. In
656 most situations this means kmscon must have root privileges.</para>
660 <title>See Also</title>
662 <citerefentry><refentrytitle>kmscon.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
663 <citerefentry><refentrytitle>console</refentrytitle><manvolnum>4</manvolnum></citerefentry>