I am trying to automate startup/shutdown with VirtualBox 6.0.14 on Catalina host system. Let me clarify first:
- I know how launchd works (keep script running and trap SIGTERM to invoke stop-service code).
- I'm aware of both the "standard" which uses the "standard" VBoxAutostartDarwin.sh script distributed by VirtualBox itself, and of course know how to configure it (e.g. as per https://gist.github.com/str8edgedave/b0 ... 778079ee7b).
Code: Select all
/Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.plist
- I'm also familiar with custom scripts such as https://github.com/freedev/macosx-vbox- ... er/vbox.sh which use VBoxHeadless and trap SIGTERM to run "VBoxManage controlvm VM savestate" (or acpipowerbutton) when launchd signals shutdown.
As it stands, both approaches fail to cleanly shut down for me on Catalina. They run fine on startup. They also perform a clean shutdown of guest VMs if I manually unload the service using launchctl, like this:
Code: Select all
launchctl unload /Library/LaunchDaemons/org.virtualbox.vboxautostart.plist # standard VBoxAutostartDarwin.sh
launchctl unload /Library/LaunchDaemons/home.vbox.vmsvc.plist # custom script written by me
Any help on this will be greatly appreciated.