Can't login to my user account

This solution doesn't work. I'm using Guest account right now.

I was just working on VirtualBox and listening to some music with Rhythmbox when suddenly my computer became laggy, and seconds later, everything disappeared except my cursor and wallpaper. I ran terminal using CTRL+ALT+T and typed startx, sudo startx, and the last one sudo shutdown -h now. After booting up my computer again I could not login to my user account, after typing my password and hitting enter, black screen for 2 seconds, and login screen again.


I have solved this issue by changing the ownership of .Xauthority.

sudo chown user:user ~/.Xauthority

Change user with your username. Or you can just delete .Xauthority using nautilus if you can login to graphical session (you can install other display manager such as GDM to login, the problem lies in LightDM), or you can delete it via terminal (CTRL+ALT+F1).

rm ~/.Xauthority