Difference between revisions of "Automatic login to virtual console"

From ArchWiki
Jump to: navigation, search
m (Service: add templates)
(all information available in getty via https://wiki.archlinux.org/index.php?title=Getty&diff=440522&oldid=440520)
(57 intermediate revisions by 30 users not shown)
Line 1: Line 1:
[[Category:Boot process]]
#REDIRECT: [[Getty#Automatic_login_to_virtual_console]]
[[es:Automatic login to virtual console]]
[[it:Automatic login to virtual console]]
{{Article summary start}}
{{Article summary text|Describes how to automatically log in to a virtual console.}}
{{Article summary heading|Related}}
{{Article summary wiki|Display Manager}}
{{Article summary wiki|Silent boot}}
{{Article summary wiki|Start X at Login}}
{{Article summary end}}
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; methods for starting an [[Xorg|X server]] are described in [[Start X at Login]].
== Service ==
Create a new service file similar to {{ic|getty@.service}} by copying it to {{ic|/etc/systemd/system/}}:
# cp /usr/lib/systemd/system/getty@.service /etc/systemd/system/autologin@.service
{{Note|{{ic|/etc/systemd/system/}} takes precedence over {{ic|/usr/lib/systemd/system/}}.}}
Then change the {{ic|ExecStart}} line to include the {{ic|-a ''USERNAME''}} parameter:
ExecStart=-/sbin/agetty --noclear -a ''USERNAME'' %I 38400
{{Tip|It is possible to change {{ic|1=Type=idle}} to {{ic|1=Type=simple}} and avoid delaying the execution of agetty until all jobs (state change requests to units) are completed. This option is more useful when [[Start X at Login|starting X automatically]]. See {{ic|man systemd.service}} for more info. {{Note|{{ic|1=Type=simple}} can cause systemd boot-up messages to pollute the login prompt.}}}}
{{Note|If you are using mingetty, simply replace {{ic|/sbin/agetty}} to {{ic|/sbin/mingetty}}.}}
Finally, you need to disable the old {{ic|getty@tty''X''.service}} for the specified tty and enable the new {{ic|autologin@tty''X''.service}}. For example,
# systemctl daemon-reload
# systemctl disable getty@''tty1''
# systemctl enable autologin@''tty1''
# systemctl start autologin@''tty1''
{{Warning|If you are currently in an X session on the same tty configured in the service file, starting {{ic|autologin@tty''X''.service}} will kill your X server.}}
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===
* [[Systemd#Change_default_target_to_boot_into|Change default runlevel/target to boot into]].

Latest revision as of 12:48, 17 August 2016