Running `VBoxManage startvm ...`: how can I tell when the VM is running?

StackOverflow https://stackoverflow.com/questions/22446152

  •  15-06-2023
  •  | 
  •  

Question

I tried using VBoxManage guestproperty wait <vmname> ... but what looked like obvious patterns didn't work. I'm writing a script which imports a new VM, configures it, launches it, takes a snapshot, and then closes it, and obviously I need to know when the VM is running before taking the final two steps.

Thanks.

Était-ce utile?

La solution

You can use showvminfo output:

for Linux:

VBoxManage showvminfo "vm_name" | grep State

for Windows:

VBoxManage showvminfo "vm_name" | findstr State

See the thread below:

https://unix.stackexchange.com/questions/28611/how-to-automatically-start-and-shut-down-virtualbox-machines

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top