linux startx problem

Problem description:
Today, I suddenly found that none of the users except root could start startx.
 

Fatal server error:
PAM authentication failed, cannot start X server.
        Perhaps you do not have console ownership?
When reporting a problem related to a server crash, please send
the full server output, not just the last messages.
Please report problems to [email protected].
giving up.
xinit:  No such file or directory (errno 2):  unable to connect to X server
xinit:  No such process (errno 3):  Server error.
Couldnt get a file descriptor referring to the console

 
Solution:
Check /var/run/console.lock contains the username, and /var/run/console/< user> To exist. When authenticating, pam_console compares the user name to the content of Console.lock, and if not, the authentication fails. /var/run/console/< user> Used to record the number of times the user logged in, and then the console.lock can be deleted after the user logged out.
 
Solutions:
I used the ordinary user of Oracle. I created a file named Oracle by running touch Oracle command under /var/run/console/, and then I could enter the graphical interface by re-running Startx.

Read More: