How to install VMware tools in CentOS 5 or 6

1. Install the repo

Actually before you set up the repo, you need the public keys:
# rpm –import https://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
# rpm –import https://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

Then you can set up the repo by hand or with their RPM.

By repo RPM:

You can do this by installing the repo RPM from VMware:
# yum install https://packages.vmware.com/tools/releases/latest/repos/vmware-tools-repo-RHEL6-10.0.9-1.el6.x86_64.rpm
(or yum install https://packages.vmware.com/tools/releases/latest/repos/vmware-tools-repo-RHEL5-10.0.9-1.el5.x86_64.rpm)

By hand:

Create /etc/yum.repos.d/vmware-tools.repo.  Contents should be as follows.

Note: Make sure the number after “esx” reflects your current version of ESX.  To see a list of available versions, point your browser to http://packages.vmware.com/tools/esx

Also, if you’re installing in RHEL 5 or CentOS 5, change the ‘rhel6’ to ‘rhel5’.

/etc/yum.repos.d/vmware-tools.repo:
 [vmware-tools]
 name=VMware Tools
 baseurl=http://packages.vmware.com/tools/esx/5.0/rhel6/$basearch
 enabled=1
 gpgcheck=1

2. Install the public keys and then tools
# yum -y install vmware-tools-esx-kmods vmware-tools-esx

3. Make sure the services are set to run at boot
# chkconfig vmware-tools-services on

4. If the tools are not already running, start them:
# service vmware-tools-services status
# service vmware-tools-services start