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

When Installing and upgrading VMware Tools fails, ensure to use a supported guest operating system to resolve this issue.


Symptoms:
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.


Environment

VMware vSphere ESXi 5.0
VMware ESXi 4.1.x Installable
VMware ESX 4.1.x
VMware vSphere ESXi 6.7
VMware vSphere ESXi 6.5
VMware vSphere ESXi 6.0
VMware vSphere ESXi 7.0.0

Cause

This issue occurs if your 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/

    You see output similar to:

    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\vSphere Web 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 

              a. Run this command to put the host in maintenance mode:
                          # esxcli system maintenanceMode set --enable true

              b. rm /productLocker
  
              c. 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/


              D. reconfirm the symlink Run this command
                           #find / -iname vmtools 
          
     
E. To 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 provides a tool 'updateProductLockerPolicy' to avoid the need for putting host in maintenance mode. It can be used as in the steps below:

a. 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

b. rm /productLocker

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

d. 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.

NOTE: 6.5 U1 and later ESXi does not require a reboot as the changes take immediately. 

 

Additional Information

Impact/Risks:

You cannot install or upgrade VMware Tools.