Ubuntu – Execute command before shutdown/reboot


I have a machine running a couple of vagrant VM. The problem I have is that sometimes I forget to shutdown those VM before I shutdown or reboot my machine. Because of that my machine get stuck with this message: waiting for vboxnet0 to become free

I searched about solutions and I found this page :


I tried what they for shutdown, but it doesn't work.

I wrote an sh file for that command:


cd ~/workspace/git/mediaservice
vagrant halt

any suggestions?

Best Answer

If your vagrant VMs are using VirtualBox, you can modify /etc/default/virtualbox and change the line that reads:




That fixed it for me on Ubuntu 14.04.

Related Question