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.

How to Install VMWare Tools in CentOS 5

Install software needed by VMware Tools

1. Install packages to build the kernel modules

yum install gcc kernel-devel

2. Check the running kernel matches the kernel headers

uname -r             # running kernel
rpm -q kernel-devel  # installed kernel headers

3. If the two versions do not match, run

yum -y upgrade kernel kernel-devel
reboot

4. Find out where the kernel headers are (you may need this later)

ls -d /usr/src/kernels/$(uname -r)*/include

Prepare and install VMware Tools

1. From VMware Workstation: go to VM> Install VMware Tools

2. From the VM: mount the virtual cd drive

mount /dev/cdrom /mnt/

3. Extract VMware Tools to /tmp/

tar -C /tmp -zxvf /mnt/VMwareTools-5.5.3-34685.tar.gz

4. Unmount the virtual cd drive

umount /mnt

5. Now run the installer

cd /tmp/vmware-tools-distrib
./vmware-install.pl

6. When asked Do you want to run vmware-config-tools.pl?, answer “Yes”.

VMWare Infrastructure