vagrant + virtualbox Timed out while waiting for the machine to boot

拥有回忆 提交于 2019-12-10 22:06:52

问题


sorry I'm really new to vagrant I am running vagrant 1.4.3 and virtualbox 4.3.26. and my host OS is ubuntu 14.04.2.

I am a php developer and I'm trying to make my development environment ready for couple of projects.

and every box I try from vagrantbox.es I get the same error when running vagrant up command. and the error is :

Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period. This can
mean a number of things.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

I've looked through same questions and I tried

  config.vm.provider :virtualbox do |vb|
    vb.gui = true
  end

after adding these lines I get login page in my box so its booting and I can run my commands in the GUI interface. but surprisingly I get same error. I thought with myself maybe its because the guest OS couldn't login and I add these lines to my vagrant file

config.ssh.username   = "vagrant"
 config.ssh.password   = "vagrant"
 config.ssh.insert_key = "true"

but I get this error

There are errors in the configuration of this machine. Please fix
the following errors and try again:

SSH:
* The following settings shouldn't exist: insert_key, password

and actually I'm screwed and I don't know what else should I do .


回答1:


go to in virtual box and stop the run connection. click on start and wait for login with user and pass: vagrant. inside of that write this command:

sudo vim /etc/systemd/system/network-online.targets.wants/networking.service

And changing the following line at the end of the file:

TimeoutStartSec=5min

to:

TimeoutStartSec=30sec

I have then rebooted the system and it works fine.




回答2:


I upgraded my vagrant to 1.7.2 and my problem is solved now. but I don't see my box running in virtualbox interface . after all I can now ssh to my box and there is no problem.



来源:https://stackoverflow.com/questions/29320577/vagrant-virtualbox-timed-out-while-waiting-for-the-machine-to-boot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!