Bhuck7d4
Posts: 10
Joined: Tue Jun 25, 2019 8:16 am

[Solved] Auto login with piServer

Wed Oct 02, 2019 3:24 pm

Dear all,

I' m desperately trying to auto login a user on a piServer client. I followed the instructions given in the thread https://github.com/raspberrypi/piserver/issues/11 but it does not work at all.

Looks like the /home/pi is not owned by user following the error message I get.

Has someone actually already succeeded with auto login a user on the client ?

Cheers,
Last edited by Bhuck7d4 on Fri Oct 18, 2019 11:58 am, edited 2 times in total.

incognitum
Posts: 360
Joined: Tue Oct 30, 2018 3:34 pm

Re: Auto login with piServer

Wed Oct 02, 2019 4:30 pm

Bhuck7d4 wrote:
Wed Oct 02, 2019 3:24 pm
Looks like the /home/pi is not owned by user following the error message I get.
Try if it works better if you explicitly set the user id of the pi user in /etc/fstab , among the lines of:

Code: Select all

tmpfs           /home/pi           tmpfs   defaults,uid=1000,gid=1000,mode=700            0       0
(assuming pi is first user, in which case it would be uid 1000)

Bhuck7d4
Posts: 10
Joined: Tue Jun 25, 2019 8:16 am

Re: Auto login with piServer

Thu Oct 03, 2019 7:42 am

Many thanks for your prompt answer, but unfortunately this doesn't work either.

I don't have the same message anymore, but the auto login still hangs. When I manually log in using an alternate TTY, I get the following error :

(mount.c:72) : Messages from underlying mount program:
(mount.c:76) : read: Connection reset by peer
(pam_mount.c:522): mount of pi@piserver: failed

I can't figure out why at that stage.

I really hope auto login is possible with piServer (I don't care about persistant data, I just need auto login and being able to display a browser).

Cheers,
Last edited by Bhuck7d4 on Wed Oct 16, 2019 1:35 pm, edited 1 time in total.

incognitum
Posts: 360
Joined: Tue Oct 30, 2018 3:34 pm

Re: Auto login with piServer

Thu Oct 03, 2019 10:09 am

Bhuck7d4 wrote:
Thu Oct 03, 2019 7:42 am
(mount.c:72) : Messages from underlying mount program:
(mount.c:76) : read: Connection reset by peer
(pam_mount.c:522): mount of pi@piserver: failed
Double check you also followed this part of the instructions:
Disable mounting of the home folder on the central server, by renaming the pam_mount configuration file to something else:

mv /etc/security/pam_mount.conf.xml /etc/security/pam_mount.disabled

Bhuck7d4
Posts: 10
Joined: Tue Jun 25, 2019 8:16 am

Re: Auto login with piServer

Thu Oct 03, 2019 2:11 pm

Thank again for your help, much appreciated.

I did the modification but since I renamed the configuration file, I get the following error:

I/O warning : failed to load external entity "/etc/security/pam_mount.conf.xml"
(rdconf1.c:388): libxml detected a syntax error in /etc/security/pam_mount.conf.xml

In parallel, the boot process remains stuck at prompt step, displaying --noclear (automatic login)

:?


Cheers,
Last edited by Bhuck7d4 on Wed Oct 16, 2019 1:34 pm, edited 1 time in total.

Bhuck7d4
Posts: 10
Joined: Tue Jun 25, 2019 8:16 am

Re: Auto login with piServer

Thu Oct 03, 2019 3:17 pm

Hi again,

Going further, I finally succeeded with auto login, but only in CLI. Hereafter the full procedure I followed, if this can helps :


$ cd /etc/security/
$ cp pam_mount.conf.xml pam_mount.conf.xml.ori
$ vi pam_mount.conf.xml

Remove everything except :

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE pam_mount SYSTEM "pam_mount.conf.xml.dtd">
<pam_mount>
</pam_mount>

Save and exit

$ adduser pi (or any username you want to use)

$ vi /etc/fstab

# tmpfs /home tmpfs defaults,mode=755 0 0
tmpfs /home/pi tmpfs defaults,uid=1000,gid=1000,mode=755 0 0

Note: ensure pi's uid/gid is 1000 (should be if pi is the first user created on the system - if any doubt cat /etc/passwd)

Save and exit

Launch raspi-config to enable auto login
raspi-config --> Boot Options --> Console Autologin

$ cd /etc/systemd/system/getty@tty1.service.d

$ vi autologin.conf

Indicate the user created previously as an argument:

ExecStart=-/sbin/agetty --autologin pi --noclear %I xterm

Save and exit


I will dig into this issue further in order to enable Desktop auto login as well.

incognitum
Posts: 360
Joined: Tue Oct 30, 2018 3:34 pm

Re: Auto login with piServer

Thu Oct 03, 2019 4:17 pm

Bhuck7d4 wrote:
Thu Oct 03, 2019 2:11 pm
I did the modification but since I renamed the configuration file, I get the following error:

I/O warning : failed to load external entity "/etc/security/pam_mount.conf.xml"
(rdconf1.c:388): libxml detected a syntax error in /etc/security/pam_mount.conf.xml

In parallel, the boot process remains stuck at prompt step, displaying --noclear (automatic login)
Ah, did not notice that, as I only ever tested GUI auto-login and with that warnings like that were conveniently swept under the carpet. :)
Proper way is probably to remove the entire module with "apt-get purge libpam-mount" then.

