在 OS X 上,使用 VirtualBox 的命令行界面,如何指示虚拟机在 Web 浏览器中打开 URL?
从 Mac OS X 的终端中,我想使用 VBoxManage guestcontrol 来控制 VirtualBox 虚拟机中的 Windows XP,以在 Internet Explorer 中打开 URL。
From Terminal in Mac OS X, I want to use VBoxManage guestcontrol to control Windows XP in a VirtualBox Virtual Machine, to open a URL in Internet Explorer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
步骤
VBoxManage startvm "{VM NAME}" --type headless
VBoxmanage guestcontrol "{VM NAME}" exec "{SHORT PATH TO THE BROWSER}" - -用户名“{USER NAME}”--密码“{PASSWORD}”“{URL TO OPEN}”
。Headless
--type headless
选项是可选的,如果您想查看发生了什么,可以忽略此选项。获取短名称
获取浏览器短路径的简单方法是打开 cmd.exe 并运行;
cd "{NORMAL LONG PATH TO BROWSER}"
然后command
将显示短路径名称。参数
示例
从可用的 VM 打开 IE9 https://github.com/xdissent/ievms
感谢
http://www.quora.com/Chapley-Watson 为了这个答案,我搜索了所有地方,包括 Stack溢出并没有得到回复。希望这会对某人有所帮助。
Steps
VBoxManage startvm "{VM NAME}" --type headless
VBoxmanage guestcontrol "{VM NAME}" exec "{SHORT PATH TO THE BROWSER}" --username "{USER NAME}" --password "{PASSWORD}" "{URL TO OPEN}"
.Headless
The
--type headless
option is optional, if you want to see what's happening you can omit this.Getting the short name
An easy way to get the short path to the browser is to open cmd.exe and run;
cd "{NORMAL LONG PATH TO BROWSER}"
thencommand
and the short path name will be displayed.Params
Example
To open IE9 from the VM available from https://github.com/xdissent/ievms
Credit
Thanks to http://www.quora.com/Chapley-Watson for this answer, I'd searched all over the place including Stack Overflow and got no replies. Hopefully this will help someone.
正在完成 VBox 5.0.2 新版本的 Fold_left 答案
在新版本中,他们更改了一些命令。该过程如下:
步骤:
VBoxManage startvm "{VM NAME}" --type headless
(无更改)VBoxmanage guestcontrol "{VM NAME} " start --exe "{浏览器的短路径}" --用户名 "{用户名}" --密码 "{PASSWORD}" -- iexplore "{要打开的 URL}"
。 (新命令)示例
从 https://github.com 上提供的 VM 打开 IE9 /xdissent/ievms
VBoxmanage guestcontrol 'IE9 - Win7' start --exe 'C:\Progra~1\Intern~1\iexplore.exe' --username 'IEUser' --密码'Passw0rd!' -- iexplore 'http://www.wikipedia.org'
Completing fold_left answer for new version of VBox 5.0.2
With new version they have changed some commands. The process will be as follows:
Steps:
VBoxManage startvm "{VM NAME}" --type headless
(no changes)VBoxmanage guestcontrol "{VM NAME}" start --exe "{SHORT PATH TO THE BROWSER}" --username "{USER NAME}" --password "{PASSWORD}" -- iexplore "{URL TO OPEN}"
. (new commands)Example
To open IE9 from the VM available from https://github.com/xdissent/ievms
VBoxmanage guestcontrol 'IE9 - Win7' start --exe 'C:\Progra~1\Intern~1\iexplore.exe' --username 'IEUser' --password 'Passw0rd!' -- iexplore 'http://www.wikipedia.org'