How to start/stop your VMWare workstation from a command line:
Use the vmrun command.
Usage: vmrun [AUTHENTICATION-FLAGS] COMMAND [PARAMETERS]
For Workstation, this becomes very easy
- To see the running machines
$ vmrun listTotal running VMs: 1
/my/full/path/My VMWare Configuration File.vmx - To suspend that machine (not shut it down)
$ vmrun suspend /my/full/path/My VMWare Configuration File.vmx - To resume or start a machine
$ vmrun start /my/full/path/My VMWare Configuration File.vmx
You can also automate this through a simple script to pause all running VMs
:
VMRUN=’/usr/bin/vmrun’
$VMRUN list | tail -n +2 | sed ‘s/ /\\ /g’ |
while read i
do
echo “Pausing $i…”
`$VMRUN suspend “$i”`
echo Status = $?
done