Q. How can I use vmrun to script virtual machine (VM) actions in VMware Workstation?

A. I've given you a couple of Q&A's lately that relate to command line fun inside VMware Workstation. The first mounted .VMDK files for Explorer access. The second showed you how to defragment those same files.

VMware Workstation comes with another great command that you should add to your short list, vmrun. This utility is in the folder C:\Program Files (x86)\VMware\VMware VIX.

Unlike the others I mentioned, which work primarily with disks, vmrun is used for performing many different actions against your VMs themselves. You can start, stop, reset, snapshot, and even upgrade the VMware Tools using its switch syntax.

These actions are exciting in and of themselves, but one of vmrun's real powers is the ability to enact change inside an OS. For example, the runProgramInGuest switch lets you invoke a specific program inside a running guest OS. Scripts can be run with runScriptInGuest. You can view and kill processes with listProcessesInGuest and killProcessInGuest. If vmware-mount's x64 limitation is getting you down, vmrun presents a few disk-related commands as well.

The entire lineup of commands is found in VMware's documentation.

Catch up with @ConcentratdGreg on Twitter!

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish