Posted by: Nathan Simon
ESX Server 3.5, how to find the PID of a vm, kill -9 PID, PID, ps -ef |grep, ps auxfww | grep, vm won't respond, vmware, vmware-cmd, vmware-cmd stop, vmware-cmd stop hard, vmx, vsphere
We all know that you can use the command “ps -ef |grep (vmconfig filename.vmx)” to find the PID for a VM, but I get confused as to which number that comes up is actually the PID… I found a new command that works much better. See below.
The Definitive way to Kill a PID process
The steps below are based on the fact that you already tried to use “vmware-cmd vmname.vmx stop; stop hard”
1.) A final solution is to kill the PID (process ID). Issue the following command: “ps auxfww | grep <vmname>” to locate the correct PID (BTW: this cannot be done via *ESXTOP*). The first number to appear in the output is your PID. The PID can be used to terminate the process by issuing kill -9 PID.
2.) Run vmware-cmd <vmname>.vmx getstate to see if it is now “off”, as it should be.
3.) You can now go back into Virtual Infrastructure Client and start the machine.