After write my password the screens goes and give a line of code not readable for one second then goes back to login screen. Any help ? I have almost all my work there is an a partition on my surface pro 2017.
for some reason did you run startx with administrator privileges? (sudo xstart). if so, you must change the root .Xauthority owner to your user. you should probably do the same with .ICEauthority.
Press Ctrl+Alt+F1 and login into the shell, then run "ls -lA". If you see the line: -rw------- 1 root root 58 Ago 22 17:10 .Xauthority do chown yourusername:yourusername .Xauthority.
after that press Ctrl+Alt+F7 and login again.
I've had that issue before as well and Javier A's answer usually works for me. There was one time that it didn't and the following command worked:
sudo service lightdm restart