Page 1 of 1

vboxmanage guestcontrol execute

Posted: 5. Oct 2011, 17:35
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,

Re: vboxmanage guestcontrol execute

Posted: 30. Dec 2011, 21:13
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.

Re: vboxmanage guestcontrol execute

Posted: 30. Dec 2011, 21:42
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.