How to Properly kill a VM
Posted by: Nathan Simon
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.
-NS


