For VMware administrators, there are times when a virtual machine becomes unresponsive—perhaps due to issues like snapshot operations or disk contention that cause it to hang. In these cases, the VM may appear frozen, the console becomes inaccessible, and attempts to power it off via vCenter or directly on ESXi either fail, have no effect, or even display a message such as “another task is in progress.” In short, the VM cannot be shut down using conventional methods.
This article explains how to use the ESXi command line—specifically the esxcli command—to forcefully shut down such problematic virtual machines and help restore normal operations.
We have two sets of ESXi commands that can be used to shut down a VM via the command line. The recommended method is the esxcli vm process kill command because it is quicker and does not require VMware Tools to be installed on the VM.
Let’s assume that our first virtual machine, named New Virtual Machine, cannot be shut down via vCenter’s power-off option. In this case, we need to use the command line to power it off.

First, SSH into the ESXi host or use the server’s remote management console (such as iDRAC or iLO) to access the ESXi orange-black DCUI console.
Method 1: Using the esxcli vm process kill
Command
You can combine the following two commands:
esxcli vm process list
esxcli vm process kill --type=[soft,hard,force] --world-id=WorldNumber
List Running VMs:
The first command, esxcli vm process list
, displays all running virtual machines. Locate the VM that needs to be shut down and note its World ID.
For example, you might see that the VM’s World ID is 2103991.

Shut Down the VM:
Next, use the esxcli vm process kill
command to shut down the VM:
esxcli vm process kill --type=soft --world-id=2103991

If the command returns no error or output, it indicates that the VM has been successfully shut down. Running the esxcli vm process list
command again should confirm that the VM is no longer listed, and a check in vCenter will verify that the VM has powered off.
Shutdown Types:
The --type
option supports three shutdown methods:
soft
hard
force
soft:
Always try a soft shutdown first. This method gives the VMX process a chance to close gracefully (similar to using kill
or kill -SIGTERM
).
hard:
If a soft shutdown does not work, try a hard shutdown, which immediately terminates the process (similar to using kill -9
or kill -SIGKILL
).
force:
The force option should be used only as a last resort to shut down the VM. If none of these methods succeed, a reboot of the host may be required.
Method 2: Using the vim-cmd vmsvc
Commands
Alternatively, you can use the following sequence of commands:
vim-cmd vmsvc/getallvms
vim-cmd vmsvc/power.getstate VMID
vim-cmd vmsvc/power.shutdown VMID
- Get All VMs:
The commandvim-cmd vmsvc/getallvms
lists all VMs registered on the ESXi host (including those that are powered off). Identify and record the VMID of the virtual machine you want to shut down. - Check VM Power State:
Next, usevim-cmd vmsvc/power.getstate VMID
to check the power state of the VM.
For example, you might observe that the VM with VMID 1 is in the “Powered On” state while another VM is off. - Shut Down the VM:
Finally, execute: arduinoCopyEditvim-cmd vmsvc/power.shutdown 1
Running this command for VMID 1 (representing the New Virtual Machine) should power it off. The absence of any output indicates that the shutdown was successful.

Note: The vim-cmd
method requires that VMware Tools is installed on the VM. If VMware Tools is not running, you may encounter an error similar to:
(vim.fault.ToolsUnavailable) {
faultCause = (vmodl.MethodFault) null,
faultMessage = msg = "Received SOAP response fault from []: shutdownGuest
Cannot complete operation because VMware Tools is not running in this virtual machine."
}
This concludes the translation of the technical article on using ESXi commands to shut down virtual machines.