vboxmanage guestcontrol execute

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
luxcop
Posts: 7
Joined: 6. Feb 2011, 08:43
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Windows

vboxmanage guestcontrol execute

Post by luxcop »

Hi!

We're planning to upgrade our VirtualBox from 4.0.8 to the recently released 4.1.4 version.
But I'm having trouble with the new syntax of vboxmanage guestcontrol...

In 4.0.8 the following command was working perfectly:

vboxmanage guestcontrol execute "WinXP" "%SystemRoot%\system32\shutdown.exe" --username xxx --password yyy --arguments "-s -f -t 0"

Now in 4.1.4, this should be

vboxmanage guestcontrol "WinXP" execute --image "%SystemRoot%\system32\shutdown.exe" --username xxx --password yyy -- "-s -f -t 0"

But it doesn't work. With the option --wait-stdout, the shutdown.exe command outputs its syntax. So it seems to be that the arguments aren't passed correctly to the VM.

Anyone an idea how to pass arguments correctly to the Windows XP VM with the new syntax?
Or is there a bug?


Greetings,
jzajac2
Posts: 1
Joined: 29. Dec 2011, 00:19
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows XP pro, Windows 8 Dev preview, Windows Vista home Premium

Re: vboxmanage guestcontrol execute

Post by jzajac2 »

the usage for guestcontrol execute with arguments is:

Code: Select all

-- [[<argument1>] ... [<argumentN>]
Each argument you pass to the image needs to be its own parameter to 'guestcontrol execute'

So, change your line to:

Code: Select all

vboxmanage guestcontrol "WinXP" execute --image "%SystemRoot%\system32\shutdown.exe" --username xxx --password yyy -- "/s" "/f" "/t" "0"
Also note I seem to have better luck with slashes (/) instead of dashes (-) when sending arguments this way.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: vboxmanage guestcontrol execute

Post by Sasquatch »

jzajac2 wrote:Also note I seem to have better luck with slashes (/) instead of dashes (-) when sending arguments this way.
That depends on the arguments required for the command. E.g. the shutdown.exe command on Windows does not accept slashed arguments like you suggest. It's of little use to use / or -, if it's not the arument/parameter character. On Linux, most if not all commands that have parameters/arguments use either a single or dual dash, slashes won't work. Windows is an odd one, because ipconfig uses slashed arguments, while shutdown uses dashed ones.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
Post Reply