When Installing and upgrading VMware Tools fails, ensure to use a supported guest operating system to resolve this issue.
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>
Impact/Risks:
You cannot install or upgrade VMware Tools.