How do I know a VM is ready to accept guestcontrol execute

Discussions about using Windows guests in VirtualBox.
Post Reply
markus5
Posts: 9
Joined: 6. Oct 2010, 19:24
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: xp

How do I know a VM is ready to accept guestcontrol execute

Post 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
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: How do I know a VM is ready to accept guestcontrol execute

Post 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.
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.
Ken Hagan
Posts: 43
Joined: 1. Oct 2009, 17:42
Primary OS: Debian other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows (various)
Location: UK

Re: How do I know a VM is ready to accept guestcontrol execute

Post 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.
Post Reply