How to Cancel a Stuck VMware Tools Install from the ESX CLI

Q: I’m trying to evacuate a machine that is suffering a hardware failure, and one of the VMs thinks it is installing the VMware Tools, so it won’t VMotion. The error is “The virtual machine is installing VMware Tools and cannot initiate a migration operation.” I also cannot right-click the VM in vCenter and choose “End VMware Tools Install.” Is there a way for me to end the VMware Tools installation from the ESX command line?

A: Yes, it’s a two-step process once you’ve logged into the console OS of the ESX server where the VM is executing.

First, you need the ID of the VM (all on one line if it wraps):

/usr/bin/vmware-cmd /vmfs/volumes/datastore-name/vm-folder/vmx-file.vmx getid

Then you can do a:

/usr/bin/vmware-vim-cmd vmsvc/tools.cancelinstall idnumber

Have fun!

18 thoughts on “How to Cancel a Stuck VMware Tools Install from the ESX CLI”

  1. This will also work on ESXi hosts with a few modifications:

    From a command line, type the following:
    /vim-cmd vmsvc/getallvms

    Note the Vmid of the VM with the stuck install and then use the second command as indicated:

    /usr/bin/vim-cmd vmsvc/tools.cancelinstall vmid

    Took me a while to figure this one out, so hopefully this will help others who have similar problems.

  2. Thank you. Very frustrating problem, easily solved.

    ESX: vmware-vim-cmd vmsvc/listallvms
    ESX: vmware-vim-cmd vmsvc/tools.cancelinstall

    ESXi: vim-cmd vmsvc/listallvms
    ESXi: vim-cmd vmsvc/tools.cancelinstall

  3. An easier way…
    Just connect to the esx/esxi directly via vsphere client, not through the Virtual Centre and dismount the tools from the Guest…end vmware tools install.

  4. ESXi: vim-cmd vmsvc/listallvms
    ESXi: vim-cmd vmsvc/tools.cancelinstall

    I can’t get this cmd to work

    Invalid command ‘vmsvc/listallvms’.

    Connecting to the host and ending the install worked just fine. Would be nice to know the steps to do this via SSH in a host.

Comments are closed.