简体   繁体   English

将参数传递给VirtualBox MacOS终端

[英]Passing Arguments to VirtualBox MacOS Terminal

Trying to pass some arguments into Terminal on a MacOS VirtualBox VM (from a Windows 10 host). 尝试将一些参数传递到MacOS VirtualBox VM上的终端(来自Windows 10主机)。 I can get Terminal to launch correctly, but the arguments aren't working. 我可以让终端正确启动,但参数不起作用。

"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"

Am I missing a flag or something? 我错过了一面旗帜吗? Also, if there's a better way to run shell commands in a VM, I'm all ears. 另外,如果有更好的方法在VM中运行shell命令,我会全力以赴。 Thanks! 谢谢!

经过大约8个小时尝试不同的事情后,终于让它工作了:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM