Last active
February 10, 2016 10:37
-
-
Save wehappyfew/a19307b4b8bfbddfd924 to your computer and use it in GitHub Desktop.
Start and stop a Virtualbox VM from Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start the vm | |
subprocess.call(["C:\Program Files\Oracle\VirtualBox\VBoxManage.exe", "startvm", "Win7-IE8"]) | |
time.sleep(50) | |
# stop a vm | |
# -set inside the VM from the 'control panel->power options' the os to shutdown when the power button is pressed- | |
subprocess.call(["C:\Program Files\Oracle\VirtualBox\VBoxManage.exe", | |
"controlvm", | |
"WIN7IE8", | |
"acpipowerbutton"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment