You are not logged in.
Hello everybody,
I'm looking for a solution for a very specific problem:
My HTPC shall boot directly into KODI and use automatic login into a virtual console with a given username and then start XFCE.
In short:
Autologin -> automatic start of X in .bash_profile -> automatic start of XFCE in .xinitrc.
Problem:
When booting, I see the normal boot messages. Then the automatic login happens, it begins to start X and then the screen goes black and hangs for circa 1 minute after the autologin. After that, Xorg and XFCE start to the desktop, but the delay of one minute is annoying.
Configuration:
I followed this guide for automatic login:
https://wiki.archlinux.org/index.php/Ge … al_console
$ cat /etc/systemd/system/getty@tty1.service.d/override.conf
[Service]
Type=simple
ExecStart=
ExecStart=-/usr/bin/agetty --autologin MyUsername --noclear %I $TERM
Then I followed https://wiki.archlinux.org/index.php/Xi … X_at_login
$ cat ~/.bash_profile
#
# ~/.bash_profile
#
[[ -f ~/.bashrc ]] && . ~/.bashrc
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
exec startx
fi
and at last https://wiki.archlinux.org/index.php/Xfce#Starting
$ cat .xinitrc
# start some nice programs
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# twm &
# xclock -geometry 50x50-1+1 &
# xterm -geometry 80x50+494+51 &
# xterm -geometry 80x20+494-0 &
# exec xterm -geometry 80x66+0+0 -name login
exec startxfce4
I have no clue where I should search for the reason why the start of Xorg takes so long, because there are no error messages in journalctl or dmesg.
Can anybody give me a hint where I can search for the delay of one minute?
Thanks!
Last edited by indianahorst (2019-02-20 22:36:56)
Offline
If you swap xfce for twm, does it still exhibit the delay?
Please paste your Xorg.log.
Offline
If you swap xfce for twm, does it still exhibit the delay?
Please paste your Xorg.log.
I switched from
exec startxfce4
to
exec twm
(after installing extra/xorg-twm) and then I got a complete black screen with a blinking cursor, but no keyboard inputs possible. The same result when renaming .xinitrc to .xinitrc_backup (in this case also TWM should start).
Then I switched to IceWM:
exec icewm-session
which led to an IceWM starting almost immediately after the automatic login.
Here is the Xorg.log with "exec startxfce4" set in xinitrc:
Offline
I'd look through your xfce configs, especially anything in autostart or whatever it is that saves sessions.
(And with twm, you need to start a terminal, eg., xterm as well).
Offline
Here the other Xorg.log with "exec icewm-session" in xinitrc:
Offline
I tried another thing:
Removed
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
exec startx
fi
from .bash_profile and rebooted.
I end up - as expected - logged in as MyUsername on the virtual console.
Then I start "startxfce4" by hand and get the XFCE desktop immediately.
So, it has something to do with the autostart mechanism of .xinitrc?
Offline
A few things could be relevant here, two things to check spring to mind, one is to ensure you have a proper hostname set and there's also a chance that your entropy pool is too low during automated startup and your system hanging on some cryptographic function (by manually logging in, your keyboard input will fill up the entropy pool, bypassing the issue). What's your output for
hostnamectl
and to test the entropy situation, if
lscpu | grep rdrand
gives you output you can try to add random.trust_cpu=on to your kernel parameters otherwise install and enable haveged.
Offline
In the meantime, I tried some other things as deactivating the automatic console login and switching to different Display Managers (tested: nodm and lightdm), but I got the same result: Xorg starts, I can see the mouse pointer, but XFCE starts not before 30 tp 60 seconds.
A few things could be relevant here, two things to check spring to mind, one is to ensure you have a proper hostname set and there's also a chance that your entropy pool is too low during automated startup and your system hanging on some cryptographic function (by manually logging in, your keyboard input will fill up the entropy pool, bypassing the issue). What's your output for
hostnamectl
and to test the entropy situation, if
lscpu | grep rdrand
gives you output you can try to add random.trust_cpu=on to your kernel parameters otherwise install and enable haveged.
Thanks V1del, this was a great hint! It was the entropy pool!
After adding random.trust_cpu=on to the kernel parameters and rebooting, Xorg and XFCE start immediatly and without any delay. Thanks again!
Offline
Glad to hear, it looks like this might get mitigated a bit with the 4.20.11 kernel as that includes https://git.kernel.org/pub/scm/linux/ke … 3f4ce7c7eb so hard disks should contribute to the entropy generation again.
Offline