Will it startx from a console log in?milomak wrote:it boots into x when it's set to graphical.target
Auto login and `startx` without a display manager (systemd)
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 135 times
Re: Auto login and `startx` without a display manager -- jes
deadbang
Re: Auto login and `startx` without a display manager — jess
yes startx works when it loads into console
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 135 times
Re: Auto login and `startx` without a display manager — jess
Can we see:
Code: Select all
systemctl cat getty@tty1
deadbang
Re: Auto login and `startx` without a display manager — jess
sure
Code: Select all
$ systemctl cat getty@tty1
# /lib/systemd/system/getty@.service
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
After=systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes
# IgnoreOnIsolate causes issues with sulogin, if someone isolates
# rescue.target or starts rescue.service from multi-user.target or
# graphical.target.
Conflicts=rescue.service
Before=rescue.service
# On systems without virtual consoles, don't start any getty. Note
# that serial gettys are covered by serial-getty@.service, not this
# unit.
ConditionPathExists=/dev/tty0
[Service]
# the VT is cleared by TTYVTDisallocate
ExecStart=-/sbin/agetty --noclear %I $TERM
Type=idle
Restart=always
RestartSec=0
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes
# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELE
[Install]
WantedBy=getty.target
DefaultInstance=tty1
# /etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin mythtv --noclear %I $TERM
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 135 times
Re: Auto login and `startx` without a display manager — jess
Does the autologin itself work?
Try removing the `startx` line from ~/.profile and see if it will autologin to a TTY command line.
You could also try this logic in ~/.profile instead of the line you are using now:
That doesn't rely on $XDG_VTNR or $DISPLAY.
EDIT: the Xorg logs will be found in ~/.local/share/xorg/Xorg.0.log because the server is being run as your normal user
Try removing the `startx` line from ~/.profile and see if it will autologin to a TTY command line.
You could also try this logic in ~/.profile instead of the line you are using now:
Code: Select all
[ "$(tty)" = "/dev/tty1" ] && exec startx /usr/bin/kodi
EDIT: the Xorg logs will be found in ~/.local/share/xorg/Xorg.0.log because the server is being run as your normal user
deadbang
Re: Auto login and `startx` without a display manager — jess
Head_on_a_Stick, thank you!
FWIW, I can confirm that the procedure works, without modification, for my system running BunsenLabs Helium (i.e. ~Debian Stretch).
Makes for a real fast boot-to-GUI -- and near-instant resume from Suspend! Ideal for an older computer mainly used as an internet tv.
No upgrade-proofness tested yet.
[NB: To anyone else who initially mistypes their username in the override.conf file (no capital letters! ), and reboots to find only a blinking cursor: don't panic; hit Ctl+Alt+F2 to open an auxiliary terminal; login with the correct username and password; optionally start the GUI by typing startx; fix the typo in the file; reboot; enjoy the smoothness.]
FWIW, I can confirm that the procedure works, without modification, for my system running BunsenLabs Helium (i.e. ~Debian Stretch).
Makes for a real fast boot-to-GUI -- and near-instant resume from Suspend! Ideal for an older computer mainly used as an internet tv.
No upgrade-proofness tested yet.
[NB: To anyone else who initially mistypes their username in the override.conf file (no capital letters! ), and reboots to find only a blinking cursor: don't panic; hit Ctl+Alt+F2 to open an auxiliary terminal; login with the correct username and password; optionally start the GUI by typing startx; fix the typo in the file; reboot; enjoy the smoothness.]
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 135 times
Re: Auto login and `startx` without a display manager — jess
BunsenWhat?Peripatus wrote:I can confirm that the procedure works, without modification, for my system running BunsenLabs Helium (i.e. ~Debian Stretch).
But anyway, yes, I've had it working in stretch and buster as well so I've changed the OP to reflect this.
deadbang
Re: Auto login and `startx` without a display manager — jess
Are you kidding me? Just noticed a rather active head on a stick over at the BunsenLabs forums...Head_on_a_Stick wrote: BunsenWhat?
Either way, I installed it just recently -- it's wonderful!
cheerio
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 135 times
Re: Auto login and `startx` without a display manager — jess
Not any morePeripatus wrote:rather active
deadbang
Re: Auto login and `startx` without a display manager — jess
Oh Should we take heed?Head_on_a_Stick wrote:Not any morePeripatus wrote:rather active
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 135 times
Re: Auto login and `startx` without a display manager — jess
No, not at all, BL is one of the more excellent distributions out there, I just prefer vanilla DebianPeripatus wrote:Should we take heed?
deadbang
Re: Auto login and `startx` without a display manager (syste
I like how you dealt with issuing the startx command:
You negated the need for an 'if' command—clever! Always nice to do a command as efficiently as possible!
Thanx!
Code: Select all
[ "$(tty)" = "/dev/tty1" ] && exec startx
Thanx!
Re: Auto login and `startx` without a display manager (syste
It's work , but now i see this in auth.log
i'm using debian 10 with mate desktop.
EDIT:
fixed with https://wiki.archlinux.org/index.php/GN ... PAM_method
Code: Select all
gnome-keyring-daemon[640]: couldn't access control socket: /run/user/1000/keyring/control: No such file or directory
EDIT:
fixed with https://wiki.archlinux.org/index.php/GN ... PAM_method
Re: Auto login and `startx` without a display manager (syste
Hello All,
I followed the original howto and it worked fine for me with Debian 10.1 + Enlightenment DR16. I wanted to go further, though, and I don't know where to look at. My ultimate goal is to have the same Plymouth "theme" as I have in Enlightenment in that way the auto-logon executes and X starts at "the background" of the Plymouth skin (I see the Plymouth boot screen during the whole time and don't see any console output until I finally arrive to my E desktop) and when E16 starts I'd start also screen lock - this would effectively replace any DM for me but also gives some security measures.
My "very big" problem is that when bootup finishes, Plymouth closes the bootup screen and I can see the console autologin, including hostname and "Last login" lines. (Of course I could hide startx messages and motd easily.)
I understand that starting X includes changing the video driver and screen resolution so I don't expect a seamless transition from Plymouth screen to X's screen but I want to make this transition as smooth as possible (e.g. black screen for a second is OK). I couldn't find agetty parameter that suppress output and putting " > /dev/null 2&1" at the end of the systemd override file Exec line didn't help.
Do you have a tip where I should continue, please?
Thanks,
Mr 0wl
I followed the original howto and it worked fine for me with Debian 10.1 + Enlightenment DR16. I wanted to go further, though, and I don't know where to look at. My ultimate goal is to have the same Plymouth "theme" as I have in Enlightenment in that way the auto-logon executes and X starts at "the background" of the Plymouth skin (I see the Plymouth boot screen during the whole time and don't see any console output until I finally arrive to my E desktop) and when E16 starts I'd start also screen lock - this would effectively replace any DM for me but also gives some security measures.
My "very big" problem is that when bootup finishes, Plymouth closes the bootup screen and I can see the console autologin, including hostname and "Last login" lines. (Of course I could hide startx messages and motd easily.)
I understand that starting X includes changing the video driver and screen resolution so I don't expect a seamless transition from Plymouth screen to X's screen but I want to make this transition as smooth as possible (e.g. black screen for a second is OK). I couldn't find agetty parameter that suppress output and putting " > /dev/null 2&1" at the end of the systemd override file Exec line didn't help.
Do you have a tip where I should continue, please?
Thanks,
Mr 0wl
- wizard10000
- Global Moderator
- Posts: 1087
- Joined: 2019-04-16 23:15
- Location: southeastern us
- Has thanked: 117 times
- Been thanked: 189 times
Re: Auto login and `startx` without a display manager — jess
Same. My openbox install still uses a (slightly modified) #! themeHead_on_a_Stick wrote:No, not at all, BL is one of the more excellent distributions out there, I just prefer vanilla Debian
we see things not as they are, but as we are.
-- anais nin
-- anais nin
Re: Auto login and `startx` without a display manager (syste
I somewhat solved the above.mrowl wrote:My ultimate goal is to have the same Plymouth "theme" as I have in Enlightenment in that way the auto-logon executes and X starts at "the background" of the Plymouth skin (I see the Plymouth boot screen during the whole time and don't see any console output until I finally arrive to my E desktop)
/etc/systemd/system/getty@.service.d/override.conf:
Code: Select all
[Service]
ExecStart=
ExecStart=-/sbin/agetty -i -J --nohostname --skip-login --login-options "-f <username>" %I 38400 linux
Now I only need to figure out how I can keep plymouth background on the screen further.
Re: Auto login and `startx` without a display manager (systemd)
Excellent information Thank you Head-on-a-stick.
I have just followed your instructions and works perfectly on my Debian "trixie" system.
So I was able to bin LightDM and Plymouth neither of which does anything useful.
I
I have just followed your instructions and works perfectly on my Debian "trixie" system.
So I was able to bin LightDM and Plymouth neither of which does anything useful.
I
-
- Posts: 188
- Joined: 2008-07-30 15:16
- Location: Usa
- XMMP/Jabber: darbarritesh@rediffmail.com
- Has thanked: 1 time
- Contact:
Re: Auto login and `startx` without a display manager (systemd)
Works perfectly on Xubuntu. Tried other methods. They either failed or took too long to boot up.
Re: Auto login and `startx` without a display manager -- jes
@Head_on_a_Stick this does not seem to be ion the op. was there a reason why not?Head_on_a_Stick wrote: ↑2016-05-21 20:18OK, thanks for bringing that up.milomak wrote:I am finding after doing updates (using sid), thatreverts to default.Code: Select all
/etc/systemd/system/getty.target.wants/getty@tty1.service
My original method is a tad on the hacky side
For a more "correct" solution, create a file at /etc/systemd/system/getty@tty1.service.d/override.conf with the following content:This can be used instead of modifying the unit file and should survive upgradesCode: Select all
[Service] ExecStart= ExecStart=-/sbin/agetty --autologin <user name> --noclear %I $TERM
EDIT: Note added to the end of the OP.
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid
-
- Posts: 17
- Joined: 2024-04-04 01:53
- Has thanked: 4 times
Re: Auto login and `startx` without a display manager (systemd)
From the "master post" on the first page:
1. I am SUGGESTING a change to @Head_on_a_stick's "master" HOW-TO back on page 1 of this topic.
I'll say first that I'm not sure this change is correct for everyone, BUT this is what worked for me on my 'bookworm' system.
The change:
FROM:
For automatic login, run this command (as root):
TO:
For automatic login, run this command:
Please note that the code in the "TO:" section is from this post in the "lenny" version of this HOW-TO. I suspect that the current (FROM:) version may accomplish the same thing (via "drop-in file"?), but the instructions in the file were unclear to me - as many things are in 'systemd'.
2. Regarding the applicability of this "AutoLogin" recipe:
I have recently begun using `pipewire` to get Bluetooth Audio from my Raspberry Pi system. I use the 'Lite' version of their OS, and its Bluetooth features are, uh... primitive. `pipewire` has been a lifesaver, but it has one irritating "feature": When the user that started the music is logged out, `pipewire` "quits"; i.e. the music stops. I thought an "AutoLogin" would cure that issue, and I began searching for a solution when I found this (and the older "lenny" version) thread. I'd love to hear from anyone who's found another solution to the `pipewire` issue, but I can say that this (AutoLogin) works fine.
3. All that said, I am unclear why this (autologin) cannot be done as a simple `cron` job under `@reboot`. I've tried this on my "headless" Raspberry Pi; 'who' shows the user (pi) logged in on tty1, but it doesn't seem to be able to stop pipewire from quittin when pi logs out Too bad... I'll keep trying. It would certainly be much easier to edit the root crontab than a systemd unit file!
But it's not enough to keep `pipewire` from shutting down.
I have three (3) things to add:Head_on_a_Stick wrote: ↑2015-07-18 01:06 This Howto is aimed at users who wish to automatically login to their Debian stable system and start the X server without having to enter startx at the command prompt.
It is primarily aimed at users of simple window manager environments rather then those who prefer fully-blown desktop environments as the latter usually have integrated display mangers to perform this function.
This guide only applies to those users who chose to run systemd as their init system.
If you have chosen to use SysVinit as PID1, refer to the "traditional" guides such as http://forums.debian.net/viewtopic.php?f=16&t=29333
This guide assumes an ability to edit system configuration files that may require root permissions to alter and will require correct configuration of the X server initialisation files at ~/.xsession or ~/.xinitrc (see startx(1) for more on this). If no ~/.xinitrc or ~/.xsession file is present then whatever is linked to /etc/alternatives/x-session-manager or /etc/alternatives/x-window-manager will be run instead (use the update-alternatives(1) command to change these).
For automatic login, run this command (as root):Then enter this text and save the file afterwards:Code: Select all
systemctl edit getty@tty1
Replace $username with your user name.Code: Select all
[Service] ExecStart= ExecStart=-/sbin/agetty --autologin $username --noclear %I $TERM
For automatic `startx` add this snippet to the end of the file at ~/.profile:Finally, set the correct default.target to ensure the system boots to the console (TTY) rather than to a display manager:Code: Select all
[ "$(tty)" = "/dev/tty1" ] && exec startx
To reverse this change, reset the default.target with:Code: Select all
# systemctl set-default multi-user.target
Code: Select all
# systemctl set-default graphical.target
1. I am SUGGESTING a change to @Head_on_a_stick's "master" HOW-TO back on page 1 of this topic.
I'll say first that I'm not sure this change is correct for everyone, BUT this is what worked for me on my 'bookworm' system.
The change:
FROM:
For automatic login, run this command (as root):
Code: Select all
systemctl edit getty@tty1
For automatic login, run this command:
Code: Select all
sudo vim /etc/systemd/system/getty.target.wants/getty@tty1.service
2. Regarding the applicability of this "AutoLogin" recipe:
I have recently begun using `pipewire` to get Bluetooth Audio from my Raspberry Pi system. I use the 'Lite' version of their OS, and its Bluetooth features are, uh... primitive. `pipewire` has been a lifesaver, but it has one irritating "feature": When the user that started the music is logged out, `pipewire` "quits"; i.e. the music stops. I thought an "AutoLogin" would cure that issue, and I began searching for a solution when I found this (and the older "lenny" version) thread. I'd love to hear from anyone who's found another solution to the `pipewire` issue, but I can say that this (AutoLogin) works fine.
3. All that said, I am unclear why this (autologin) cannot be done as a simple `cron` job under `@reboot`. I've tried this on my "headless" Raspberry Pi; 'who' shows the user (pi) logged in on tty1, but it doesn't seem to be able to stop pipewire from quittin when pi logs out Too bad... I'll keep trying. It would certainly be much easier to edit the root crontab than a systemd unit file!
Code: Select all
$ sudo crontab -e
# add this one line:
@reboot /sbin/agetty -a pi --noclear tty1 linux
# afterwards, from my terminal:
$ who
pi tty1 1970-01-06 16:57
pi pts/0 -3386239902218181070 (192.168.1.209)