Automatic Login LXDE

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?

Hi,

can you share the error message you are facing with autostart option 2

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?

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.

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”


but when I use light dm and login as “dietpi” it works.

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/issues/3586#issuecomment-778864927

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:

Plus can you connect via SSH and provide the log file. The name is specified on the last lines of the error message

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.



root@DietPi:~# cat /var/log/Xorg.0.log
[    22.231] 
X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
[    22.231] Build Operating System: Linux 4.19.0-12-armmp-lpae armv7l Debian
[    22.231] Current Operating System: Linux DietPi 4.14.180+ #1 SMP PREEMPT Tue Oct 13 13:28:54 UTC 2020 armv7l
[    22.232] Kernel command line: console=tty1 console=ttySAC2,115200n8 root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro fsck.repair=yes net.ifnames=0 drm_kms_helper.edid_firmware=edid/1280x1024.bin smsc95xx.macaddr=00:1e:06:61:7a:72 governor=performance hdmi_tx_amp_lvl=31 hdmi_tx_lvl_ch0=3 hdmi_tx_lvl_ch1=3 hdmi_tx_lvl_ch2=3 hdmi_tx_emp_lvl=6 hdmi_clk_amp_lvl=31 hdmi_tx_res=0 HPD=true vout=hdmi  s5p_mfc.mem=16M
[    22.232] Build Date: 01 December 2020  05:59:57PM
[    22.232] xorg-server 2:1.20.4-1+deb10u2 (https://www.debian.org/support) 
[    22.232] Current version of pixman: 0.36.0
[    22.232] 	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
[    22.232] Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    22.233] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Mar 20 20:30:51 2021
[    22.236] (==) Using config file: "/etc/X11/xorg.conf"
[    22.237] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    22.237] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    22.240] (==) ServerLayout "DefaultLayout"
[    22.240] (**) |-->Screen "Default Screen" (0)
[    22.240] (**) |   |-->Monitor "<default monitor>"
[    22.241] (**) |   |-->Device "Mali-Fbdev"
[    22.241] (==) No monitor specified for screen "Default Screen".
	Using a default monitor configuration.
[    22.241] (**) Option "BlankTime" "0"
[    22.241] (**) Option "StandbyTime" "0"
[    22.241] (**) Option "SuspendTime" "0"
[    22.241] (**) Option "OffTime" "0"
[    22.241] (==) Automatically adding devices
[    22.241] (==) Automatically enabling devices
[    22.241] (==) Automatically adding GPU devices
[    22.241] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    22.246] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    22.246] 	Entry deleted from font path.
[    22.246] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist.
[    22.246] 	Entry deleted from font path.
[    22.246] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist.
[    22.246] 	Entry deleted from font path.
[    22.246] (WW) The directory "/usr/share/fonts/X11/Type1" does not exist.
[    22.246] 	Entry deleted from font path.
[    22.246] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist.
[    22.246] 	Entry deleted from font path.
[    22.246] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist.
[    22.246] 	Entry deleted from font path.
[    22.246] (==) FontPath set to:
	/usr/share/fonts/X11/misc,
	built-ins
[    22.246] (==) ModulePath set to "/usr/lib/xorg/modules"
[    22.246] (**) Extension "DPMS" is disabled
[    22.246] (II) The server relies on udev to provide the list of input devices.
	If no devices become available, reconfigure udev or disable AutoAddDevices.
[    22.246] (II) Loader magic: 0x61af98
[    22.246] (II) Module ABI versions:
[    22.246] 	X.Org ANSI C Emulation: 0.4
[    22.246] 	X.Org Video Driver: 24.0
[    22.246] 	X.Org XInput driver : 24.1
[    22.246] 	X.Org Server Extension : 10.0
[    22.248] (++) using VT number 1

[    22.251] (II) systemd-logind: took control of session /org/freedesktop/login1/session/_31
[    22.253] (II) xfree86: Adding drm device (/dev/dri/card0)
[    22.254] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 11 paused 0
[    22.254] (II) no primary bus or device found
[    22.254] 	falling back to /sys/devices/platform/exynos-drm/drm/card0
[    22.254] (II) LoadModule: "glx"
[    22.256] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    22.277] (II) Module glx: vendor="X.Org Foundation"
[    22.277] 	compiled for 1.20.4, module version = 1.0.0
[    22.277] 	ABI class: X.Org Server Extension, version 10.0
[    22.277] (II) LoadModule: "armsoc"
[    22.278] (II) Loading /usr/lib/xorg/modules/drivers/armsoc_drv.so
[    22.280] (II) Module armsoc: vendor="X.Org Foundation"
[    22.280] 	compiled for 1.20.4, module version = 1.4.1
[    22.280] 	Module class: X.Org Video Driver
[    22.280] 	ABI class: X.Org Video Driver, version 24.0
[    22.280] (II) ARMSOC: Driver for ARM Mali compatible chipsets
[    22.280] (WW) Falling back to old probe method for armsoc
[    22.281] (II) No BusID or DriverName specified - opening /dev/dri/card0
[    22.281] (EE) ERROR: Cannot set the DRM interface version.
[    22.281] (EE) ERROR: Cannot open a connection with the DRM - Permission denied
[    22.281] (WW) Falling back to old probe method for armsoc
[    22.281] (II) No BusID or DriverName specified - opening /dev/dri/card0
[    22.281] (EE) ERROR: Cannot set the DRM interface version.
[    22.281] (EE) ERROR: Cannot open a connection with the DRM - Permission denied
[    22.281] (EE) No devices detected.
[    22.281] (EE) 
Fatal server error:
[    22.281] (EE) no screens found(EE) 
[    22.281] (EE) 
Please consult the The X.Org Foundation support 
	 at http://wiki.x.org
 for help. 
[    22.281] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    22.281] (EE) 
[    22.292] (EE) Server terminated with error (1). Closing log file.



Yes this is using Autostart “option 2” with user “root”

[ 22.281] (EE) ERROR: Cannot open a connection with the DRM - Permission denied

This as root is strange indeed. The same error happens when you run startx from console?
What does the following show?

ls -l /dev/dri/card0

wow permission denied for user root. That’s quite a secure system :wink:

Sorry for the joke :stuck_out_tongue: