kmscon: remove cdev sessions
[platform/upstream/kmscon.git] / docs / man / kmscon.xml
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">
4
5 <!--
6   Written 2012 by David Herrmann <dh.herrmann@googlemail.com>
7   Dedicated to the Public Domain
8 -->
9
10 <refentry id="kmscon">
11   <refentryinfo>
12     <title>kmscon</title>
13     <productname>kmscon</productname>
14     <date>December 2012</date>
15     <authorgroup>
16       <author>
17         <contrib>Developer</contrib>
18         <firstname>David</firstname>
19         <surname>Herrmann</surname>
20         <email>dh.herrmann@googlemail.com</email>
21       </author>
22     </authorgroup>
23   </refentryinfo>
24
25   <refmeta>
26     <refentrytitle>kmscon</refentrytitle>
27     <manvolnum>1</manvolnum>
28   </refmeta>
29
30   <refnamediv>
31     <refname>kmscon</refname>
32     <refpurpose>KMS/DRM based System Console</refpurpose>
33   </refnamediv>
34
35   <refsynopsisdiv>
36     <cmdsynopsis>
37       <command>kmscon <arg choice="opt" rep="repeat">OPTIONS</arg></command>
38     </cmdsynopsis>
39     <cmdsynopsis>
40       <command>kmscon -l <arg choice="opt" rep="repeat">OPTIONS</arg> -- /bin/login <arg choice="opt" rep="repeat">/bin/login-OPTIONS</arg></command>
41     </cmdsynopsis>
42   </refsynopsisdiv>
43
44   <refsect1>
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>
49
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>
54           on virtual terminals.
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>
59
60     <para>When run in listener mode, kmscon watches the system for new seats and
61           automatically provides a system console on it.</para>
62   </refsect1>
63
64   <refsect1>
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>
69
70     <para>General Options:</para>
71
72     <variablelist>
73       <varlistentry>
74         <term><option>-h</option></term>
75         <term><option>--help</option></term>
76         <listitem>
77           <para>Prints a short help text and exits. (default: off)</para>
78         </listitem>
79       </varlistentry>
80
81       <varlistentry>
82         <term><option>-v</option></term>
83         <term><option>--verbose</option></term>
84         <listitem>
85           <para>Be more verbose. (default: off)</para>
86         </listitem>
87       </varlistentry>
88
89       <varlistentry>
90         <term><option>--debug</option></term>
91         <listitem>
92           <para>Print debug messages. Works only if kmscon was compiled with
93                 debug mode enabled. (default: off)</para>
94         </listitem>
95       </varlistentry>
96
97       <varlistentry>
98         <term><option>--silent</option></term>
99         <listitem>
100           <para>Suppress notices and warnings. (default: off)</para>
101         </listitem>
102       </varlistentry>
103
104       <varlistentry>
105         <term><option>--configdir {/path/to/config/dir/}</option></term>
106         <listitem>
107           <para>Specify path to config directory. (default: /etc/kmscon/)</para>
108         </listitem>
109       </varlistentry>
110
111       <varlistentry>
112         <term><option>--listen</option></term>
113         <listitem>
114           <para>Run kmscon in listen-mode. See section below for more
115                 information. (default: off)</para>
116         </listitem>
117       </varlistentry>
118     </variablelist>
119
120     <para>Seat Options:</para>
121
122     <variablelist>
123       <varlistentry>
124         <term><option>--vt {/path/to/vt}</option></term>
125         <listitem>
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>
137         </listitem>
138       </varlistentry>
139
140       <varlistentry>
141         <term><option>--switchvt</option></term>
142         <listitem>
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>
147         </listitem>
148       </varlistentry>
149
150       <varlistentry>
151         <term><option>--seats {list,of,seats}</option></term>
152         <listitem>
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>
157
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>
163         </listitem>
164       </varlistentry>
165     </variablelist>
166
167     <para>Session Options:</para>
168
169     <variablelist>
170       <varlistentry>
171         <term><option>--session-max {num}</option></term>
172         <listitem>
173           <para>Change the maximum number of sessions that are allowed on each
174                 seat. Use '0' for no limit. (default: 50)</para>
175         </listitem>
176       </varlistentry>
177
178       <varlistentry>
179         <term><option>--session-control</option></term>
180         <listitem>
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>
184         </listitem>
185       </varlistentry>
186
187       <varlistentry>
188         <term><option>--terminal-session</option></term>
189         <listitem>
190           <para>Start a terminal session after setup is done.
191                 (default: on)</para>
192         </listitem>
193       </varlistentry>
194     </variablelist>
195
196     <para>Terminal Options:</para>
197
198     <variablelist>
199       <varlistentry>
200         <term><option>-l</option></term>
201         <term><option>--login</option></term>
202         <listitem>
203           <para>Specify the application that is started on new terminal
204                 sessions. This takes no argument but instead everything left
205                 after all options have been parsed is used as argument to this
206                 option. Note that nothing after two dashes <option>--</option>
207                 is parsed as regular option by kmscon.
208                 (default: /bin/login -p)</para>
209
210           <para>This example starts '/bin/bash -i' on each new terminal session:
211                 ./kmscon --login --debug --no-switchvt -- /bin/bash -i</para>
212         </listitem>
213       </varlistentry>
214
215       <varlistentry>
216         <term><option>-t {term}</option></term>
217         <term><option>--term {term}</option></term>
218         <listitem>
219           <para>This changes the <varname>$TERM</varname> environment variable
220                 that is set on new terminal sessions.
221                 (default: xterm-256color)</para>
222         </listitem>
223       </varlistentry>
224
225       <varlistentry>
226         <term><option>--reset-env</option></term>
227         <listitem>
228           <para>Reset environment before spawning the child process.
229                 (default: on)</para>
230         </listitem>
231       </varlistentry>
232
233       <varlistentry>
234         <term><option>--palette {name}</option></term>
235         <listitem>
236           <para>Change the default color-palette. This shouldn't be used
237                 anymore. Dynamic color palettes should be implemented
238                 instead.</para>
239         </listitem>
240       </varlistentry>
241
242       <varlistentry>
243         <term><option>--sb-size {size}</option></term>
244         <listitem>
245           <para>Maximum scrollback-buffer line count. (default: 1000)</para>
246         </listitem>
247       </varlistentry>
248     </variablelist>
249
250     <para>Input Options:</para>
251
252     <variablelist>
253       <varlistentry>
254         <term><option>--xkb-model {model}</option></term>
255         <listitem>
256           <para>Keyboard model. This should normally not be changed.
257                 (default: {xkb default})</para>
258         </listitem>
259       </varlistentry>
260
261       <varlistentry>
262         <term><option>--xkb-layout {layout}</option></term>
263         <listitem>
264           <para>Keyboard layout. (default: {xkb default})</para>
265           <para>German keyboard example: --xkb-layout=de</para>
266         </listitem>
267       </varlistentry>
268
269       <varlistentry>
270         <term><option>--xkb-variant {variant}</option></term>
271         <listitem>
272           <para>Keyboard variant. (default: {xkb default})</para>
273         </listitem>
274       </varlistentry>
275
276       <varlistentry>
277         <term><option>--xkb-options {options}</option></term>
278         <listitem>
279           <para>Keyboard options. (default: {xkb default})</para>
280         </listitem>
281       </varlistentry>
282
283       <varlistentry>
284         <term><option>--xkb-keymap {file}</option></term>
285         <listitem>
286           <para>Path to a single predefined keymap file. This takes precedence
287                 over the above options. An empty path "" is interpreted as not
288                 using a keymap. (default: not used)</para>
289         </listitem>
290       </varlistentry>
291
292       <varlistentry>
293         <term><option>--xkb-repeat-delay {delay}</option></term>
294         <listitem>
295           <para>Delay after key was pressed until key-repeat starts (in
296                 milliseconds). (default: 250)</para>
297         </listitem>
298       </varlistentry>
299
300       <varlistentry>
301         <term><option>--xkb-repeat-rate {rate}</option></term>
302         <listitem>
303           <para>Time between two key-repeats (in milliseconds).
304                 (default: 50)</para>
305         </listitem>
306       </varlistentry>
307     </variablelist>
308
309     <para>Grabs / Keyboard-Shortcuts:</para>
310     <para>All keyboard shortcuts (here: grabs) in kmscon can be modified with
311           these options. The argument to such an option is a list of
312           comma-separated
313           keyboard-shortcuts that should trigger the specified action. To
314           disable a shortcut, pass an empty argument (empty list). A keyboard
315           shortcut exists of a list of modifiers followed by a single key. All
316           modifiers must be down when the key is pressed for the shortcut to be
317           detected. A modifier is surrounded by '&lt;' and '&gt;' (like
318           '&lt;shift&gt;'). A key is the name of a keysym (like 'a' or
319           'Return'). Keysyms are case-sensitive and kmscon will suggest a keysym
320           name if you entered a wrong case. However, kmscon can not always guess
321           the right case as lower-case-only keysyms are ambiguous.</para>
322
323     <para>If a key generates multiple keysyms in your keyboard layout, you can
324           match these keys by concatenating the keysyms with a '+' (like
325           'H+E+L+L+O'). This does not mean that all the listed keys must be
326           pressed! It's rather a way to match multi-keysym keys.</para>
327
328     <para>Valid modifiers are: Shift, Control/Ctrl, Alt, Logo (Windows/Apple
329           key)</para>
330
331     <variablelist>
332       <varlistentry>
333         <term><option>--grab-scroll-up {grab}</option></term>
334         <listitem>
335           <para>Scroll up in scrollback buffer by one line.
336                 (default: &lt;Shift&gt;Up)</para>
337         </listitem>
338       </varlistentry>
339
340       <varlistentry>
341         <term><option>--grab-scroll-down {grab}</option></term>
342         <listitem>
343           <para>Scroll down in scrollback buffer by one line.
344                 (default: &lt;Shift&gt;Down)</para>
345         </listitem>
346       </varlistentry>
347
348       <varlistentry>
349         <term><option>--grab-page-up {grab}</option></term>
350         <listitem>
351           <para>Scroll up in scrollback buffer by one page.
352                 (default: &lt;Shift&gt;Prior/PageUp)</para>
353         </listitem>
354       </varlistentry>
355
356       <varlistentry>
357         <term><option>--grab-page-down {grab}</option></term>
358         <listitem>
359           <para>Scroll down in scrollback buffer by one page.
360                 (default: &lt;Shift&gt;Next/PageDown)</para>
361         </listitem>
362       </varlistentry>
363
364       <varlistentry>
365         <term><option>--grab-zoom-in {grab}</option></term>
366         <listitem>
367           <para>Increase font size of the current terminal.
368                 (default: &lt;Ctrl&gt;Plus)</para>
369         </listitem>
370       </varlistentry>
371
372       <varlistentry>
373         <term><option>--grab-zoom-out {grab}</option></term>
374         <listitem>
375           <para>Decrease font size of the current terminal.
376                 (default: &lt;Ctrl&gt;Minus)</para>
377         </listitem>
378       </varlistentry>
379
380       <varlistentry>
381         <term><option>--grab-session-next {grab}</option></term>
382         <listitem>
383           <para>Switch to next session.
384                 (default: &lt;Ctrl&gt;&lt;Logo&gt;Right)</para>
385         </listitem>
386       </varlistentry>
387
388       <varlistentry>
389         <term><option>--grab-session-prev {grab}</option></term>
390         <listitem>
391           <para>Switch to previous session.
392                 (default: &lt;Ctrl&gt;&lt;Logo&gt;Left)</para>
393         </listitem>
394       </varlistentry>
395
396       <varlistentry>
397         <term><option>--grab-session-dummy {grab}</option></term>
398         <listitem>
399           <para>Switch to dummy session (black screen).
400                 (default: &lt;Ctrl&gt;&lt;Logo&gt;Escape)</para>
401         </listitem>
402       </varlistentry>
403
404       <varlistentry>
405         <term><option>--grab-session-close {grab}</option></term>
406         <listitem>
407           <para>Close current session (press twice to kill it).
408                 (default: &lt;Ctrl&gt;&lt;Logo&gt;BackSpace)</para>
409         </listitem>
410       </varlistentry>
411
412       <varlistentry>
413         <term><option>--grab-terminal-new {grab}</option></term>
414         <listitem>
415           <para>Create new terminal session next to current session.
416                 (default: &lt;Ctrl&gt;&lt;Logo&gt;Return)</para>
417         </listitem>
418       </varlistentry>
419     </variablelist>
420
421     <para>Video Options:</para>
422
423     <variablelist>
424       <varlistentry>
425         <term><option>--drm</option></term>
426         <listitem>
427           <para>Use DRM devices as display devices, too. fbdev devices are
428                 always used, but DRM devices are only used if this option is on.
429                 (default: on)</para>
430         </listitem>
431       </varlistentry>
432
433       <varlistentry>
434         <term><option>--hwaccel</option></term>
435         <listitem>
436           <para>Use 3D hardware acceleration. Note that this should be used in
437                 conjunction with <option>--drm</option>. On newer hardware, this
438                 can speed up rendering by multiple orders of magnitude. However,
439                 on older hardware this might even slow down rendering speed.
440                 (default: off)</para>
441         </listitem>
442       </varlistentry>
443
444       <varlistentry>
445         <term><option>--gpus {all,aux,primary}</option></term>
446         <listitem>
447           <para>GPU selection algorithm. If 'all' then all found GPUs are used.
448                 If 'aux' then primary and auxiliary GPUs are used. If 'primary'
449                 then only primary GPUs are used. Primary GPUs are the default
450                 GPU on a seat. There is always only one primary GPU on a seat.
451                 Auxiliary GPUs are hotpluggable GPUs that provide additional
452                 independent displays. (default: all)</para>
453         </listitem>
454       </varlistentry>
455
456       <varlistentry>
457         <term><option>--render-engine {engine}</option></term>
458         <listitem>
459           <para>Select console render engine. Available engines are 'bblit',
460                 'bbulk' and 'gltex'. (default: detect by GPU type)</para>
461         </listitem>
462       </varlistentry>
463
464       <varlistentry>
465         <term><option>--render-timing</option></term>
466         <listitem>
467           <para>Display timing information of the render engines. This should
468                 only be used to debug render engines. (default: off)</para>
469         </listitem>
470       </varlistentry>
471     </variablelist>
472
473     <para>Font Options:</para>
474
475     <variablelist>
476       <varlistentry>
477         <term><option>--font-engine {engine}</option></term>
478         <listitem>
479           <para>Select font-engine. Available engines are 'pango', 'freetype2',
480                 'unifont' and '8x16'. (default: pango)</para>
481         </listitem>
482       </varlistentry>
483
484       <varlistentry>
485         <term><option>--font-size {points}</option></term>
486         <listitem>
487           <para>Font size in points. (default: 12)</para>
488         </listitem>
489       </varlistentry>
490
491       <varlistentry>
492         <term><option>--font-name {name}</option></term>
493         <listitem>
494           <para>Font name. (default: monospace)</para>
495         </listitem>
496       </varlistentry>
497
498       <varlistentry>
499         <term><option>--font-dpi {dpi}</option></term>
500         <listitem>
501           <para>DPI used for font-rendering. Per monitor DPI values overwrite
502                 this global default. (default: 96)</para>
503         </listitem>
504       </varlistentry>
505     </variablelist>
506   </refsect1>
507
508   <refsect1>
509     <title>Configuration</title>
510     <para>Default configuration directory is <filename>/etc/kmscon/</filename>
511           and the main configuration file is called
512           <filename>/etc/kmscon/kmscon.conf</filename>. You can provide an
513           additional configuration file for each seat via
514           <filename>/etc/kmscon/{seatname}.kmscon.conf</filename>.
515           Any command-line option that can be passed to kmscon can also be put
516           into those configuration files.  For example:</para>
517
518     <programlisting>
519       font-name=Meslo LG M
520       font-size=14
521       login=/bin/bash -i
522     </programlisting>
523
524     <para>Command-line options overwrite
525           configuration file options. And per-seat configuration files overwrite
526           the global configuration file.</para>
527   </refsect1>
528
529   <refsect1>
530     <title>Default Mode</title>
531     <para>In default mode, kmscon acts as a replacement for
532           <citerefentry><refentrytitle>agetty</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
533           kmscon opens a virtual terminal and
534           provides a system console on it. It replaces the linux-console on this
535           VT. You can select the virtual terminal
536           via the <option>--vt</option> option. kmscon will seamlessly integrate
537           into existing setups so you can use X, Wayland or any other Graphics
538           Systems simultaneously. You can even use the linux-console on all the
539           other virtual terminals.</para>
540
541     <para>By default, kmscon runs on
542           <emphasis>seat0</emphasis> but you can change the seat via the
543           <option>--seats</option> option. For seats without virtual terminals,
544           kmscon will automatically activate itself and run exclusively on that
545           seat. If the virtual terminal or the seat that kmscon
546           runs on is gone, kmscon will automatically exit. See the
547           <emphasis>Listener-Mode</emphasis> to avoid this.</para>
548
549     <para>kmscon spawns
550           <citerefentry><refentrytitle>login</refentrytitle><manvolnum>1</manvolnum></citerefentry>
551           on each new terminal. After a session exits, kmscon automatically
552           respawns the next session. You can change the program that is spawned
553           with the <option>--login</option> option. To stop kmscon, send SIGTERM
554           to the kmscon process.</para>
555
556     <para>Keyboard input is done by <emphasis>libxkbcommon</emphasis>. This
557           provides the same features as the X11 Keyboard System but without any
558           dependencies on X11 libraries. See the
559           <emphasis>--xkb-{option}</emphasis> options for ways to change the
560           keyboard layout, model, repeat rates and more. For instance
561           <option>--xkb-layout=de</option> changes the keyboard layout to
562           German.</para>
563
564     <para>kmscon uses KMS/DRM to access graphics devices (like the X-Server
565           does). Compared to the linux console this allows kmscon to provide
566           much better font-rendering and enhanced monitor control. However, for
567           backwards compatibility, kmscon can also use fbdev devices.
568           Hotpluggable graphics devices are marked as auxiliary devices, primary
569           GPUs on a seat are marked as primary. Other GPUs stay unmarked. By
570           default kmscon uses all graphics devices but you can make it use only
571           primary or auxiliary devices with the <option>--gpus</option>
572           option.</para>
573   </refsect1>
574
575   <refsect1>
576     <title>Listener Mode</title>
577     <para>If started in listen-mode (<option>--listen</option>) kmscon will run
578           as system daemon and provide a system console on each seat that shows
579           up if that seat does not have virtual terminals. On seats with virtual
580           terminals you should run kmscon in default mode.</para>
581
582     <para>Several options are exclusively limited to listen-mode, other than
583           these, kmscon behaves the same way as in default-mode.</para>
584   </refsect1>
585
586   <refsect1>
587     <title>Sessions</title>
588     <para>If kmscon is active on a seat, the internal session-manager is woken
589           up. At most times, only the terminal-session is active, but kmscon can
590           also support any other session type. You can switch between sessions
591           with keyboard-shortcuts and you can create/destroy sessions during
592           runtime.</para>
593
594     <para>Dummy sessions simply show a black screen and are used if no other
595           session is available. Otherwise, dummy sessions are hidden from the
596           user so they cannot switch to it.</para>
597
598     <para>Terminal sessions provide a terminal emulator. They are the main
599           session type and provide all the terminal-emulation
600           functionality.</para>
601   </refsect1>
602
603   <refsect1>
604     <title>Virtual Terminals</title>
605     <para>Historically, linux provides virtual terminals (VT) only on seat
606           <emphasis>seat0</emphasis>. This is because only one VT can be active
607           at a time but in multi-seat environments you want multiple active VTs,
608           one per seat. It is easy to run kmscon on seat0 on a VT, however, if
609           you want to run kmscon on another seat, there are no VTs. This means,
610           you can only run one application that uses graphics devices on these
611           seats. In most environments this is the X-Server. But if you want to
612           run kmscon together with the X-Server (or any other graphics server),
613           you need a mechanism to notify these servers when they are active.
614           This is done via VT APIs on seat0. But note that if the kernel is
615           compiled without CONFIG_VT (which controls whether VTs are available),
616           then even seat0 does not have VTs.</para>
617   </refsect1>
618
619   <refsect1>
620     <title>See Also</title>
621     <para>
622       <citerefentry><refentrytitle>kmscon.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
623       <citerefentry><refentrytitle>console</refentrytitle><manvolnum>4</manvolnum></citerefentry>
624     </para>
625   </refsect1>
626 </refentry>