Ubuntu: auto-login/startx/with no display manager

Опубликовано: 14 Июнь 2026
на канале: MiyoLinux
3,141
27

In this video, I show how to boot straight into your Ubuntu system and automatically logging in via startx.
Many thanks to Head_on_a_Stick. See his instructions here...
https://forums.debian.net/viewtopic.p...
____________________________________________________________


Instructions:
For automatic login, run this command in a terminal (as root):

systemctl edit getty@tty1

Then enter this text and save the file...

[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin $username --noclear %I $TERM

NOTE: replace $username with your user name; such as, if your name is John, replace $username with john so that the line reads as...
ExecStart=-/sbin/agetty --autologin john --noclear %I $TERM
_____________________________________________________________

For automatic `startx`, add this to the end of the ~/.profile file...

[ "$(tty)" = "/dev/tty1" ] && exec startx
_____________________________________________________________

Finally, set the correct default.target to ensure the system boots to the console (TTY) rather than to a display manager by entering this command in a terminal (as root)...

systemctl set-default multi-user.target


To reverse this change, reset the default.target with:

systemctl set-default graphical.target