Installing and upgrading VMware Tools fails with the error: An error occurred while trying to access image file /usr/lib/vmware/isoimages/
search cancel

Installing and upgrading VMware Tools fails with the error: An error occurred while trying to access image file /usr/lib/vmware/isoimages/

book

Article ID: 311234

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • Installing and upgrading VMware Tools fails with an error similar to:
     
    Unable to install VMware Tools. An error occurred while trying to access image file /usr/lib/vmware/isoimages/linux.iso needed to install VMware Tools: No such file or directory. If your product shipped with the VMware Tools package, reinstall VMware ESX, then try again to install the VMware Tools package in the virtual machine.

Cause

This issue occurs if the guest operating system is unsupported.

Resolution

To resolve this issue, ensure to use a supported guest operating system.

 
In ESXi, the /usr/lib/vmware/isoimages is a symbolic link to /productLocker, which in turn is a symbolic link to a missing directory.
 
To verify and resolve this issue, recreate the symbolic link:
  1. Connect to the ESXi host with an SSH session and root credentials.
  2. Run this command to verify the symbolic link:

    ls -la /usr/lib/vmware/isoimages/

    Example output:

    ls: /usr/lib/vmware/isoimages/: No such file or directory
     
  3. Run these commands to remove the invalid link:

    cd /

    mv locker /tmp
     
  4. Run this command to find the datastore that contains the locker:

    find . -iname vmtools

    Examplefind / -iname vmtools

    /vmfs/volumes/<UUID>/packages/6.0.0/vmtools

    /vmfs/volumes/<UUID>/packages/6.0.0/
     
  5. In the vSphere Client, navigate to ESXi host > Configuration > Advanced Settings > UserVars.
  6. Enter the /vmfs/volumes/datastore/packages/<esxi_version>/ in UserVars.ProductLockerLocation and press OK.
  7. Reboot the ESXi host to update the new value of UserVars.ProductLockerLocation or put the host in maintenance mode. For ESXi 6.5 or later, see note section.
  8. Perform below steps to manually set up /productLocker symlink by removing /productLocker link and recreating /productLocker.
    1. Put the host into maintenance mode:

      esxcli system maintenanceMode set --enable true

    2. Remove the /productLocker link

      rm /productLocker

    3. Recreate the /productLocker:

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

      Example:   

      5.5 /locker/packages/5.5.0/ 
      6.0 /locker/packages/6.0.0/
      6.5 /locker/packages/6.5.0/
      6.7 /locker/packages/vmtoolsRepo/
      7.0 /locker/packages/vmtoolsRepo/

    4. Reconfirm the symlink

      find / -iname vmtools

    5. Exit the host from maintenance mode:

      esxcli system maintenanceMode set --enable false


Note: If the host is running with ESXi 6.5 up to the version before 6.5U1, not putting the host in maintenance mode may lead to VM crashes due to the host security policy when VMs try to access the new /productLocker link

ESXi 6.5 Update 1

ESXi 6.5 Update 1 provides a tool 'updateProductLockerPolicy'to avoid the need for putting host in maintenance mode. It can be used as in the steps below.
Note: For 6.5 U1 and later, ESXi does not require a reboot as the changes take immediately. 

  1.  Run this command to get existing /productLocker symlink target known to ESXi kernel:

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

  2. Remove the /productLocker link:

    rm /productLocker


  3. Recreate the /productLocker:

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


  4. Update the ProductLocker:

    updateProductLockerPolicy <old-symlink-target-from-command-above> /vmfs/volumes/<volumeName>/<extracted directory>

If ISO images are missing from /usr/lib/vmware/isoimages, collect vm-support files and send to VMware for analysis. For more information, see Collecting diagnostic information for VMware products.