VirtualBox

Opened 14 years ago

Closed 14 years ago

#7769 closed defect (worksforme)

guest control give bogus error message over username

Reported by: ToddAndMargo Owned by:
Component: VM control Version: VirtualBox 3.2.10
Keywords: Cc:
Guest type: Windows Host type: other

Description (last modified by Frank Mehnert)

Host: CentOS 5.5, VB 3.2.10 Guest: Windows Server 2003 R2, SP2

Hi Guys,

Would you guys please improve your guestcontrol error messages?

This from a larger script to control VM before backup:

su $DefaultUser -c "/usr/bin/VBoxManage  --nologo guestcontrol \
                    execute "$VM_Name" "C:\Windows\system32\shutdown.exe" \
                    --arguments "/t 5 /s /d p:2:3" --username "$WinAdminUser" \
                    --password "$WinAdminPassword" --wait-for stdout"

echo "su $DefaultUser -c "/usr/bin/VBoxManage  --nologo guestcontrol  \
                            execute "$VM_Name" "C:\Windows\system32\shutdown.exe" \
                            --arguments "/t 5 /s /d p:2:3" --username "$WinAdminUser" \
                            --password $WinAdminPassword --wait-for stdout""

And here is the result:

Oracle VM VirtualBox Command Line Management Interface Version 3.2.10
(C) 2005-2010 Oracle Corporation
All rights reserved.

Usage:

VBoxManage guestcontrol     execute <vmname>|<uuid>
                            <path to program>
                            --username <name> --password <password>
                            [--arguments "<arguments>"]
                            [--environment "<NAME>=<VALUE> [<NAME>=<VALUE>]"]
                            [--flags <flags>] [--timeout <msec>]
                            [--verbose] [--wait-for exit,stdout,stderr||]


Syntax error: No user name specified!
su todd -c /usr/bin/VBoxManage --nologo guestcontrol execute VB-ABC \
   C:\Windows\system32\shutdown.exe --arguments /t 5 /s /d p:2:3 \
   --username admin --password nottellin --wait-for stdout

You will note that "Syntax error: No user name specified!" does not match up to "--username winadmin"

If I ever figure out what is really wrong, I will report back. In the mean time, I would appreciate it if you made your error messages match up with the real error.

Many thanks, -T

Change History (4)

comment:1 by ToddAndMargo, 14 years ago

Figured out a workaround. This should help you guys come up with a reasonable error message that matches the problem. The problem is how you resolve the quotes inside the "su" command. The workaround is to use single quotes and drop the use of double quotes where possible.

-T

su $DefaultUser -c "/usr/bin/VBoxManage  --nologo guestcontrol execute "$VM_Name" \
   'C:\Windows\system32\shutdown.exe' --arguments '/f /t 5 /s /d p:2:3' \
   --username $WinAdminUser --password $WinAdminPassword --wait-for stdout"

comment:2 by Frank Mehnert, 14 years ago

Description: modified (diff)

comment:3 by Frank Mehnert, 14 years ago

Well, that's a quoting problem.

comment:4 by Frank Mehnert, 14 years ago

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette