I know I can suspend a given VMware virtual machine on the command line with:

vmrun suspend /path/to/virtual_machine_file.vmx

Is there any way to suspend all virtual machines at once using vmrun? Something like vmrun suspend all?

3 Answers 3


Well I was hoping for an easy answer but since there wasn't one, I wrote my own script. I hope this is helpful to someone! It's in ruby -- when run, it will call vmrun list to obtain a list of all running VMs, strip off the first line ("Total running VMs: x"), and call vmrun suspend on all remaining lines.



vms = []
open("|#{VMRUN} list") do |p| vms = p.readlines.map {|l| l.chomp } end
vms.each do |vmxfile|
  print "Suspending #{vmxfile}"
  system("#{VMRUN} suspend #{vmxfile}")

Windows batch file version of the answer here (3rd post): http://communities.vmware.com/thread/92951?tstart=0

I didn't reproduce the solution directly due to the fact it borrows code from original authors in the above link and they deserve their credit. I just took what they did and adapted it to just suspend all running VMs (the original script suspends, backs up and resumes).


I just needed a way to do this, and tip for me here was vmrun. My simple command line solution (from the VMware directory):

for /f "tokens=* skip=1" %a in ('vmrun list') do vmrun suspend "%a"

If in a bat file:

for /f "tokens=* skip=1" %%a in ('vmrun list') do vmrun suspend "%%a"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.