# Run VMware Fusion headless at Mac OS system startup.
I heard you like headless VMs on your Mac so I wrote this script for your `launchd`s.
## Assumptions
* Tested on Mac OS X 10.6.4 with VMware Fusion 2.0.5 and 3.1.1.
* A interactive user automatically logs into the system at startup. I had some issues trying to get this running without an interactive user logged in. I automatically log in for Airfoil Speakers anyway.
* Your virtual machines live in `/Virtual Machines`
## Method
1. Place the `vmdaemon` script into `/Virtual Machines` and make it executable (`sudo chmod 755 vmdaemon`) and owned by root (`sudo chown root:wheel vmdaemon`).
2. Copy the template plist into `/Virtual Machines`. The plist should also be `chmod 644` and `chown root:wheel`.
1. For each VM you want to run headless, copy the `template` property list file and change the filename, label and 2nd program argument to match your VM name.
1. Symlink the plist into `/Library/LaunchDaemons`
1. Run `launchctl load -w $PLIST` to start the VM.
1. Use `launchctl unload -w $PLIST` to initiate a graceful shutdown of the VM. By default it will wait up to 5 minutes for the VM to shutdown. This can be configured in `ExitTimeOut` in the plist
## Forks and Feedback
If you try this out with your own setup, I'd like to hear how things go. Patches via gist forks are welcome.
- Jason Weathered (@jasoncodes)