Skip to content

Instantly share code, notes, and snippets.

@alwinmark
Created November 2, 2015 09:48
Show Gist options
  • Save alwinmark/7caeac9218162c6370e0 to your computer and use it in GitHub Desktop.
Save alwinmark/7caeac9218162c6370e0 to your computer and use it in GitHub Desktop.
Deletes everything from Virtualbox. Usefull for CI/CD
# loop over all existing VMs
for i in $(VBoxManage list vms | sed 's/.*{\(.*\)}/\1/g'); do
# power them off and delete them
VBoxManage controlvm $i poweroff && VBoxManage unregistervm $i;
# delete everything left
rm -rf ~/VirtualBox VMs
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment