Contents

Previous Next

Command Line Application
VMware Workstation includes a separate application, vmrun, for operating teams or virtual machines from the command line.
To launch the vmrun application, from the command prompt, enter:
vmrun COMMAND [OPTION]
Valid vmrun commands and options are described in the following table:
Command
Description
Option
list
Lists all running virtual machines.
None
start
Start a virtual machine
[Path to .vmx file]
stop
Stop a virtual machine or team.
[Path to .vmx file (virtual machine)]
or
[Path to .vmtm file (team)]
reset
Reset a virtual machine or team.
[Path to .vmx file (virtual machine)]
or
[Path to .vmtm file (team)]
suspend
Suspend a virtual machine or team.
[Path to .vmx file (virtual machine)]
or
[Path to .vmtm file (team)]
upgradevm
Upgrade a virtual machine to the current Workstation version.
[Path to .vmx file]
installtools
Install VMware Tools in the guest operating system. In Windows guests, the VMware Tools installer runs automatically. In Linux guests, this command connects the virtual machine's virtual CD-ROM drive to the VMware Tools ISO image for that guest, but the installer does not start automatically: you must complete the installation with additional manual steps, as described in VMware Tools for Linux Guests.
[Path to .vmx file]
snapshot
Create a snapshot of a virtual machine
[Path to .vmx file]
[snapshot name]
listSnapshots
List all snapshots in a virtual machine
[Path to .vmx file]
deleteSnapshot
Remove a snapshot from a virtual machine
[Path to .vmx file]
[snapshot name]
revertToSnapshot
Go to a snapshot in a virtual machine.
If a snapshot has a unique name within a virtual machine, you can revert to that snapshot simply by specifying the path to the virtual machine's configuration file and the snapshot name:
[Path to .vmx file][snapshot name]
If several snapshots have the same name, you can still specify a snapshot by including a "pathname" for the snapshot name. A pathname is a series of snapshot names, separated by forward slash characters ("/"). Each name specifies a different snapshot in the tree, and together the names in a pathname will specify a path from the root snapshot to the snapshot you are naming.
For example, suppose you include the pathname "snap1/snap2". This will identify a snapshot named "snap2" that was taken from the state of a root snapshot named "snap1".
Because the forward slash can be used in a pathname to specify a particular snapshot in the revertToSnapshot command, it is recommended that you avoid using the slash character when you name a snapshot, since this will make it difficult for you to predict which snapshot a pathname will identify.
[Path to .vmx file]
[snapshot name]
or
[Path to .vmx file]
[snapshot name1/
snapshot name2]
Note: Before running this command on a Windows host, you must do one of the following:
•   Change your working directory to the VMware Workstation directory. The default location is:
c:\Program Files\VMware\VMware Workstation
•   Add the VMware Workstation directory to the system path. On Windows 2000 and XP, this setting is changed from
Control Panels > System > Advanced > Environment Variables > System variables > Path
Examples for vmrun
For example, to start a virtual machine:
•   In a Linux terminal, enter
vmrun start /usr/local/VMs/<virtual_machine_name>.vmx
•   On the Windows command line, enter:
vmrun start c:\My Virtual Machines\<virtual_machine_name>.vmx
With virtual machines that require input through a VMware Workstation dialog box, vmrun may time out and fail. To disable Workstation dialog boxes, insert the following line into the .vmx configuration file for a virtual machine:
msg.autoAnswer = TRUE

Previous Next