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:
https://superuser.com/questions/342473/vagrant-ssh-fails-with-virtualbox
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.
- my office has
/official/
folder includes things suchvagrantfile
inside. insidevagrantfile
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"
i installed our custom box (called
package.box
) viavagrant box add my_box absolute_path/package.box
went without hitch.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 invagrantfile
explicitly pointed private key location.
interesting notes:
running
dhclient
within virtualbox gui, says command no found. runningsudo dhclient eth0
1 of suggested fixes.this fix: https://superuser.com/a/343775/298915 of "modify
/etc/rc.local
file include linesh /etc/init.d/networking restart
beforeexit 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.
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 respectiveid_rsa
path private key).note: make sure files have right permissions. check using
ls -l path
, , change usingchmod
. machine may not have/home/vagrant/.ssh/authorized_keys
, generate filetouch /home/vagrant/.ssh/authorized_keys
.boot vm using virtualbox gui using (through either
vagrantfile
boot-gui command, or starting vm using virtualbox). login usingvagrant
,vagrant
when prompted.within gui, manually start dhclient using
sudo dhclient eth0 -v
. why off default? have no idea. found out off when triedwget
private/public keys in tutorial above, unable to.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
Post a Comment