Not sure why GUI auto-login no longer works now though.
May be able to investigate, but suggest waiting until a Piserver Buster image is released first, as odd issues like this are often version specific.

mleffler
Posts: 11
Joined: Thu Oct 03, 2019 4:47 pm

Re: Auto login with piServer

Thu Oct 03, 2019 5:04 pm

Bhuck7d4 wrote:
Wed Oct 02, 2019 3:24 pm
I' m desperately trying to auto login a user on a piServer client. I followed the instructions given in the thread https://github.com/raspberrypi/piserver/issues/11 but it does not work at all.
I followed this and it was successful for me. I initially had issues because I didn't notice the addition of "pi" to /home in /etc/fstab:

Code: Select all

tmpfs           /home/pi           tmpfs   defaults            0       0
I would autologin in tty1, but couldn't login on the gui.
Besides the pam_mount IO error I would also have a "no directory logging in with home=/" error.

Make sure you're removing "mode=755" from the /etc/fstab entry.

Bhuck7d4
Posts: 10
Joined: Tue Jun 25, 2019 8:16 am

Re: Auto login with piServer

Wed Oct 16, 2019 1:08 pm

Hi there !

Coming back on my autologin capability, I'm still struggling being unable to get it work when using GUI.

If someone has any clue, would be very helpful. I don't really know what is wrong in my procedure described above to get it work with the desktop mode.

Cheers !

mleffler
Posts: 11
Joined: Thu Oct 03, 2019 4:47 pm

Re: Auto login with piServer

Wed Oct 16, 2019 1:56 pm

I would start with a fresh install of Raspbian (not Raspbian Lite) in PiServer.

In the chroot shell for the new install only do the following and then test:

Code: Select all

mv /etc/security/pam_mount.conf.xml /etc/security/pam_mount.disabled
adduser pi
nano /etc/fstab
edit the line:

Code: Select all

tmpfs           /home           tmpfs   defaults,mode=755            0       0
to match:

Code: Select all

tmpfs           /home/pi           tmpfs   defaults            0       0
Run raspi-config and enable Desktop Autologin (Menu Choices: "3 Boot Options" > " B1 Desktop / CLI" > "B4 Desktop Autologin")
At this point boot your Raspberry Pi and see where you end up.
I was able to get autologin to the desktop with just the above steps. It looked like you were making more edits than I needed.
Let us know how it fairs.

Bhuck7d4
Posts: 10
Joined: Tue Jun 25, 2019 8:16 am

Re: Auto login with piServer

Wed Oct 16, 2019 3:47 pm

Hi !

As already explained in a previous message, this does not work at all for me... The greater remains, and nothing happen. I've checked the logs but nothing really explicit.

What I found strange nevertheless, is when I run raps-config to enable autologin, the sentence is "automatically logged in as ' ' user", meaning, how can the system determine which user to be used ?

Once more, I'm far away from being an expert...

Thanks again for your help.

Cheers,

incognitum
Posts: 360
Joined: Tue Oct 30, 2018 3:34 pm

Re: Auto login with piServer

Wed Oct 16, 2019 3:57 pm

