Page 1 of 1
How do I know a VM is ready to accept guestcontrol execute
Posted: 6. Oct 2010, 20:01
by markus5
I can start a VM with a batch file, but it takes a while for everything to be ready so that the guestcontrol execute will work.
How can I detect that everything is ready?
Should I just look at the results of vboxmanage and try again?
Does the Windows version of vboxmanage set a return code that can be tested with ERRORLEVEL in a batch file?
Regards.
Mark K Vallevand
Re: How do I know a VM is ready to accept guestcontrol execute
Posted: 9. Oct 2010, 01:45
by Sasquatch
I guess you can try it by pinging the Guest on one of it's network adapters (use Host-Only, works all the time) to see if the OS is booted. Then send the control commands. You can also check if information is returned when you send a query for information about the Guest Additions. Don't know how to do that or what you need to get the information. Should be in the manual, something to do with the VBoxManage command too.
Re: How do I know a VM is ready to accept guestcontrol execute
Posted: 21. Dec 2010, 16:25
by Ken Hagan
I've used...
VBoxManage -q startvm "MyVmName" --type vrdp
VBoxManage -q guestproperty wait "MyVmName" /VirtualBox/GuestInfo/Net/0/Status --timeout 60000
Sleep 30
I hope that the Sleep 30 command is just paranoia on my part. (If you don't have "Sleep", then you can use ping with a fixed number of pings and count seconds that way.) The second command waits for the status of the guest's network adapter to change from <not actually available> to <something> and this appears to happen after most of the hard work of booting has completed.