You can use the vmrun command-line utility in VMware Fusion to control virtual machines and automate guest operations on VMware virtual machines. The vmrun utility is included with the VIX API libraries.
The capabilities of the vmrun utility are summarized in the following sections.
Power commands control virtual machine operations. You can use power commands to start (power on), stop (power off), reset (reboot), suspend while allowing local work to resume, pause without interrupting, and unpause (continue) a virtual machine.
A snapshot captures the state of a virtual machine at the time of the snapshot, including all data on virtual disks. You can then use the snapshot to revert the virtual machine to its previous state. Snapshots are useful for data backup and as a placeholder for development and testing. You can use snapshot commands to list existing snapshots of a virtual machine, create a snapshot, delete a snapshot, and revert a virtual machine to its state at the time of a snapshot. Revert to snapshot does not resume running a virtual machine, even if it was running at the time of a snapshot. Fusion supports snapshots in a line only. It does not support snapshot trees.
Network Adapter Commands
Network adapter commands allow you to control the virtual network adapters associated with a virtual machine. You can use network adapter commands to list, add, update, and remove a network adapter.
Host Network Commands
Host network commands allow you to list the networks the host is connected to and to list, add, update, or remove a port forwarding configuration.
Guest Operating System Commands
Guest operating system commands enable you to interact with a guest operating system in the following ways.
Run an executable program in the guest operating system or run an interpreted script that you provide.
Check if a file or directory exists in the guest, delete a file or directory, rename a file, list files, or create a new directory.
Copy a file from the host to the guest or from the guest to the host.
Create a temporary file in the guest operating system.
Add a shared folder from the host, make a shared folder writable in the guest, or remove a shared folder.
Capture a screen image from the guest.
List the processes running in the guest operating system or end a process (with permission).
Read or write a variable in the guest operating system’s environment or virtual machine state.
The timeout, which is the wait period for VMware Tools, is five minutes for all guest‐related commands.
General commands include commands that list all running virtual machines, upgrade the virtual machine hardware version, install VMware Tools in the guest operating system, and delete virtual machines. Additionally, you can clone a virtual machine image to another virtual machine.
Template Virtual Machine Commands
The template virtual machine command allows you to download a virtual machine template.