After installing Raspbian Stretch Lite, I would like to install a GUI: Choose LightDM, but after reboot, when I insert my username and password (both correct), the system will come back at the same screen, asking me to insert the username and password again. How can I solve this?
And if it is not
sudo systemctl set-default graphical.target
There is a very good article at https://www.raspberrypi.org/forums/viewtopic.php?t=133691 that explains what is need and several different options to add GUI to Raspbian Lite.
This work for me on Raspbian Stretch Lite:
sudo apt-get install --no-install-recommends xserver-xorg -y
sudo apt-get install --no-install-recommends raspberrypi-ui-mods lxterminal gvfs -y
sudo raspi-configchoose "3 Boot Options - Configure options for start-up", "B1 Desktop / CLI - Choose whether to boot into a des", "B4 Desktop Atologin Desktop GUI, automatically logged in as 'pi' user", "Ok", and reboot.
This did not work for me.
I did the above steps from both posts, but it still just restarts after entering username/password. To fix this, I did the additional steps:
sudo apt-get install lxde --fix-missing sudo apt-get install xinit startx