I'm looking for terminal commands to suspend a VM (or gracefully quit VMWare), then open the VM. I'm a novice with VMWare Fusion and OS X so hopefully I'm not missing anything too obvious.
VMWare 1.1 on Leopard. VM is Ubuntu 7.04.
To open a virtual machine from Terminal, that's easy enough:
$ open "~/Documents/Virtual Machines/ VMName .vmwarevm", e.g.
open "~/Documents/Virtual Machines/Ubuntu.vmwarevm"
Shutting down VMware Fusion is a bit more complicated... You can ask VMware Fusion to quit via Applescript UI but you may get prompts that block the shutdown, e.g. the command is:
osascript -e 'tell app "VMware Fusion" to quit'
To prevent blockages, beforehand, you can ask your VM(s) to shut themselves down gracefully. In Ubuntu the command line is "shutdown -h now". You would have to execute this remotely like over ssh. If your guest VMs are off before you ask Fusion to quit, there should be no problems.
If you want your VMs to suspend, you'll have to do more Applescript UI scripting to drive the suspend operation via the menus. It's a bit cumbersome but it can work.
edit: changed Windows example to Ubuntu
Good article on using vmrun from command line (which can be wrapper into an ocascript for Applescript)
You must set the path to it before you can use it. Once you have the path set, you can use vmrun
It also refers to a VMWare doc on using vmrun here: http://www.vmware.com/pdf/vix180_vmrun_command.pdf