getty
A getty is the generic name for a program which manages a terminal line and its connected terminal. Its purpose is to protect the system from unauthorized access. Generally, each getty process is started by systemd and manages a single terminal line.
Installation
agetty is the default getty in Arch Linux, as part of the util-linux package. It modifies the TTY settings while waiting for a login so that the newlines are not translated to CR-LFs. This tends to cause a "staircase effect" for messages printed to the console. Agetty manages virtual consoles and six of these virtual consoles are provided by default in Arch Linux. They are usually accessible by pressing Ctrl+Alt+F1 through Ctrl+Alt+F6.
Alternatives include:
- fbgetty — A console getty like mingetty, which supports framebuffers.
- mgetty — A versatile program to handle all aspects of a modem under Unix.
Add additional virtual consoles
Open the file and set the option NAutoVTs=6 to the number of virtual terminals that you want at boot.
If needed, it is possible to temporarily start a service directly.
Automatic login to virtual console
Configuration relies on systemd drop-in files to override the default parameters passed to agetty.
Configuration differs for virtual versus serial consoles. In most cases, you want to set up automatic login on a virtual console, (whose device name is , where is a number). The configuration of automatic login for serial consoles will be slightly different. Device names of the serial consoles look like ttySN, where is a number.
Virtual console
Create a drop-in file for with the following contents:
If you do not want full automatic login, but also do not want to type your username, see #Prompt only the password for a default user in virtual console login.
If you want to use a tty other than tty1, see systemd FAQ.
Serial console
Create a drop-in file:
Nspawn console
To configure auto-login for a systemd-nspawn container, override console-getty.service by creating a drop-in file:
If method is used to access the container, also adjust the template that manages pts/[0-9] pseudo ttys:
Prompt only the password for a default user in virtual console login
Getty can be used to login from a virtual console with a default user, typing the password but without needing to insert the username. For instance, to prompt the password for on :
and then enable .
Have boot messages stay on tty1
By default, Arch has the service enabled. The service file already passes , which stops agetty from clearing the screen. However systemd clears the screen before starting it. To disable this behavior, create a drop-in file:
- Make sure to remove
quietfrom the kernel parameters. - Late KMS starting may cause the first few boot messages to clear. See KMS#Early KMS start or KMS#Disabling modesetting.