Notes to self

What to do if Vagrant machine becomes unresponsive (KVM)

If you are using Vagrant with KVM (with vagrant-libvirt plugin) on Fedora, you might have experienced that sometimes the KVM virtual machine becomes unresponsive. Simply put you would wait forever for trying to ssh to the machine using vagrant ssh. It unfortunately happens to me sometimes when my laptop goes to sleep. So the simple answer is to avoid this and to always halt your Vagrant VMs when you finished working. Here is another thing to try out if you that happens and you don’t want to recreate the machine from scratch (vagrant destroy && vagrant up).

The thing to try without any debugging is to simply reset the VM. You can achieve that using virt-manager, just find your Vagrant VM (named by default as $working_directorydefault), right click on it and hit Shut Down -> Force Reset. Afterwards go back to your project’s directory and run vagrant halt && vagrant up if you need to sync the VM (e.g. when using NFS shares).

Check out my book
Deployment from Scratch is unique Linux book about web application deployment. Learn how deployment works from the first principles rather than YAML files of a specific tool.
by Josef Strzibny
RSS