Bhuck7d4 wrote:
Wed Oct 16, 2019 3:47 pm
What I found strange nevertheless, is when I run raps-config to enable autologin, the sentence is "automatically logged in as ' ' user", meaning, how can the system determine which user to be used ?
Used to be hard coded to pi in the past.
But guess that is no longer the case.

Try if it works better if you run raspi-config as:

Code: Select all

SUDO_USER=pi raspi-config

mleffler
Posts: 11
Joined: Thu Oct 03, 2019 4:47 pm

Re: Auto login with piServer

Wed Oct 16, 2019 5:43 pm

So is this what you're seeing?
https://www.raspberrypi.org/forums/view ... 4#p1548853
Image

If so are you able to CTRL-ALT-F7 to switch to the GUI?

I am by no means an expert either, just sharing what worked for me.

Bhuck7d4
Posts: 10
Joined: Tue Jun 25, 2019 8:16 am

Re: Auto login with piServer

Fri Oct 18, 2019 8:58 am

Hello,

This is what I see when I activate CLI autologin without modifying the xml config file as explained in my procedure.

When enabling the GUI autologin with raspy-config, I get the following :

Raspbian GNU/Linux 10 raspberrypi tty1

raspberrypi login: --noclear (automatic login)


...and the stuff remains stuck there...

Bhuck7d4
Posts: 10
Joined: Tue Jun 25, 2019 8:16 am

Re: Auto login with piServer

Fri Oct 18, 2019 11:57 am

Hi again,

Good news! I was able to start the Desktop in autologin mode. It is quite simple, the problem being solved by prefixing SUDO_USER=pi to raspi-config.

To sum up, here is the full working procedure, including the removal of 'Welcome to Raspberry Pi'.

Code: Select all

cd /etc/security/
mv pam_mount.conf.xml pam_mount.conf.xml.ori

$ adduser pi (or any username you want to use)

vi /etc/fstab

# tmpfs           /home           tmpfs   defaults,mode=755            0       0
tmpfs           /home/pi           tmpfs   defaults            0       0

Save and exit

Launch raspi-config to enable auto login
SUDO_USER=pi raspi-config

--> Boot Options --> Console Autologin
Disable 'Welcome to Raspberry Pi'

mv /etc/xdg/autostart/piwiz.desktop /etc/xdg/autostart/piwiz.desktop.ori
Thanks again for your help all you guys!
Last edited by Bhuck7d4 on Mon Oct 21, 2019 6:20 am, edited 1 time in total.

mocallins
Posts: 35
Joined: Fri Jun 16, 2017 5:00 pm

Re: [Solved] Auto login with piServer

Sun Oct 20, 2019 3:15 pm

I have found that this directory does not exist when I run raspi-config and try to enable the autologin CLI option.

/etc/systemd/system/getty@tty1.service.d

I looked at the script a little bit, and do not see anwhere that directory gets created.
I'm sure that's a pretty easy fix in raspi-config, I just couldn't figure out where it goes

something like:

Code: Select all

[/
sudo mkdir  -p /etc/systemd/system/getty@tty1.service.d
code]

should do it, but i'll leave it to a Raspberry Pi team to add it  into raspi-0consig.
I'd rather be an optimist and be wrong, than a pesimist and be right !

incognitum
Posts: 360
Joined: Tue Oct 30, 2018 3:34 pm

Re: [Solved] Auto login with piServer

Sun Oct 20, 2019 7:10 pm

mocallins wrote:
Sun Oct 20, 2019 3:15 pm
I have found that this directory does not exist when I run raspi-config and try to enable the autologin CLI option.

/etc/systemd/system/getty@tty1.service.d

I looked at the script a little bit, and do not see anwhere that directory gets created.
You do are using a normal Raspbian Buster image, and not an older or custom image?

That directory should already pre-exist .
Gets created by pi-gen: https://github.com/RPi-Distro/pi-gen/bl ... -run.sh#L3
Last edited by incognitum on Sun Oct 20, 2019 11:13 pm, edited 1 time in total.

mocallins
Posts: 35
Joined: Fri Jun 16, 2017 5:00 pm

Re: [Solved] Auto login with piServer

Sun Oct 20, 2019 8:11 pm

I am using a different loader, I've been using just a light weight "buster" distro, no desktop.

raspberrypi-ua-netinst
I'd rather be an optimist and be wrong, than a pesimist and be right !

Return to “Staffroom, classroom and projects”