Skip to content

How to enable autologin in the client piserver #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
userraspberry opened this issue Jan 23, 2018 · 9 comments
Closed

How to enable autologin in the client piserver #11

userraspberry opened this issue Jan 23, 2018 · 9 comments

Comments

@userraspberry
Copy link

How to enable automatic logon in the system on the raspberry pi.

@maxnet
Copy link
Collaborator

maxnet commented Jan 23, 2018

What is the exact use-case?

  1. Do you have a need to be able to save files to your home directory and have them persist?
    And if so, what applications do you plan to use exactly?

Not all applications can deal with the situation that multiple Pi are logged into the same user account and write temporary files to the same home directory simultaneously.

  1. Or do you intend to use Pi for Internet kiosk style purposes, in which there is no need to store anything?

That is easier to achieve.

@userraspberry
Copy link
Author

  1. There is no need to save the files.

@maxnet
Copy link
Collaborator

maxnet commented Jan 23, 2018

The following should work in theory.
You will have to test how well it works in practice for your exact purposes though.

In the Piserver GUI, go to "software" tab, select "Raspbian" and press "shell" button to get a chroot shell.

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

Add a local pi user:

adduser pi

Edit /etc/fstab

leafpad /etc/fstab

Modify:

tmpfs           /home           tmpfs   defaults,mode=755            0       0

To:

tmpfs           /home/pi           tmpfs   defaults            0       0

Save the file, and close leafpad
Start raspi-config

SUDO_USER=pi raspi-config

edit: you now need to start raspi-config with: SUDO_USER=pi raspi-config

Enable automatic login there. ("boot options" -> "desktop/cli" -> "desktop autologin")

Be aware that in this setup /home/pi will live in tmpfs (ramdisk), and is entirely empty on each boot.
If you need to autostart any applications do so using global configuration directories, e.g. by creating a .desktop file in /etc/xdg/autostart
and not by putting files in home directory as they will not be seen.

@jmccoy555
Copy link

Hi, this works great, however I need to persist data between boots. Particularly a selection made in Chromium running in kiosk mode. Is it possible to map the home folder to somewhere?

Maybe making use of #15 although I note that this is also read only, which would be fine if there was a way for an 'admin user' with write access to initially set this?

@maxnet
Copy link
Collaborator

maxnet commented Mar 26, 2018

Is it possible to map the home folder to somewhere?

Yes, but:

  • Sharing a single home directory with multiple computers read-write is problematic.
  • Having a read-only home folder is problematic

Maybe making use of #15 although I note that this is also read only, which would be fine if there was a
way for an 'admin user' with write access to initially set this?

Put your files in the shared folder prepared on the piserver computer, and create a one-line /etc/rc.local script that populates /home/pi on boot?

#!/bin/sh

cp -a /mnt/shared/preparedfiles/* /home/pi

@maxnet maxnet closed this as completed Apr 13, 2018
@map7
Copy link

map7 commented Mar 29, 2019

I've found that the autologin might not be working due to a timing issue. When the login screen appears if I type my username and password in really quickly (5seconds) then it fails everytime. If I wait 10seconds then hit enter, it works.

Could this be why autologin isn't working?

@maxnet
Copy link
Collaborator

maxnet commented Apr 2, 2019

I've found that the autologin might not be working due to a timing issue.

That is unrelated.

As stated before, you do can enable autologin, but only if you do NOT need writable storage.
If you need writable storage, the piserver server expects a password from the client. And autologin does not provide any.

@Buzz2912
Copy link

Buzz2912 commented Dec 5, 2019

Just installed buster server und tried to enable autologin the way steted above.
I do have a running stretch installation with autologin.
Using raspi-config to enable desktop login fails /bin/cat: /proc/device-tree/model: no such file or directory

@maxnet
Copy link
Collaborator

maxnet commented Dec 5, 2019

Using raspi-config to enable desktop login fails /bin/cat: /proc/device-tree/model: no such file or directory

That message should not affect your changes.
/proc/device-tree/model is only consulted to mention the Raspberry Pi model running in the title bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants