Difference between revisions of "Automatic login to virtual console"

From ArchWiki
Jump to: navigation, search
(Fix revision 287586 by Eca (talk))
m (Virtual console: fix tip)
Line 27: Line 27:
 
}}
 
}}
  
{{Tip|The option {{ic|1=Type=idle}} will delay the service startup until all jobs (state change requests to units) are completed. When using {{ic|1=Type=simple}}, the service will be started automatically, but boot-up messages may pollute the login prompt. This option is particularly useful when [[Start X at Login|starting X automatically]]. To use this option, add the following line into {{ic|autologin.conf}}:
+
{{Tip|The option {{ic|1=Type=idle}} will delay the service startup until all jobs (state change requests to units) are completed. When using {{ic|1=Type=simple}}, the service will be started automatically, but boot-up messages may pollute the login prompt. This option is particularly useful when [[Start X at Login|starting X automatically]]. To use this option, add {{ic|1=Type=simple}} into {{ic|autologin.conf}}.}}
Type=simple
+
}}
+
  
 
If you want to use other ''tty'' than ''tty1'' see [[Systemd FAQ#Q:_How_do_I_change_the_number_of_gettys_running_by_default.3F|Systemd FAQ]].
 
If you want to use other ''tty'' than ''tty1'' see [[Systemd FAQ#Q:_How_do_I_change_the_number_of_gettys_running_by_default.3F|Systemd FAQ]].

Revision as of 12:16, 29 December 2013

This article describes how to automatically log in to a virtual console at the end of the boot process. This article only covers console log-ins; see Start X at Login for information about automatic login into Xorg.

Configuration

Configuration relies on systemd drop-in files to override the default parameters passed to agetty.

The configuration differs for virtual and serial consoles. In most cases you would want to setup up autologin on virtual console, the one which device name is ttyN, where N is a number. The configuration of the autologin for the serial consoles will be slightly different. Device names of the serial consoles look like ttySN, where N is a number.

Virtual console

Create the following file (and the leading directories):

/etc/systemd/system/getty@tty1.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin username --noclear %I 38400 linux
Tip: The option Type=idle will delay the service startup until all jobs (state change requests to units) are completed. When using Type=simple, the service will be started automatically, but boot-up messages may pollute the login prompt. This option is particularly useful when starting X automatically. To use this option, add Type=simple into autologin.conf.

If you want to use other tty than tty1 see Systemd FAQ.

Serial console

Create the following file (and the leading directories):

/etc/systemd/system/serial-getty@ttyS0.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin username -s %I 115200,38400,9600 vt102

Tips and tricks

Avoiding unnecessary dmesg errors

To avoid errors related to display-manager.service in dmesg, you should set the default target to multi-user instead of graphical:

# systemctl enable multi-user.target

See also