Cannot login by GUI, startx starts for root only

Solution 1:

The comment from link in question helped.

  1. At the login screen, press control+alt+F3.
  2. Login
  3. sudo rm .Xauthority
  4. sudo rm .ICEauthority
  5. sudo reboot

Looks like running X as root makes the .Xauthority and .ICEauthority files owned by root as described in linked post.