Ubuntu is version 13.04, I guess the other version of the solution is probably the same. When the boot into the login interface after we entered the password and did not enter the graphical user interface, but into a command line interface and flashed back to the login interface, but the visitor's identity can enter the graphical user interface, my flash-through command line interface shows the checking Battery State ...
CTRL+ALT+F1 (F2-F6), then enter the user name password to log in. After the successful login sudo-i, and then enter the password to get root permissions, enter startx on the command line, if you successfully entered the graphical user interface for your good luck, generally will not succeed, there will be a lot of error prompts, there is a line to prompt you/home/username/. Xauthority has an error, in order to insure that the file is copied somewhere else in order to avoid recovery and then delete operations, first execute the cp/home/username/. xauthority/home/, then execute the rm/home/user name/. Xauthority, after successful deletion, execute startx again, this time there will be a line prompt if ******,remove/tmp/. X0-lock and start again. Then follow the prompts and we enter rm/tmp/. X0-lock, delete the file. After completion we enter the sudo service lightdm restart. After execution, return to the login interface to log in to successfully log in to the graphical user interface.
Ubuntu cannot log in to the GUI, visitors can login, command line can login