I deleted the directory that contained the .vagrant file. When I up a new VM it\'s complaining about ports being in use. So how do I destroy a VM without having it\'s .vagrant f
The following bash function would poweroff and destroy all files related to all VMs for the current user:
function killvms() {
VBoxManage list runningvms | awk '{print $2;}' | xargs -I vmid VBoxManage controlvm vmid poweroff
VBoxManage list vms | awk '{print $2;}' | xargs -I vmid VBoxManage unregistervm --delete vmid
}
Add it to your ~/.bash_aliases
and call it in your shell via killvms
.