Skip to content

Install VMware Tools in CentOS using yum

2012 September 22
by Kirk Kosinski

When running CentOS (or RHEL, or Scientific Linux) in a VM on VMware ESXi, you may want to install VMware Tools.  Modern Linux distributions include the drivers necessary to run the OS in a VM on VMware ESXi, even those for PVSCSI controllers and VMXNET3 NICs.  Although there is no longer a need to install extra drivers, VMware Tools should still be installed to enhance management of the VM through vSphere Client.  yum makes installing VMware Tools extremely simple.

I prefer using yum to install the VMware Tools primarily because ISO install procedure is a hassle.  This procedure, as explained in Mastering VMware vSphere 5 has over ten steps!  Basically, you have to download the ISO, attach it to the VM, mount it in the VM, extract the tarball, run the vmware-install.pl script, and follow the instructions.  Additionally, with the ISO method, the package manager won’t manage the software, and installing future updates is no easier than the initial install.  Using the yum package manager is easier and a better solution overall.

To install VMware Tools with yum, it must be configured with a repository containing the necessary packages.  VMware conveniently provides repositories for common Linux distributions, which can be found here:

http://packages.vmware.com/tools/index.html

There are three easy steps to configure yum and install VMware Tools.

1. Determine the location of the repository for the version of ESXi and CentOS you are using.

Browse through the directories at the above link until you find the location of the appropriate repository.  For example, if you are using ESXi 5.0 update 1 and CentOS 6.x, the following location contains the 32- and 64-bit repositories:

http://packages.vmware.com/tools/esx/5.0u1/rhel6/index.html

2. Configure yum by creating a *.repo file.

yum repositories are configured in plain text files in the /etc/yum.repos.d/ directory.  If this doesn’t sound familiar I suggest reading a good book about RHEL or CentOS such as RHCSA/RHCE Red Hat Linux Certification Study Guide.  Besides providing tons of great information it can help prepare for the well-respective RHCSA and RHCE certifications.  In any case, the repository can be configured with minimal options, but in the sake of security you ought to enable GPG signature checking of the repository’s repodata and packages.  With the correct configuration, no extra administrative effort is required.  Create a *.repo file (e.g. /etc/yum.repos.d/vmware.repo) with the following configuration:

[VMware]
name=VMware Tools
baseurl=http://packages.vmware.com/tools/esx/5.0u1/rhel6/$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
 http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub

Be careful about the formatting.  An indentation (one or more spaces) before the URL for the second GPG key is actually required.  Or, simply copy the following and paste it in a bash prompt to do all of the above (edit it for your version of CentOS and ESXi, if necessary).

cat > /etc/yum.repos.d/vmware.repo << EOF
[VMware]
name=VMware Tools
baseurl=http://packages.vmware.com/tools/esx/5.0u1/rhel6/\$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub
 http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
EOF

Below is a screen shot demonstrating this.

3. Use yum install to install VMware Tools and plugins.

If the previous steps were done correctly, the last step is simple.  All that’s necessary is to run the following command:

yum install vmware-tools-services vmware-tools-plugins-guestInfo vmware-tools-plugins-powerOps

You will be prompted to import GPG keys and to confirm the packages to install, and a few required dependencies will be be installed.  This command includes a plugin that “provides guest information to the virtual host” such as the IP address, and one that enables “soft power operations.”  Personally I find these useful but you can omit them if you prefer.  There are other plugins and meta packages that install all relevant packages for servers (vmware-tools-esx-nox) and desktops (vmware-tools-esx).

Before running the above, the Summary tab in vSphere client shows VMware Tools as “Not running (Not installed)”.

And after, VMware Tools are shown as “Running (3rd-party/Independent)”.

 

Using these three steps, installing VMware Tools on CentOS with yum is quick and easy.  If you upgrade ESXi, modify the *.repo file to point to the new repository and run yum update to get the latest VMware Tools.  In vSphere 5.0, 5.0 update 1, and 5.1, the package naming has been consistent, but if the names do change after and upgrade, simply remove the old packages (yum erase <package_name>) and install the new ones.

 

6 Responses Post a comment
  1. Todd Troutman permalink
    July 26, 2013

    Thanks Kirk!

  2. Jay Epperson permalink
    August 23, 2013

    Thanks for this! The powerOps plugin is key to getting the Vsphere side actions like reset to work. Another post I had followed called for only the guestInfo plugin, and although Vsphere showed the tools running, hitting reset caused it to report that they were not.

    Is there a plugin or tweak that will get rid of the “independent/3rd party” status and report the actual version or up-to-datedness of the tools? My VMware guys want to be able to see that, and it only seems to work with a pushed tarball install, which is bad news for the RHEL guys.

  3. Hans Riethmann permalink
    October 14, 2013

    In the following example I’ve changed the boolean value from true to false and vCenter reported “Running (Current)”. I suspect this is the way VMware designed it, they probably want to indicate that the tools are not under control of vCenter, however I like the green tick mark better than the third party message 🙂

    [root@xyz ~]# cat /etc/vmware-tools/tools.conf
    [vmtools]
    disable-tools-version=false

  4. October 24, 2014

    Just a quick update. This does not work with RHEL or CentOS 7 (or recent Fedora versions) since vSphere doesn’t support it yet, and the official VMware Tools packages for RHEL 6 don’t work with systemd. However, there is an easy solution: install the open-vm-tools package, which includes a vmtoolsd service. This provides functionality similar to the official Tools such as soft power-off and reboots and reporting the IP addresses in vSphere Client.

Leave a Reply

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS

This site uses Akismet to reduce spam. Learn how your comment data is processed.