Vagrant up and reload - default: Warning: Connection timeout. Retrying...

Instead of destroying the image. I was able to fix the issue by first adding the following lines/uncomment inside Vagrantfile to turn the virtualbox gui on.

config.vm.provider "virtualbox" do |vb|
 vb.gui = true
 vb.memory = "1024"
end

Then I did vagrant up to reboot it. It started both command line and virtualbox gui. Gui asked me for SSH passphrase (which I set up when I was playing with ssh last time I was logged into the machine) and I was able to login. Later I powered off the image. Later I removed above lines for gui from Vagrantfile and it was still booting fine.


After struggling with all the various options available on different questions, I was still facing the same problem. Finally, I did a

vagrant destroy

followed by

vagrant up

And I have my system working again.

Note: If you too have the habit to directly switch off your computer, you might face this problem soon! In your vagrant terminal (vagrant ssh), always go for a:

sudo shutdown -h now

or you can just type

vagrant halt

after you logout from your ssh.

PS: For those of you who might be afraid to lose your data/code/anything during vagrant destroy, you might relax! I was hesitant using the command, but as per the documentation, all it does is:

This command stops the running machine Vagrant is managing and destroys all resources that were created during the machine creation process. After running this command, your computer should be left at a clean state, as if you never created the guest machine in the first place.

This implies that your code will remain intact, and the next vagrant up would lead you to the same state as you left, only with the problem solved now. :)