Simple workflow to use VirtualBox virtual machine on testing
If you want to use VirtualBox virtualmachine for testing you can easily script it like this
- Restore virtual Machine to wanted snapshot
- Start virtual machine on headless mode
- Excute your process
- Power off virtual machine
- Restore to snapshot
so it would be something like this
"<path to VBoxManage.exe>" snapshot "<virtual machine name>" restore <shapshot name>
"<path to VBoxManage.exe>" startvm "<virtual machine name>" -type headless
restore <shapshot name>
"<path to VBoxManage.exe>" controlvm "<virtual machine name>" poweroff
"<path to VBoxManage.exe>" snapshot "<virtual machine name>" restore <shapshot name>
for example
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" snapshot "testmachine" restore Initial
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" startvm "testmachine" -type headless
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" controlvm "testmachine" poweroff
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" snapshot "testmachine" restore Initial
No comments:
Post a Comment