What's the best way to run shell commands on a MacOS guest VM? Can't seem to run it through VirtualBox's guestcontrol, only lets you launch apps, not run commands directly. Saw some people suggest SSH, but wanted to see if there's a more direct way before I start down that path. Thanks!
Finally got it working after about 8 hours of trying different things:
VBoxManage guestcontrol "vmname" run /bin/sh --username usr --password pass --verbose --wait-stdout --wait-stderr -- -c "echo test"
Hope this helps someone else!
If your guest OS is macOS, try having VBoxManage guestcontrol /bin/bash -c "commandToExecute"
SSH is a perfectly fine solution as long as you have a reliable way to get the IP address and your guest VM exposes SSH, has a key setup, etc.