Automatic Login LXDE

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
tiffe
Posts: 8
Joined: Sun Mar 14, 2021 8:50 pm

Automatic Login LXDE

Post by tiffe »

Hi,
I just want this simple thing:
when I put power on an odroid xu4 it shoot boot and directly login as user (not root) in LXDE desktop.

Why is this that hard?
I tried using option 2 in dietpi-config autostart but this doesn't boot the desktop.
only booting to LightDM works, but that login is pretty unusable without preset login users. Having to type in the user is annoying.

I added another user with useradd and tried the autostart option with that user.
now I have a big problem, dietpie boots directly logged in as this user in console.
How can I logout and change the user now?
when i try "logout" it says "-sh : 1: logout: not found"
when I try sudo commands with this autostarted user it says "user not in sudoers group"

How am I able to get out the autostarted logged in console?
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: Automatic Login LXDE

Post by Joulinar »

Hi,

can you share the error message you are facing with autostart option 2
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
tiffe
Posts: 8
Joined: Sun Mar 14, 2021 8:50 pm

Re: Automatic Login LXDE

Post by tiffe »

when I tried autostart with option 2 with "root" and "dietpi" the error message was a couple of lines long with stuff with things like "x server, display config missing".
With light dm I was able to boot the desktop as it should.
However the main problem now since I set autostart to the new added user it boots directly in the console from which I can't do anything.
because of that I can't post the complete error message.
How can I get back to normal console boot and login as root or dietpi user?
is there a keyboard combo on boot for recovery mode or something that prevents autostart from booting the newly added user?
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: Automatic Login LXDE

Post by Joulinar »

are you able to login via SSH from another device? This way you can login as root and reset the autologin option

Regarding the xserver issue, I guess it's similar to this? https://github.com/MichaIng/DietPi/issues/4192

Beside the xserver issue, at the moment desktop is working as root user only.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
tiffe
Posts: 8
Joined: Sun Mar 14, 2021 8:50 pm

Re: Automatic Login LXDE

Post by tiffe »

SSH helped with the new user problem.
Now I can see the error message when I try autostart with user "dietpi" its the same as in github.
but the workaround doesn't work cause I'm on odroid xu4 not on rpi.
/boot/dietpi/func/dietpi-set_hardware rpi-opengl vc4-kms-v3d-pi4
"info Input name rpi-opengl is not suppotred bau Odroid xu3/xu4.. nothing has been applied"

Joulinar wrote: Sun Mar 14, 2021 10:14 pm Beside the xserver issue, at the moment desktop is working as root user only.
but when I use light dm and login as "dietpi" it works.
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: Automatic Login LXDE

Post by MichaIng »

Note that LightDM does not run as the user you're logging in with, hence the X server it initiated with sufficient permissions in a different way. The autostart option tries to start the X server with exactly that user you chose, which does not work reliably on all boards as non root.

Did you try to add the dietpi user to video and render group: sudo usermod -aG video,render dietpi

I aim to change the autostart options for X applications to use LightDM with a config that makes it start a defined X client with the chosen user. We checked several way to achieve it differently, but either they do not work with every GPU firmware/driver or they imply larger negative security impact: https://github.com/MichaIng/DietPi/issu ... -778864927
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: Automatic Login LXDE

Post by Joulinar »

@tiffe
Are you able to start LXDE using user root? If not, can you post full error message pls.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
tiffe
Posts: 8
Joined: Sun Mar 14, 2021 8:50 pm

Re: Automatic Login LXDE

Post by tiffe »

Joulinar wrote: Tue Mar 16, 2021 9:45 am @tiffe
Are you able to start LXDE using user root? If not, can you post full error message pls.
this is the error that shows up when I use autostart option 2 as user root:
20210318_202320.jpg
User avatar
Joulinar
Posts: 4249
Joined: Sat Nov 16, 2019 12:49 am

Re: Automatic Login LXDE

Post by Joulinar »

Plus can you connect via SSH and provide the log file. The name is specified on the last lines of the error message
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2783
Joined: Sat Nov 18, 2017 6:21 pm

Re: Automatic Login LXDE

Post by MichaIng »

Just to assure, this was now as root user? The autostart option btw currently does nothing more than calling startx, so for testing with different users. As root user this should definitely work, as other user depending on the system video and/or render group membership are required, tty group membership at least when calling startx from e.g. an SSH session to start the X server on the main screen. Further installing apt install xserver-xorg-legacy might further help and on some cases this works only when configuring it to basically start the X server as root. In that last case, going with LightDM autologin is the better solution from security perspective.
Post Reply