Installing and upgrading the latest version of VMware Tools on existing hosts
By: Date: 21/08/2022 Categories: VMware Tags:

Steps to install or upgrade VMware Tools for existing VMware ESXi hosts to the latest version of VMware Tools.

Besides the traditional approach of installing and upgrading VMware Tools bundled with VMware ESXi, the following approaches are also supported to install or upgrade to the latest version of VMware Tools regardless of VMware ESXi version.

VMware ESXi host can be configured to access VMware Tools ISO images from /locker partition (available in case of full installed node) or from a datastore. Using any one of the following two approaches, VMware Tools can be installed or upgraded in a virtual machine.

Replacing the ISO images on the host

As the space on /locker partition on ESXi host is limited and may not have enough free space to store all VMware Tools packages, use of datastore is required when configuring legacy VMware Tools packages needed for installing and upgrading VMware Tools in legacy guest operating systems.

Note: Although recommended, it is not required to deploy ESXi with an image profile that does not include VMware Tools. This will avoid unncessary upgrade of tools-light VIB by vSphere Update Manager when VMware publishes these updates periodically.In a full installed VMware ESXi node:

  1. All the bundled Tools ISO image files are located at /locker/packages/. Download and extract the VMware Tools packages from VMware Downloads.
  2. From the extracted directory, copy the vmtools and floppies sub-directories to /productLocker.

Note: ProductLocker should be configured before powering on any VMs on the host. Installing or upgrading VMware Tools might fail for VMs powered on before configuring ProductLocker. For more information, see Installing or upgrading VMware Tools might fail for VMs powered on before configuring ProductLocker (2147383).

Using a datastore for storing VMware Tools

  1. Download the VMware Tools packages from VMware Downloads.
  2. Extract the VMware Tools packages in a new folder on the desired datastore accessible to the ESXi host. To provide VMware Tools for Windows VMs, take the following files from the (latest) VMware-Tools-windows zip and put them into the respective folders vmtools and floppies:vmtools/isoimages_manifest.txt vmtools/isoimages_manifest.txt.sig vmtools/windows.iso vmtools/windows.iso.sha vmtools/windows.iso.sig vmtools/windows_avr_manifest.txt vmtools/windows_avr_manifest.txt.sig floppies/pvscsi-Windows8.flp floppies/pvscsi-Windows2008.flp floppies/pvscsi-WindowsVista.flp If you want to provide VMware Tools for Linux as well, additionally take the following files from the VMware-Tools-core zip: vmtools/linux.iso vmtools/linux.iso.sha vmtools/linux.iso.sig vmtools/linux_avr_manifest.txt vmtools/linux_avr_manifest.txt.sig
  1. Change into the folder and set the required permissions for the files by running# chmod -R 700 ./floppies/ # chmod -R 700 ./vmtools/
  2. Use ESXi shell or vSphere Web Client to change the UserVars.ProductLockerLocation variable to point it to the directory containing the vmtools sub-directory extracted from the VMware Tools package.From ESXi shell:# esxcli system settings advanced set -o /UserVars/ProductLockerLocation -s /vmfs/volumes/<volumeName>/<extracted directory>
    Note: The extracted directory should contain vmtools sub-directory. Ensure that /vmfs/volumes/<volumeName>/<extracted directory> is exclusively used for storing VMware Tools packages and no VMs are stored in this directory.

    From vSphere Web Client:
    1. Select the host and select Configure tab.
    2. Click Advanced System Settings under System.
    3. Click Edit and filter for ProductLockerLocation.
    4. Set UserVars.ProductLockerLocation to <Path to extracted dir>.
    5. Save the changes. 
  3. Reboot the ESXi host to update the new value of UserVars.ProductLockerLocation or manually set up /productLocker symlink by removing it and recreating it to point to the extracted directory under the datastore following the steps below.

Steps to set up the /productLocker symlink

Note: Pick one of the below procedures for the specific version of ESXi and follow the procedure respective of that version.
Warning: Failure to follow the proper procedure can have mixed results i.e unplanned downtime of VM’s

 

in vSphere 6.7 Update 1 and later versions

In vSphere 6.7 Update 1, updateProductLockerPolicy tool has been deprecated by the updateProductLockerLocation vSphere API. Therefore, for the hosts running ESXi 6.7 Update 1 or later, /productLocker symlink can be updated just by invoking updateProductLockerLocation vSphere API with /vmfs/volumes/<volumeName>/<extracted directory> as the argument


To invoke the API, you can use the vCenter Managed Object Browser. You can access the MOB at https://vcenter_fqdn/mob (replace vcenter_fqdn with actual FQDN or IP of your vCenter Server). Login with the [email protected] account, then browse to [content > rootFolder > childEntity > hostFolder]. Follow the path under childEntity until you arrive at the host.

