sudo nano /etc/skel/.profile
(add the following line to the bottom of the file)
#Startx Automatically
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
. startx [[ here space is mandatory between . and startx if not the session will logout the user automatically ]]
logout
fi
(save and exit --> Ctrl-O, enter, Ctrl-X, enter)
this file will be used as skeleton file for any new user created
every user must have .profile in the home directory to launch the startx session automatically and adding the above lines will ensure that every new user created will have a .profile added to their home directory
for the already existing users, login to the user account and from terminal copy the files manually as follows
sudo cp /etc/skel/.profile ~/
logout and login back to see the changes