I’ve been using Vagrant on a daily basis for over a year now, and there is one common issue I run into: Sometimes VirtualBox’s network will hang and I need to force shutdown & re-up the instance. If you use NFS on Mac, this will also require some administrator privileges half the way through the process.
So what did I do? I made an alias for my terminal. In my
~/.bash_profile file I added this line:
alias vurp="sudo -v ; vagrant halt -f ; vagrant up"
What that does is it first prompts me to refresh my sudo password at the very beginning, then force halts the vagrant instance, then ups it again.
It’d be nice if I didn’t have to do this, but hey, it only happens once and awhile.