Autologon to desktop as user

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Brezel

Autologon to desktop as user

Post by Brezel »

Hi,

I had problems with armbian and unofficial jessie images for my Odroid-C2, so I want to try out dietpc.
Everything good so far and easy to setup except that I need to get the odroid to logon to desktop automatically at startup AS USER NOT ROOT.
How do I do that?

thx
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Autologon to desktop as user

Post by Fourdee »

Brezel wrote:Hi,

I had problems with armbian and unofficial jessie images for my Odroid-C2, so I want to try out dietpc.
Everything good so far and easy to setup except that I need to get the odroid to logon to desktop automatically at startup AS USER NOT ROOT.
How do I do that?

thx
Which desktop are you using, and whats the user name?
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Brezel

Re: Autologon to desktop as user

Post by Brezel »

the user is "odroid" and the desktop environment is lxde

thx
kamilmirza
Posts: 13
Joined: Tue Mar 21, 2017 10:13 am

Re: Autologon to desktop as user

Post by kamilmirza »

desperately need this
diet-config autologin option should ask for the non-root user login
and its not great to run Desktop as root

sorry for resurrecting this old thread
User avatar
Sciamano
Posts: 264
Joined: Sat Oct 15, 2016 12:18 pm
Location: Italy

Re: Autologon to desktop as user

Post by Sciamano »

Do you have this file?

Code: Select all

/etc/lightdm/lightdm.conf
If so, you should find the following iine:

Code: Select all

#autologin-user=
Remove the # and change it to have your username at the end. As an example:

Code: Select all

autologin-user=myusername
If you don't have that file... sorry, I have no idea.
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Autologon to desktop as user

Post by Fourdee »

kamilmirza wrote:desperately need this
diet-config autologin option should ask for the non-root user login
and its not great to run Desktop as root

sorry for resurrecting this old thread
Hi,

We are looking to replace root user with non-root user throughout DietPi. This would resolve this thread, please see here for status:
https://github.com/Fourdee/DietPi/issues/796
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
MetalMusicAddict

Re: Autologon to desktop as user

Post by MetalMusicAddict »

Hi folks. So I am following development of this upcoming change however Im wondering if there's a fix in the short-term that will work for me. :) I have several apps (VLC/Chromium) I use that complain about being run as root. :(

What mechanism is "DietPi-AutoStart/2 Desktops: Automatic login (recommended)" using to login root and start X? (file/s to edit?)

Thanx! :)
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Autologon to desktop as user

Post by Fourdee »

MetalMusicAddict wrote:Hi folks. So I am following development of this upcoming change however Im wondering if there's a fix in the short-term that will work for me. :) I have several apps (VLC/Chromium) I use that complain about being run as root. :(

What mechanism is "DietPi-AutoStart/2 Desktops: Automatic login (recommended)" using to login root and start X? (file/s to edit?)

Thanx! :)
Hi,

Try, editing:

Code: Select all

/DietPi/dietpi/login
And replace the following entry for startx:

Code: Select all

                       #Desktop (LXDE/MATE etc)
                        elif (( $AUTO_START_INDEX == 2 )); then

                               sudo -u dietpi startx
Reboot and test.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
chipchap
Posts: 1
Joined: Wed Nov 07, 2018 7:57 pm

Re: Autologon to desktop as user

Post by chipchap »

I've tested this method on my odroid c2 with LXDE
Not working for me, I'm getting Xorg error, permission denied and connection refused, maybe I have to add my user to the sudoers list. Will report on this when I have tested.

I did manage to autologin into my normal unprivileged user by selecting login into lightdm in dietpi-config and adding

Code: Select all

autologin-user=myuser 
to /etc/lightdm/lightdm.conf

However this results in some weird behaviour:
LXDE starts perfectly, showing the desktop for a second and then turning all black.
To regain visuals I have to select the whole desktop space with the mouse, lxde will reapear after I have selected that screen area.
Workable but not ideal, any suggestion more than welcome.

EDIT: added

Code: Select all

myuser=ALL=(ALL:ALL) ALL
to /etc/sudoers

Desktop appears perfect now, but with error:
GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
added LXDE to

Code: Select all

NotShowIn=GNOME;KDE;LXDE;
to /etc/xdg/autostart/lxpolkit.desktop
without result :/
Post Reply