[Notes] Server script – Start, Stop, Restart with virtual machine

Table of Contents

[Notes] Server script - Start, Stop, Restart with virtual machine

Continous from Bash script for starting VirtualBox VMs

server_start.bat

"C:\Program Files\Oracle\VirtualBox\VBoxManage" startvm "s1" --type headless
"C:\Program Files\Oracle\VirtualBox\VBoxManage" startvm "agriweather" --type headless
"C:\Program Files\Oracle\VirtualBox\VBoxManage" startvm "s2" --type headless

Then make a Task Scheduler

image

server_restart.bat

"C:\Program Files\Oracle\VirtualBox\VBoxManage" controlvm "s1" poweroff --type headless
"C:\Program Files\Oracle\VirtualBox\VBoxManage" controlvm "agriweather" poweroff --type headless
"C:\Program Files\Oracle\VirtualBox\VBoxManage" controlvm "s2" poweroff --type headless
shutdown -r -t 600 -f

server_shutdown.bat

Shutdown machine after 10 minutes

"C:\Program Files\Oracle\VirtualBox\VBoxManage" controlvm "agriweather" poweroff --type headless
"C:\Program Files\Oracle\VirtualBox\VBoxManage" controlvm "s2" poweroff --type headless
"C:\Program Files\Oracle\VirtualBox\VBoxManage" controlvm "s1" poweroff --type headless
shutdown -s -t 600 -f

Leave a Reply

Your email address will not be published. Required fields are marked *