Detect VM shutdown.
Posted: 29. Jan 2014, 10:59
Hi,
I would like to run some commands when my VM shutsdown. I'm using: "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list runningvms
When the above runs I see a list of running VM's but im not sure how to react on the output of the "list runningVMS"
I have added this into a bat file, currently it will start the VM via the"startvm" command, what I would then like it to do is hang around(!) until the VM stops then run the command?
so
***********************
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm "VM"
rem @exit
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list runningvms
at this point wait until no vms running then do XXX
***********************
any ideas greatly appreciated.
I would like to run some commands when my VM shutsdown. I'm using: "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list runningvms
When the above runs I see a list of running VM's but im not sure how to react on the output of the "list runningVMS"
I have added this into a bat file, currently it will start the VM via the"startvm" command, what I would then like it to do is hang around(!) until the VM stops then run the command?
so
***********************
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm "VM"
rem @exit
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list runningvms
at this point wait until no vms running then do XXX
***********************
any ideas greatly appreciated.