Skip to content

Instantly share code, notes, and snippets.

@ismakv
Created May 26, 2018 08:24
Show Gist options
  • Save ismakv/04971e13c0449fe7baebfe2e398c0cce to your computer and use it in GitHub Desktop.
Save ismakv/04971e13c0449fe7baebfe2e398c0cce to your computer and use it in GitHub Desktop.
Run off virtual win server
#!/bin/bash
vmName="Windows Server 2008 R2"
if VBoxManage showvminfo "$vmName" | grep -c "running (since"
then
echo Save state of VM...
VBoxManage controlvm "$vmName" savestate
else
echo Runnng VM...
VBoxManage startvm "$vmName" --type headless
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment