Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions

  




 

 

NOTE: CentOS Enterprise Linux is built from the Red Hat Enterprise Linux source code. Other than logo and name changes CentOS Enterprise Linux is compatible with the equivalent Red Hat version. This document applies equally to both Red Hat and CentOS Enterprise Linux.

14.12. Changing Login from Console to X at Startup

How do I change my login from the console to the graphical screen?

Instead of logging in to your system at the console and typing the startx command to start the X Window System, you can configure your system so that you can log in directly to X.

You must edit one file, /etc/inittab, by changing just one number in the runlevel section. When you are finished, reboot the computer. The next time you log in, you will have a graphical login prompt.

Open a shell prompt. If you are in your user (home) account, change to the root user by using the su command:

su -

Now, type gedit /etc/inittab to edit the file with gedit. The file /etc/inittab will open. Within the first screen, you will see a section of the file which looks like this:

# 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:

To change from a console to a graphical login, you should change the number in the line id:3:initdefault: from a 3 to a 5.

Warning Warning
 

Change only the number of the default runlevel from 3 to 5.

Your changed line should look like the following:

id:5:initdefault:

When you are satisfied with your change, save and exit the file using the [Ctrl] -[x] keys. You will see a message telling you that the file has been modified, and asking you to confirm your change. Type [Y] for yes.

Now, your next login after reboot will be from the graphical screen.

 
 
  Published under the terms of the GNU General Public License Design by Interspire