Vagrant not connecting to VirtualBox ?

For about a week I can't bring up any of my development machines because Vagrant can't connect to VirtualBox and gets stuck at "SSH auth method: private key" then disconnects until it hits timeout, the box in virtualbox boots but I can't access the network.

Here's a video showing my problem, maybe someone can guide me where's the problem.

2 thoughts on “Vagrant not connecting to VirtualBox ?”

  1. I’ve had decent luck with adding this line to my Vagrantfile.

    # Don’t secure the local VM, vagrant. That’s crazy talk.

    Another issue I’ve run into it the networking gets “stuck” and you can add this to restart networking and probably apache as part of the init, modify depending on your system.

    config.vm.provision :shell, run: “always” do |s|
    s.inline = “sudo service apache2 restart;sudo service network restart;”

  2. I managed to solve the problem. Somehow the file “private_key” in the “.vagrant” folder got corrupted, this made Vagrant to get stuck on reading the file until it timed-out on the connection so the networking could not get finished and would not work.

    Deleting the “.vagrant” folder and rebuilding the machine solved the problem for me, I hope if someone else has this problem, this will help them too.


Leave a Comment