The Real (and Virtual) Adventures of Nathan the IT Guy

Oct 27 2009   3:42PM GMT

How to Properly kill a VM

Nathan Simon Nathan Simon Profile: 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.


1  Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.
  • Nathan Simon
    I learnt something today... if you type "[B]ps auxfww | grep [/B]" you will end your session, and not neccissarliy the vm process id. the right command is "[B]ps auxfww | grep &[/B]" this will execute the command in the background and report when its done.
    700 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: