Finally got this working on Mountain Lion with VirtualBox 4.2.4. The sample org.virtualbox.vboxautostart.plist file that is provided within the VirtualBox application bundle contains a couple of problematic keys:
Code: Select all
<key>Disabled</key>
<true/>
<key>KeepAlive</key>
<false/>
The VirtualBox documentation makes a point of instructing you to set the Disabled key to <false/>, but you also need to set KeepAlive to <true/> in order to get launchd to automatically start the service at boot (rather than waiting for some undeclared request to trigger the service launch).
My working org.virtualbox.vboxautostart.plist file is:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Disabled</key>
<false/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.virtualbox.vboxautostart</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/VirtualBox.app/Contents/MacOS/VBoxAutostartDarwin.sh</string>
<string>--start</string>
<string>/etc/vbox/autostart.cfg</string>
</array>
</dict>
</plist>
My working /etc/vbox/autostart.cfg file is:
(Although the documentation suggests setting the default_policy to deny and allowing individual users to autostart VMs, I couldn’t get this to work. When my autostart.cfg file was configured that way, the VBoxAutostartDarwin.sh script would output an error stating that the user was not allowed to autostart VMs.)