![Gui Gui](/uploads/1/2/4/7/124792820/854828921.png)
Nov 3, 2016 - In CentOS 7 we can use the systemctl command to select which mode the OS boots into. If you have a GUI like Gnome or KDE installed,. Aug 29, 2011 CentOS. If a graphical environment starts correctly then logout of the GUI and re-elevate your powers back to that of iroot /i. When the system is next re-booted, it will start.
How do you run X server on startup in CentOS? This is the command I use to manually start X server -
![Centos Centos](/uploads/1/2/4/7/124792820/151972671.png)
sudo /usr/bin/X :0 &
Josh UngerJosh Unger
closed as off-topic by alexus, mdpc, Ward♦, shodanshok, Jenny DAug 15 '16 at 11:04
This question appears to be off-topic. The users who voted to close gave this specific reason:
- 'Questions on Server Fault must be about managing information technology systems in a business environment. Home and end-user computing questions may be asked on Super User, and questions about development, testing and development tools may be asked on Stack Overflow.' – mdpc, Ward, shodanshok, Jenny D
2 Answers
(I'll repeat the warning that you shouldn't be logging in as root, which you have been doing.)
This might happen if, for instance, you installed the system without the GUI and then installed it later. In this case, the system is not automatically configured to start the GUI.
If your system is somehow not configured to start the GUI automatically, you can fix this by changing the default target that systemd loads at boot.
On the next boot, the GUI should start up. If you need to start it immediately, you can also do that.
Michael Hampton♦Michael Hampton180k2828 gold badges337337 silver badges667667 bronze badges
It should spring into life automatically if you are stating in runlevel 5.
You can find out the current runlevel with
who -r
or runlevel
.How you change the runlevel depends on which version of CentOS you are using. Prior to version 7, it was via the inittab.
If you are in runlevel 5 but don't have a X server running on your machine (you should a [x|k|g]dm graphical login or go direct to a sesion if you have configured auto login, then there's something wrong with your X configuration or the runlevel is broken. Check your logs.
sudo /usr/bin/X :0 &
Not a good idea to run your default session as root.
symcbeansymcbean18.7k11 gold badge2323 silver badges4040 bronze badges