Vagrant Halt Alias

The number of times I have run the command vagrant down to stop a Vagrant machine is kind of ridiculous. vagrant down makes sense as a counterpart to vagrant up. Fortunately, we can create aliases!

In side your VAGRANT_HOME directory, ~/.vagrant.d by default, create a file named aliases. Inside that file add these lines:

# run `vagrant halt` for `vagrant down`
down = halt

Done! No more raging when you get the output of vagrant -h instead of a halted machine.

It’s also possible to create more advanced aliases.

# completely rebuild vagrant environment
rebuild = !vagrant destroy -f && rm -rf .vagrant && vagrant up

Happy aliasing!