[vbox-dev] VB 4.3 and VBoxManage guestcontrol

Jeff Macdonald macfisherman at gmail.com
Fri Oct 25 20:34:27 UTC 2013


Hi,

I use VBoxManage to automate VM creation/configuration/etc. My script
used guestcontrol stat to see if a VM was finished booting:

VBoxManage guestcontrol vmtest stat / --username=root --password=root

normally this command gives me an error until the VM is fully booted.
However, now it just hangs forever. The VM then becomes non
responsive.

I found a work around for VM readyness using guestproperty wait:
guestproperty wait vmtest /VirtualBox/GuestInfo/OS/NoLoggedInUsers

However, I have other guestcontrol commands that I use - execute for
instance. These seem to work but when the VM is powered off, while the
VM looks like it powered off, the process still exists and has to be
killed manually. This is easily seen by doing the following:

$ VBoxManage startvm testvm
$ VBoxManage guestcontrol testvm execute --wait-stdout --username=root
--password=root --image /bin/ls
bin
boot
dev
etc
home
lib
lib64
lost+found
media
mnt
opt
proc
root
sbin
selinux
srv
sys
tmp
usr

$ VBoxManage guestcontrol testvm execute --wait-stdout --username=root
--password=root --image /sbin/poweroff

# wait for VM to shutdown

$ VBoxManage startvm testvm VBoxManage: error: The machine 'testvm' is
already locked by a session (or being locked or unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE
(0x80bb0007), component Machine, interface IMachine, callee
nsISupports
VBoxManage: error: Context: "LaunchVMProcess(a->session,
sessionType.raw(), env.raw(), progress.asOutParam())" at line 592 of
file VBoxManageMisc.cpp

# notice process is still running

Host OS is OS X 10.7.5
GuestOS is CentOS 6.4

Can anyone else confirm what I'm seeing?


-- 
Jeff Macdonald
Ayer, MA



More information about the vbox-dev mailing list