If you’re using Vagrant to control your dev VMs on a headless server it’s easy to lose track of the number of running machines.
Here’s a one-liner to gracefully shut-down all of them to free up some resources.
<span class="lang:default decode:true crayon-inline ">for VM in `VBoxManage list runningvms | awk '{ print $2; }'`; do VBoxManage controlvm $VM poweroff; done</span>
Code language: JavaScript (javascript)
Leave a Reply