I have encountered problems as shown in the question before, but due to laziness and neglect, I have seen a good guide post today, which will be handed over for reference when my head is short-circuited. Previously, I only used the second method below to start the graphic interface.
**************************************** *******
Symptoms:
CentOS is completely normal during startup and there are no error messages. A black screen appears later, instead of the logon interface of X Window.
An error occurred while starting X Window using the startx command. The prompt is as follows:
Fatal server error:
Server is already active for display 0
If this server is no longer running, remove/tmp/. X0-lock and start again
Cause
This is a bug in the rhgb (redhat graphical boot) software package. After it is started, it does not automatically switch to the tty7 terminal that enables X Window, but stays on the tty1 terminal on the Character interface.
Terminal settings can be found in the/etc/inittab file.
Solution
Method 1: manually switch to the tty7 terminal, CTRL + ALT + F7.
Method 2: On the tty1 terminal, delete the/tmp/. X0-lock file and start X Window with # startx.
Method 3: Download The rhgb-0.16.4-3.fc6.i386.rpm and update it, or use # yum update rhgb update
Note: Sometimes, after method 1 is executed, you cannot enter the graphic interface. In this case, you can continue to execute method 2. If the problem persists, you can continue to execute
CTRL + ALT + F1 and CTRL + ALT + F7. This is recent experience. It is also found that the same is true for debian linux and Sun Solaris x64. In the future, I will continue to work hard to find the root cause of this error and share it with you.