Difference between revisions of "KMSCON"

From ArchWiki
Jump to: navigation, search
m (added ja)
(simplification and beautification of wikilinks, fixing whitespace, capitalization and section fragments (https://github.com/lahwaacz/wiki-scripts/blob/master/link-checker.py (interactive)))
 
(24 intermediate revisions by 11 users not shown)
Line 1: Line 1:
 
[[Category:Terminal emulators]]
 
[[Category:Terminal emulators]]
 
[[ja:KMSCON]]
 
[[ja:KMSCON]]
[[zh-cn:KMSCON]]
+
[[zh-CN:KMSCON]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|A guide to installing and configuring kmscon, the userspace linux-console replacement.}}
+
{{Related|KMS}}
{{Article summary heading|Related}}
+
{{Related|systemd}}
{{Article summary wiki|KMS}}
+
{{Related|fbterm}}
{{Article summary wiki|systemd}}
+
{{Related articles end}}
{{Article summary end}}
+
From the project's [http://cgit.freedesktop.org/~dvdhrm/kmscon/tree/README git repository]:
From the [https://github.com/dvdhrm/kmscon project GitHub page]:
+
  
:''Kmscon is a simple terminal emulator based on linux kernel mode setting (KMS). It is an attempt to replace the in-kernel VT implementation with a userspace console.''
+
:''Kmscon is a simple terminal emulator based on linux [[kernel mode setting]]. It is an attempt to replace the in-kernel VT implementation with a userspace console.''
  
 
== Features ==
 
== Features ==
Line 27: Line 26:
 
== Install ==
 
== Install ==
  
Despite its name, KMS is not a hard requirement for kmscon. Kmscon supports the following video backends: fbdev (Linux fbdev video backend), drm2d (Linux DRM software-rendering backend), drm3d (Linux DRM hardware-rendering backend). Make sure one of them is available on your system.
+
Despite its name, kmscon is not a hard requirement for KMS. Kmscon supports the following video backends: fbdev (Linux fbdev video backend), drm2d (Linux DRM software-rendering backend), drm3d (Linux DRM hardware-rendering backend). Make sure one of them is available on your system.
  
Install {{Pkg|kmscon}} from one of the [[official repositories]]. Alternatively, you can install {{AUR|kmscon-git}} from the [[AUR]].
+
Install the {{Pkg|kmscon}} package from the [[official repositories]]. Alternatively, you can install the {{AUR|kmscon-git}} package from the [[AUR]].
  
== Replacing linux-console ==
+
Normally, there is a special systemd configuration for tty1.  To be conservative, you can continue to run the traditional agetty on tty1 and only run kmscon on all the other virtual terminals.  Or you can run kmscon on both tty1 and the other VTs.
  
As root, issue:
+
To enable kmscon on tty1, run:
 +
{{bc|
 +
# systemctl disable getty@tty1.service
 +
# systemctl enable kmsconvt@tty1.service
 +
}}
 +
 
 +
To enable kmscon on all virtual terminals, run:
 
{{bc|
 
{{bc|
 
# ln -s /usr/lib/systemd/system/kmsconvt\@.service /etc/systemd/system/autovt\@.service
 
# ln -s /usr/lib/systemd/system/kmsconvt\@.service /etc/systemd/system/autovt\@.service
# systemctl enable kmsconvt\@.service
 
 
}}
 
}}
This will make {{pkg|systemd}} start kmscon instead of agetty on each VT. If for whatever reason kmscon failed to start, then agetty would be started instead.
+
 
 +
This will make {{pkg|systemd}} start kmscon instead of agetty on each VT. More precisely, this will make ''systemd-logind'' use {{ic|kmsconvt@.service}} instead of {{ic|getty@.service}} for new VTs. Additionally, all other systemd units that use {{ic|getty@.service}} will not be affected by this change.
 +
 
 +
If ''kmscon'' cannot start for whatever reason, this unit will cause {{ic|getty@.service}} to be started instead. Furthermore, if no VTs are available, this unit will not start anything.
 +
 
 +
{{Warning|If you've replaced agetty on all terminals, take care to ensure ''kmscon'' presents you with a prompt before rebooting your machine, otherwise you may have to recover through a live CD.}}
  
 
== CJK support ==
 
== CJK support ==
Line 60: Line 69:
 
== Troubleshooting ==
 
== Troubleshooting ==
  
* You may want to add {{ic|--hwaccel --drm}} to ExecStart if you have problems with switching between [[Xorg]] and kmscon.
+
* You may want to add {{ic|hwaccel}} to {{ic|/etc/kmscon/kmscon.conf}} if you have problems with switching between [[Xorg]] and kmscon.
  ExecStart=/usr/bin/kmscon "--vt=%I" --seats=seat0 --no-switchvt --font-name Terminus --font-size 12 --hwaccel --drm
+
The file and folder are not part of the package and therefore have to be created manually. Another possibility would be [[Systemd#Editing provided units|editing the systemd service file]].
* As version 7, if you cannot control the audio, add your user to '''audio''' [[Users and Groups#Group management|group]]. Be aware of th [[Alsa#Installation|shortcomings]] of this choice.
+
* As version 7, if you cannot control the audio, add your user to '''audio''' [[group]]. Be aware of the [[Alsa#Installation|shortcomings]] of this choice.

Latest revision as of 20:44, 13 December 2015

Related articles

From the project's git repository:

Kmscon is a simple terminal emulator based on linux kernel mode setting. It is an attempt to replace the in-kernel VT implementation with a userspace console.

Features

Kmscon can function as a drop-in replacement for the in-kernel linux-console. Features include:

  • Full vt220 to vt510 implementation.
  • Full internationalization support:
    • Kmscon supports printing full Unicode glyphs, including the CJK ones.
    • Kmscon provides internationalized keyboard handling through libxkbcommon, thus allowing it to use the full range of keyboard layouts supported in X keyboard.
  • Hardware accelerated rendering.
  • Multi-seat capability.
Note: In order to be able to log into a kmscon console as root, you have to disable the pam_securetty module by removing or commenting out the corresponding line in /etc/pam.d/login.

Install

Despite its name, kmscon is not a hard requirement for KMS. Kmscon supports the following video backends: fbdev (Linux fbdev video backend), drm2d (Linux DRM software-rendering backend), drm3d (Linux DRM hardware-rendering backend). Make sure one of them is available on your system.

Install the kmscon package from the official repositories. Alternatively, you can install the kmscon-gitAUR package from the AUR.

Normally, there is a special systemd configuration for tty1. To be conservative, you can continue to run the traditional agetty on tty1 and only run kmscon on all the other virtual terminals. Or you can run kmscon on both tty1 and the other VTs.

To enable kmscon on tty1, run:

# systemctl disable getty@tty1.service
# systemctl enable kmsconvt@tty1.service

To enable kmscon on all virtual terminals, run:

# ln -s /usr/lib/systemd/system/kmsconvt\@.service /etc/systemd/system/autovt\@.service

This will make systemd start kmscon instead of agetty on each VT. More precisely, this will make systemd-logind use kmsconvt@.service instead of getty@.service for new VTs. Additionally, all other systemd units that use getty@.service will not be affected by this change.

If kmscon cannot start for whatever reason, this unit will cause getty@.service to be started instead. Furthermore, if no VTs are available, this unit will not start anything.

Warning: If you've replaced agetty on all terminals, take care to ensure kmscon presents you with a prompt before rebooting your machine, otherwise you may have to recover through a live CD.

CJK support

Kmscon supports rendering CJK characters through the default font engine pango. However, fontconfig has to be globally configured to map the monospace font alias to proper CJK fonts. For Chinese users, the following template is provided and proved to result in satisfactory Chinese characters rendering:

/etc/fonts/conf.d/99-kmscon.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match>
        <test name="family"><string>monospace</string></test>
        <edit name="family" mode="prepend" binding="strong">
                <string>DejaVu Sans Mono</string>
                <string>WenQuanYi Micro Hei Mono</string>
        </edit>
</match>
</fontconfig>

You need to have ttf-dejavu and wqy-microhei, both available from the official repositories, installed.

Troubleshooting

  • You may want to add hwaccel to /etc/kmscon/kmscon.conf if you have problems with switching between Xorg and kmscon.

The file and folder are not part of the package and therefore have to be created manually. Another possibility would be editing the systemd service file.

  • As version 7, if you cannot control the audio, add your user to audio group. Be aware of the shortcomings of this choice.