将参数传递给 VirtualBox MacOS 终端

Passing Arguments to VirtualBox MacOS Terminal

尝试将一些参数传递到 MacOS VirtualBox VM 上的终端(来自 Windows 10 主机)。我可以让终端正确启动,但参数不起作用。

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" guestcontrol "MacOS High Sierra New" run "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal" --username justin --password password --wait-stdout --"/c echo test"

我是不是漏了一面旗子什么的?另外,如果有更好的方法在 VM 中执行 运行 shell 命令,我会洗耳恭听。谢谢!

在尝试了大约 8 小时不同的东西后终于让它工作了:

VBoxManage guestcontrol "vmname" run /bin/sh --username usr --password pass --verbose --wait-stdout --wait-stderr -- -c "echo test"