Problems with autologin + startx (Chromium / Xorg)


I’m having problems with autologin testing with a physical computer. It should automatically do a “startx” without prompting me for login. I am using Chromium and Xorg, without a desktop.

I have created the new service similar to “getty@.service” copied from “/etc/systemd/system/”.

Next, I have generated the symbolic path for “tty2”.

test:/etc/systemd/system/ # ls -la
total 4
drwxr-xr-x 2 root root 58 Apr 27 08:43 .
drwxr-xr-x 9 root root 4096 Apr 27 08:41 …
lrwxrwxrwx 1 root root 38 Apr 27 08:43 getty@tty1.service → /usr/lib/systemd/system/getty@.service
lrwxrwxrwx 1 root root 38 Apr 27 08:42 getty@tty2.service → /etc/systemd/system/autologin@.service

The “getty@tty2.service” has changed the “ExecStart” in this way (the user with which it is configured is “henrolos”):

ExecStart=-/sbin/agetty -a henrolos %I 38400

I have checked that the service are started (in fact I did a systemctl start to the service).

And finally, the configuration of “.bashrc” in the path /home/henrolos:

if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty2 ]]; then
    exec startx

I also saw steps of this “solution”: arch linux - How can I autologin to desktop with systemd? - Unix & Linux Stack Exchange

The “.xinitrc” is correct, since when I do the “startx” manually, the browser loads correctly. It is precisely the autologin that is not performed.

The only thing I have achieved is that it keeps asking me to log in when I restart the computer and, when I do “su - henrolos”, it automatically does the “startx”. But what I’m looking for is to directly autologin said user and perform the “startx”.

Would someone know how to help me? Thank you so much.

Any reason you do not use standard autologin feature provided and supported by openSUSE?

Thanks for your time.

The computer is platformed unattended through AutoYast, without any graphical desktop. Do you mean to use the DisplayManager?

If there is no graphical desktop, what are you starting with startx?

Yes, normally graphical autologin is implemented by Display Manger.

When this is a text only system, the package xinit, which provides startx, is not even installed in my experience.

Sorry, maybe I’m expressing wrong. I don’t have a system-level desktop, but I do have Chromium installed, as well as xinit configured.

When I do the “startx”, the browser starts correctly. What I need is for it to do it automatically, without asking me to log in.

I indeed do nt understand your configuration. But when you want that root starts something at boot you normally create a systemd service for it.

Yes, that is what I am trying to do without success. In the initial message you can see that I try to create that autologin service.

Ah, I skipped that more or less because it is very incomplete. You should always post things complete (e.g. not saying: I changed the Execstart …". Including the prompt command (even if it is only catand all output up to and including the next prompt.
This due to our inability to read minds or look over your shoulder. We want to see what you see.


henk@boven:~> uname -r

It shows who I am, my working directory, what I did, what I got and that it is complete.

Did you try to switch to tty2 and look at the output? /bin/login still goes via PAM and default configuration of PAM for login is using pam_unix which requires user to have (and provide) password.

You could override PAM configuration for login to allow NULL password, but it will apply to any user and you cannot override PAM service name for /bin/login. But for testing it could be OK.

Of course execing startx out of ~/.bashrc simply makes it impossible to run any interactive shell for this user.

It sounds like you are after kiosk mode, I am sure there are different, more complete, solutions.