November 17, 2008

Find The Version Of CentOS/RHEL Without Rebooting

Want to know if you have CentOS 4.5 or 5.0? Issue this command:
cat /etc/redhat-release
That file contains the needed version information.

[root@localhost ~]# cat /etc/redhat-release
CentOS release 5 (Final)

July 9, 2008

Installing VMWare Tools in CentOS 5.x

Notice: This involves some command-line editing, and could potentially cause damage to your system.  Do not follow these commands if you don’t understand what they do.  I am not liable for any damages to your property.

If you’re like me, you’ve doubtless struggled with installing ESX 2.5’s VMWare Tools in the later releases of CentOS (v5.x). There is some sort of bug in the vmware-config-tools.pl script that gets installed by the main vmware-tools-installer, and tells you that your kernel-headers do not match your running kernel.

  1. From VMware ESX VirtualCenter: 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.6.3-12345.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 “No”.

After following the above instructions, you can then proceed to the following steps. Just be sure that your kernel headers *do* actually match before disabling the check below.  You can check that by comparing the results of these two commands:
uname -r # running kernel
rpm -q kernel-devel # installed kernel headers

If you open the file in nano (or gEdit if you have the GUI installed), search (ctrl-w in nano) for  ”load into the running kernel.” Go up six lines from that where you should see this if statement:

if (not ($header_version_uts eq $gSystem{'uts_release'})) {

Take the “not” out, so that the line looks like this:

if (($header_version_uts eq $gSystem{'uts_release'})) {

Save the file, and re-run it, violá! It’s installed.

Thanks to