Darren Beale Web developer, retailer & photographer

Halt all Vagrant/VirtualBox VMs one-liner

H

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.

for VM in `VBoxManage list runningvms | awk ‘{ print $2; }’`; do VBoxManage controlvm $VM poweroff; done

By bealers
Darren Beale Web developer, retailer & photographer