Alternatively you can open the API directly using the Host ID. For this, select the host in vSphere Client. The URL will include the ID as shown in the picture below:
image.png

Use this ID to open the following URL

https://vcenter_fqdn/mob/?moid=<ID>&method=updateProductLockerLocation


In the example this would be:

https://vcenter_fqdn/mob/?moid=host-18022&method=updateProductLockerLocation


Paste the path to the new directory in “Path”, then click on “Invoke Method” to apply the setting:
image.png
To apply the change, reboot the ESXi.

Note: Following the reboot, the entry for the productLocker in the ESXi security policies will be updates with the new path. However, this can fail when the datastore mounting is slower than expected. As a result, the ESXi will continue to report the VMware Tools version in the old productLocker location as current/up to date.
If you experience such an issue, invoke the UpdateProductLockerLocation API with the new path, then before rebooting the ESXi, run the following command in the ESXi command line:

# secpolicytools -p

in vSphere 6.5 Update 1 up until 6.7 GA

For the hosts running ESXi 6.5 Update 1 or later, either use maintenance mode as described above for ESXi 6.5 or use a new tool ‘updateProductLockerPolicy’.

  1. Get the existing /productLocker target (for step 3 below)

# secpolicytools -d | grep $(basename $(readlink /productLocker)) | cut -d' ' -f2 | head -n1

  2. Rename the existing /usr/lib/vmware/isoimages symlink

# mv /usr/lib/vmware/isoimages /usr/lib/vmware/isoimages.tmp

  3. Update the security policy on the host

# updateProductLockerPolicy <old-symlink-target-retrieved-from-step1> /vmfs/volumes/<volumeName>/<extracted directory>

  4. Remove the existing /productLocker symlink

# rm /productLocker

  5. Create a new /productLocker symlink

# ln -s /vmfs/volumes/<volumeName>/<extracted directory> /productLocker

  6. Restore the /usr/lib/vmware/isoimages symlink

# mv /usr/lib/vmware/isoimages.tmp /usr/lib/vmware/isoimages



in vSphere 6.5 pre Update 1

For the hosts running ESXi 6.5 or later but with patches earlier than ESXi 6.5 Update 1, maintenance mode is required to avoid failure of VMs due to the host security policy restricting VMs from suddenly accessing the new /productLocker symlink.

  1. Enter the host in maintenance mode

# esxcli system maintenanceMode set --enable true

  2. Remove the existing symlink

# rm /productLocker

  3. Create the new symlink

# ln -s /vmfs/volumes/<volumeName>/<extracted directory> /productLocker

  4. Exit the host from maintenance mode

# esxcli system maintenanceMode set --enable false

in vSphere 6.0, 5.x, 4.x

For hosts running ESXi versions earlier than 6.5, remove the existing symlink and create new one.

  1. Remove the existing symlink

# rm /productLocker

  2. Create the new symlink

# ln -s /vmfs/volumes/<volumeName>/<extracted directory> /productLocker

After performing the preceding operations, the ESXi host is ready for installation or upgrade of VMware Tools in the virtual machines running on the host. In vSphere Web client, right click on the running Virtual Machine object and choose Install or Upgrade VMware Tools option. To install or upgrade VMware Tools, see Installing and upgrading VMware Tools in vSphere (2004754).

Note: Using this approach is not recommended for ESXi hosts that are provisioned using Auto Deploy. For more information on configuring host profile for hosts provisioned with Auto Deploy, see VMware Tools for hosts provisioned with Auto Deploy (2004018).

Manually mount the ISO image

Using this approach requires you to know which VMware Tools ISO should be used for the target guest operating system. For more information, see the relevant version of release notes based on the VMware Tools version. For example, see VMware Tools 10.1.0 Release Notes and VMware Tools 10.0.12 Release Notes for ISO image name applicable for different versions of the guest operating systems.

To manually mount the ISO image:

  1. Download the VMware Tools package from https://customerconnect.vmware.com.
  2. Extract and copy the correct VMware Tools ISO image file for the target guest OS to a host-accessible location.
  3. Open the CD/DVD settings window for the virtual machine.
  4. Connect the VMware Tools ISO image file to the virtual CD/DVD drive.
  5. Follow the instructions in the Operating System Specific VMware Tools Setup guide to uninstall or upgrade the VMware Tools.
  6. At the end of the installation or upgrade, restart the guest operating system on prompt.

After configuring VMware Tools packages on the host, if VMware Tools install or upgrade fails due to unsupported guest error, see VMware Tools installation or upgrade might fail due to incorrect selection of VMware Tools ISO image (2147454) for more information.