In OS X, using the VirtualBox command-line interface, how can I instruct the virtual machine to open the URL in a web browser?

From a terminal on Mac OS X, I want to use VBoxManage guest control to manage Windows XP on a VirtualBox virtual machine to open a URL in Internet Explorer.

+4
source share
2 answers

Actions

  • Start the virtual machine: VBoxManage startvm "{VM NAME}" --type headless
  • Open the URL: 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 happens, you can omit this.

Getting a short name

An easy way to get a shortcut to the browser is to open cmd.exe and run; cd "{NORMAL LONG PATH TO BROWSER}" , then command and a short path name will appear.

Params

  • {VM NAME} == A name that depends on the name of the virtual machine.
  • {USERNAME} == The username of the system on the guest system running on the virtual machine, not the display name.
  • {PASSWORD} == Password for the specified account
  • {URL TO OPEN} == eg: /fooobar.com / ...
  • {SHORT PART TO BROWSER} == for example: C: \ DOCUME ~ 1 \ JAMIE ~ 1 \ LOCALS ~ 1 \ APPLIC ~ 1 \ GOOGLE \ CHROME \ APPLIC ~ 1 \ chrome.exe

Example

To open IE9 from a virtual machine accessible from https://github.com/xdissent/ievms

 VBoxmanage guestcontrol 'IE9 - Win7' exec 'C:\Progra~1\Intern~1\iexplore.exe' --username 'IEUser' --password 'Passw0rd!' 'http://google.com' 

Credit

Thanks to http://www.quora.com/Chapley-Watson for this answer, I searched all over the place, including Stack Overflow, and received no answers. Hope this helps someone.

+18
source

Completion of fold_left response for new version of VBox 5.0.2

With the new version, they changed some commands. The process will be as follows:

Steps:

  • Start the virtual machine: VBoxManage startvm "{VM NAME}" --type headless (no change)
  • Open the URL: VBoxmanage guestcontrol "{VM NAME}" start --exe "{SHORT PATH TO THE BROWSER}" --username "{USER NAME}" --password "{PASSWORD}" -- iexplore "{URL TO OPEN}" . ( new teams )

Example

To open IE9 from a virtual machine accessible 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'

0
source

All Articles