ssh - Vagrant stuck in "Waiting for VM to Boot" -


i want preface question mentioning have indeed looked on if not vagrant "waiting vm boot" troubleshooting threads:

things i've tried include:

  1. vagrant failed connect vm

  2. https://superuser.com/questions/342473/vagrant-ssh-fails-with-virtualbox

  3. https://github.com/mitchellh/vagrant/issues/410

  4. http://vagrant.wikia.com/wiki/usage

  5. http://scotch.io/tutorials/get-vagrant-up-and-running-in-no-time

and more.

here's how setup vagrant:

note: using vagrant 1.2.2 since not @ moment have time change configs newer versions. using virtualbox 4.2.26.

  1. my office has /official/ folder includes things such vagrantfile inside. inside vagrantfile these custom settings:
  config.vm.box = "my_box"    config.ssh.private_key_path = "~/.ssh/github_rsa"   config.ssh.forward_agent = true   config.ssh.forward_x11 = true   config.ssh.max_tries = 300   config.vm.provision :shell, :inline => "/etc/init.d/networking restart" 
  1. i installed our custom box (called package.box) via vagrant box add my_box absolute_path/package.box went without hitch.

  2. running vagrant up, @ "preview" of virtualbox, , stuck @ login page. terminal say: waiting vm boot. can take few minutes. far know, ssh issue. or private key issues, though in vagrantfile explicitly pointed private key location.

interesting notes:

  1. running dhclient within virtualbox gui, says command no found. running sudo dhclient eth0 1 of suggested fixes.

  2. this fix: https://superuser.com/a/343775/298915 of "modify /etc/rc.local file include line sh /etc/init.d/networking restart before exit 0." did nothing fix issue.

conclusion:

having tried re-install thinking messed file, did not seem ameliorate issue. unable work issue. give me insight?

so after around twelve hours of dejected troubleshooting, able (finally) vm boot.

  1. setup private/public keys using link provided. box debian linux 3.2.0-4-amd64, instead of /root/.ssh/id_rsa.pub, have use /home/vagrant/.ssh/id_rsa.pub (and respective id_rsa path private key).

    note: make sure files have right permissions. check using ls -l path, , change using chmod. machine may not have /home/vagrant/.ssh/authorized_keys, generate file touch /home/vagrant/.ssh/authorized_keys.

  2. boot vm using virtualbox gui using (through either vagrantfile boot-gui command, or starting vm using virtualbox). login using vagrant , vagrant when prompted.

  3. within gui, manually start dhclient using sudo dhclient eth0 -v. why off default? have no idea. found out off when tried wget private/public keys in tutorial above, unable to.

  4. go local machine's command line , reload vagrant using vagrant reload. should boot, , no longer hang @ "waiting vm boot."

this worked me. though may different other machines, whatever reason vagrant likes break.

suggestion: can saved script don't need manually everytime?

edit: update latest version of vagrant, , never see issue again. time, huh?


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -