0

I installed after the light raspbian version sudo apt install raspberrypi-ui-mods which installs pixel desktop manager. After that I'm trying to have an automated script that enables the GUI without having to pass through raspi-config. Did not find any way to do that, which configuration file does it go to modify!! I'd like it without user auto-login

1
  • 2
    That command doesn't install a desktop - it updates the existing. If you have lite there is lots of other stuff needed. Incidentally PIXEL was a short lived kluge of LXDE.
    – Milliways
    Mar 2 at 20:44
2

Here's the script that raspi-config runs when you enable the GUI without autologin:

      systemctl set-default graphical.target
      ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
      rm /etc/systemd/system/getty@tty1.service.d/autologin.conf
      sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=.*/#autologin-user=/"

You may need to edit a different config file if you have a different desktop manager.

2
  • any location for this file? Mar 2 at 16:25
  • @PhilippeGachoud Sorry, I don't know. A quick googling suggest that Pixel is just a rebranded lightdm (just like Raspbian is a rebranded Debian), so the config file should still be /etc/lightdm/lightdm.conf. Still, you should check which DM you actually have. Mar 3 at 11:05
2

If the reason why you don't want to use raspi-config is because you want to automate it and not have to go through the interactive menu, you can also use the script in a noninteractive way (see also this Q&A e.g.):

raspi-config nonint function options

will directly execute the internally defined function that does the actual work, and which in the interactive mode would be triggered by your menu choice.

In your case

raspi-config nonint do_boot_behaviour B3

will enable the graphical login, just as if you had chosen "1: System Options" -> "S5: Boot/Auto Login" -> "B3: Desktop" in the interactive mode. If you want to choose the "auto-login" graphical boot, use

raspi-config nonint do_boot_behaviour B4

instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.