How to Configure CentOS for Graphical X11 or Multiuser Mode on Boot

Sometimes when I install CentOS it does not start up in “graphical mode” – that is it starts up directly at the command prompt rather than automatically starting up X Windows. You can configure CentOS to start up in whatever mode you want including graphical mode by editing the file /etc/inittab. To change the startup mode of CentOS open that file with a text editor.

# nano /etc/inittab

The file should look like the following:

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
id:3:initdefault:

As you can see, the file gives you the number-to-mode mapping at the top. All you need you do is change the number in the last line listed above. So for me I needed to change the 3 to a 5:

id:5:initdefault:

So my final /etc/inittab file looked like the following:

# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
id:3:initdefault:

Reboot your computer and it should now start up in whatever mode you specified.