Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes hangs on "Waiting for VM to boot. This can take a few minutes." #455

Closed
jonleighton opened this issue Aug 5, 2011 · 95 comments

Comments

Projects
None yet
@jonleighton
Copy link

commented Aug 5, 2011

HI there,

Sometimes (I mean, fairly often, maybe 30-50% of the time for me) vagrant seems to hang on:

Waiting for VM to boot. This can take a few minutes.

I mean possibly it would finish eventually, but I have never waited to potentially infinite length of time to see. It certainly seems to take longer than 'usual', when I do manage to successfully boot.

When this happens, the only thing I can do is poweroff the VM through VBoxManage and try again.

Is there any way I can get more output about what it's doing in order to help debug this?

Cheers

@wsc

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2011

This has happened to me for a while now and I'm not sure what's up.

@pattern

This comment has been minimized.

Copy link

commented Aug 6, 2011

I have noticed the same. It feels very "non-deterministic" in that there is an random chance the VM will just keep thrashing at 100% CPU. I found that when I didn't specify a config.vm.network in the Vagrantfile, there is a much lower chance of the VM entering this state. This makes me think it has something to do with the networking/dhcp configuration. For what it's worth, I also have config.ssh.max_tries = 100.

Were either of you using config.vm.network to specify a specific IP? If so, try commenting it out and see if that works.

@tomusher

This comment has been minimized.

Copy link

commented Aug 6, 2011

Same problem here; seems to have started when I updated my lucid32.box to fix #445.

I'm not setting config.vm.network but it does seem network configuration related - to work around it I'm using config.vm.boot_mode = :gui and when it gets stuck, manually logging in to the machine and running sudo /etc/init.d/networking restart.

@ThePixelDeveloper

This comment has been minimized.

Copy link

commented Aug 29, 2011

This happens to me too:

[mathew@thepixeldeveloper]$ vagrant up
[default] VM already created. Booting if its not already running...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- ssh: 22 => 2222 (adapter 1)
[default] Cleaning previously set shared folders...
[default] Creating shared folders metadata...
[default] Running any VM customizations...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] Failed to connect to VM!
Failed to connect to VM via SSH. Please verify the VM successfully booted
by looking at the VirtualBox GUI.

I can see the machine has booted with the GUI.

I also tried using the vagrant ssh command when the vagrant up command failed. SSH fails with the following error message:

[mathew@thepixeldeveloper]$ vagrant ssh
ssh_exchange_identification: Connection closed by remote host

Rebooting sudo reboot from the GUI fixes this for me.

Gems

  • vagrant (0.8.6, 0.8.5)
  • virtualbox (0.9.2, 0.9.1, 0.9.0)

Virtualbox

Virtualbox 4.1.2r73507

@AlexMikhalev

This comment has been minimized.

Copy link

commented Aug 29, 2011

bump. I just posted question in a group with a same issue.
My vagrant up works only once after reboot/ reinstall Virtual Box.

@ThePixelDeveloper

This comment has been minimized.

Copy link

commented Aug 29, 2011

Quick question, are you guys running boxes built with VeeWee?

@jonleighton

This comment has been minimized.

Copy link
Author

commented Aug 29, 2011

I am not

@AlexMikhalev

This comment has been minimized.

Copy link

commented Aug 29, 2011

No, clean vagrant.
But I think I found a solution - check your networking settings for Virtual Box. (on Mac command +, then Networking, host only networks. I deleted a host only network which happened to be there and now I can restart my VMs without restarting Mac.
Folks if you can confirm verify it, that would be excellent.

@ThePixelDeveloper

This comment has been minimized.

Copy link

commented Aug 29, 2011

I only have one networked device listed (NAT).

@AlexMikhalev You have two networked devices because at some point you enabled the

# Assign this VM to a host only network IP, allowing you to access it
# via the IP.
config.vm.network "33.33.33.10"

option which meant Vagrant created the Host-Only interface.

However, still having just the NAT interface was no improvement for me.

@AlexMikhalev

This comment has been minimized.

Copy link

commented Aug 29, 2011

@ThePixelDeveloper I didn't mean second adapter on VM, but common settings for host only networks in Virtual Box preferences - basically I removed vboxnet0 completely from my host. But it didn't help in truth.

@ThePixelDeveloper

This comment has been minimized.

Copy link

commented Aug 29, 2011

I suspect this is a VirtualBox bug. The networking interface is failing to get an IP address from the DHCP server for whatever reason. Which releases of Virtualbox are we running? I can rule out Virtualbox 4.1.2r73507 already, I'll go backwards until it's "fixed"

@AlexMikhalev

This comment has been minimized.

Copy link

commented Aug 29, 2011

I think it may be related to issue described here:
http://blog.techprognosis.com/2011/02/28/how-to-enable-dhcp-in-virtualbox-4.html
I have a feeling that DHCP server for NAT addresses broken, but I wasn't able to influence it with commands like:
VBoxManage dhcpserver add –netname vboxnet0 –ip 10.0.3.100 –netmask 255.255.255.0 –lowerip 10.0.3.101 –upperip 10.0.3.254 –enable
I know it should be for internal network, but I feel that dhcp server for NAT doesn't work or issue incorrect IP addresses.

@ThePixelDeveloper

This comment has been minimized.

Copy link

commented Aug 29, 2011

I don't think it's broken because if it was then you wouldn't be able to get an IP address running sudo dhclient. Lets see ...

  • Is this isolated to Vagrant boxes?
  • Does anyone have problems on the same operating system, but not built with Vagrant/VeeWee?

I have another Ubuntu server I just booted and don't have such problems (it doesn't have the VBadditions). I installed the VBadditions and still no problems there. Very very strange.

@AlexMikhalev

This comment has been minimized.

Copy link

commented Aug 29, 2011

I do not use VeeWee.
In my VBox logs difference between successful boot and failed in these lines:
00:00:26.584 NAT: IPv6 not supported
00:00:26.622 NAT: DHCP offered IP address 10.0.2.15
00:00:26.623 NAT: DHCP offered IP address 10.0.2.15
while hang up start finishes at:
00:00:24.642 NAT: IPv6 not supported

I use lucid32 and lucid64 base boxes and both have same issue. This issue is not related to vagrant specifically in my case as I have a same problem trying to start vagrant generated boxes from virtual box GUI - sometimes I get ip (10.0.2.15), sometimes I don't - so I need to run sudo dhclient and get same ip from DHPC server 10.0.2.15.
If I start two VM's - one with lucid32 and other with lucid64, they both have same IP - 10.0.2.15 after I will run `sudo dhclient'

@AlexMikhalev

This comment has been minimized.

Copy link

commented Aug 29, 2011

update: I downloaded box from http://opscode-vagrant-boxes.s3.amazonaws.com/ubuntu10.04-gems.box - same behaviour, I can start it first time with vagrant up successfully, shut it down, then attempt to start again with vagrant up hangs forever.

@ThePixelDeveloper

This comment has been minimized.

Copy link

commented Aug 29, 2011

This issue is not related to vagrant specifically in my case as I have a same problem trying to start vagrant generated boxes from virtual box GUI

I mean you should try and install and run the operating system without using a vagrant base box.

I have another that works fine, you should try it too, then we can confirm if it's to do with Vagrant or not.

Look at this for the explanation of the 10.0.2.15 IP Address


Edit. I'm out of ideas on this one. I've built a system using box using VeeWee which works as expected, then seemingly fails once it's been compiled into a box and imported into Vagrant. I have no idea what Vagrant does to the image when it's been packaged, maybe something to look into.

@ThePixelDeveloper

This comment has been minimized.

Copy link

commented Aug 30, 2011

I fixed this for me, or at least I think I did. Start the troubled machine in gui mode, login and execute the following commands as root:

  1. rm /var/lib/dhcp3/* - Removes any existing DHCP leases

Disable automatic udev rules for network interfaces in Ubuntu

  1. rm /etc/udev/rules.d/70-persistent-net.rules
  2. mkdir /etc/udev/rules.d/70-persistent-net.rules

The machine now starts up and has the correct IP address.


Perhaps this has something to do with the different network adapter MAC addresses. The base box would have been built on a VirtualBox instance where the MAC is different to the one that your using now, just a thought.

@AlexMikhalev

This comment has been minimized.

Copy link

commented Aug 30, 2011

ThePixelDeveloper - tried you solution, doesn't work for me on lucid32.

@rozza

This comment has been minimized.

Copy link

commented Sep 1, 2011

setting gui on and then manually logging in and restarting networking fixed it for me..

@niko

This comment has been minimized.

Copy link

commented Sep 4, 2011

Had the same issue. I could work around by booting in gui mode, logging in and manually doing


@ThePixelDeveloper

This comment has been minimized.

Copy link

commented Sep 6, 2011

Any progress on this? It's definitely Vagrant causing trouble here, from my experiments every other machine I've built with VirtualBox (with the same configuration) doesn't show this problem.

To be more clear, something happens when Vagrant builds the box and not when Vagrant launches the box. So booting the box without the help of Vagrant still displays the problem. If someone can point me towards the code where Vagrant does its building I can take a look.

@jonleighton

This comment has been minimized.

Copy link
Author

commented Sep 6, 2011

What version of VirtualBox are you all using?

I haven't experienced the problem recently, and I think VirtualBox may have been upgraded on my system at some point after I filed this bug (I'm on Fedora so I have package management...)

My current VirtualBox version is 4.1.2 r73507. Anyone on the same or later and still experiencing this?

@rozza

This comment has been minimized.

Copy link

commented Sep 6, 2011

Its happening to me on: VirtualBox version is 4.1.2 r73507

@niko

This comment has been minimized.

Copy link

commented Sep 6, 2011

I had the issue with the lucid32 box (http://www.vagrantbox.es/1/). Using
the ubuntu 11.04 box (http://www.vagrantbox.es/26/) doesn't show the issue.

@sickill

This comment has been minimized.

Copy link

commented Sep 9, 2011

Same issue here. (Ubuntu 11.04, VirtualBox 4.1.2, vagrant 0.8.6).

I wanted to try ubuntu 11.04 box (http://www.vagrantbox.es/26/) but after downloading I got:

[vagrant] Extracting box...
[vagrant] Verifying box...
[vagrant] Cleaning up downloaded box...
The box file you're attempting to add is invalid. This can be
commonly attributed to typos in the path given to the box add
command. Another common case of this is invalid packaging of the
box itself.
@AlexMikhalev

This comment has been minimized.

Copy link

commented Sep 9, 2011

I had a repeatable same issue with Mac OS X Snow Leopard and Ubuntu 10.04 LTS as a virtual box hosts.
I repeat it with various boxes - building box using VeeWee or downloading ready ones.

@flashingpumpkin

This comment has been minimized.

Copy link

commented Sep 11, 2011

Same issue here. After starting in gui mode, logging in and doing sudo /etc/init.d/networking restart it'll work from command line again.

This issue is very annoying as it happens on every new box after installing the first one.

@frozenskys

This comment has been minimized.

Copy link

commented Sep 13, 2011

I can confirm this is happening on my OS X Lion box as well, problem is with both Lucid64 and Natty64 boxes. I have tried both VirtualBox from 4.1.0 to 4.1.2 and the problem occurs on virtually every vagrant up command. vagrant is now unusable due to this issue :(

@ThePixelDeveloper

This comment has been minimized.

Copy link

commented Sep 13, 2011

Can we confirm it only happens with Vagrant and NOT with a VirtualBox Machine with the same specifications (disk, network, etc ...).

@mikhailov

This comment has been minimized.

Copy link

commented Sep 13, 2011

there is a temporary solution until Virtualbox DHCP dhclient fixed:

  1. run virtual machine with :gui

  2. sudo vi /etc/rc.local

' #/bin/sh -e
' sh /etc/init.d/networking restart
' exit 0
  1. sudo halt
@cemerick

This comment has been minimized.

Copy link

commented Sep 13, 2013

@reinink had a failure on my first try with the box you mentioned. @mitchellh Seems this is not closed, and/or different from the ssh problem in #391?

@podollb

This comment has been minimized.

Copy link

commented Sep 13, 2013

I started using this base box and haven't had any problems since:
https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box

@reinink

This comment has been minimized.

Copy link

commented Sep 14, 2013

@cemerick Yeah, sorry, as mentioned in my update, I'm having issues on all Raring (Ubuntu 13.04) versions.

@podollb From my testing, this issue is limited to Raring. Quantal (Ubuntu 12.10) is fine, and so is Saucy (Ubuntu 13.10).

@cemerick

This comment has been minimized.

Copy link

commented Sep 14, 2013

@reinink No worries, I was just confirming your "update" re: the raring box not addressing the problem. :-)

Good to know re: Saucy. We'll see how it pans out next month.

@podollb

This comment has been minimized.

Copy link

commented Sep 15, 2013

I was actually having this problem (intermittently) with all the boxes:
https://cloud-images.ubuntu.com/vagrant/**/*.box

@vincecima

This comment has been minimized.

Copy link

commented Sep 18, 2013

Still having this issue on Windows with 1.3.2. All VMs seem to take longer to boot in comparison with 1.2.7. No luck at all booting a Raring VM.

So booting the VM, letting Vagrant time out, halting the VM and booting again seems to work. Still takes a long time for Vagrant to see the booted VM.

@wsouto

This comment has been minimized.

Copy link

commented Sep 23, 2013

I think I'm having the same issue, let me describe here.

I did myself a Raring 64 machine, basically following the step in the postinstall.sh.

After vagrant up, the machine boots, you can even ssh to the machine normally when vagrant keeps wainting for boot, which is taking a long long time, and then vagrant follows mounting the shared folder. Bottom line, everything goes fine, but with a long time in "Waiting for machine to boot." even with machine already booted.

I'm using vagrant 1.3.2 on Windows.
Sorry if it's not related or not the same issue...

@SunSparc

This comment has been minimized.

Copy link

commented Sep 23, 2013

I am going to have to add a "me too". On OS X 10.8.5, VirtualBox 4.2.18 r88780, Vagrant 1.3.1, Raring 64bit.

@razius

This comment has been minimized.

Copy link

commented Sep 26, 2013

+1

VirtualBox 4.2.10_Ubuntu, Vagrant 1.3.3 on Ubuntu 13.04 64bit with any 32bit or 64bit images of Ubuntu 12.04, 12.10 or 13.04 from http://cloud-images.ubuntu.com/vagrant/

Logging in into the machine using :gui mode and restarting the network (sudo /etc/init.d/networking restart) "fixes" it.

@ezintz

This comment has been minimized.

Copy link

commented Oct 7, 2013

+1 from me to this issue.

I've build a clean new base box with Debian Wheezy following the instructions on this page: http://docs-v1.vagrantup.com/v1/docs/base_boxes.html

Restarting the networking service does not fixes the problem for me.

OS: OS X 10.8.5
Vagrant: 1.3.4
VirtualBox: 4.2.18 r88780

@nocive

This comment has been minimized.

Copy link

commented Oct 7, 2013

+1 from me on this as well.

Running in headless mode causes boot failure most of times with different vagrant boxes.

Host Ubuntu 13.04, Guest Ubuntu 12.04
Virtualbox 4.2.10

@basstradamus

This comment has been minimized.

Copy link

commented Nov 6, 2013

Is this problem fixed? I'm having same issue on Win 7.

@nocive

This comment has been minimized.

Copy link

commented Nov 6, 2013

Definitely not fixed.
I'm still having the same issue even after upgrading to VBox 4.3.

I've basically given up on headless mode until this is fixed.

@SunSparc

This comment has been minimized.

Copy link

commented Nov 6, 2013

As a fix, for me, I switched to using a Quantal (12.10) image and have not had problems.

@basstradamus

This comment has been minimized.

Copy link

commented Nov 7, 2013

I'm having a problem with Centos 6. This delay during boot of VM it's really a pain. We use vagrant for managing local DEV LINUX boxes and it's really counter productive.

@hairihan

This comment has been minimized.

@basstradamus

This comment has been minimized.

Copy link

commented Nov 9, 2013

Let's take the problem from a different angle. Can anybody explain what Vagrant is exactly trying to do when "Waiting for VM to boot. This can take a few minutes." message is displayed?

@rigbyjacob

This comment has been minimized.

Copy link

commented Nov 27, 2013

I also have this problem - it seemed to happen after a power outage for me so I suspected filesystem corruption but perhaps that's just a coincidence.

Booting via VirtualBox works fine I can actually ssh into the machine (it has a private_network ip configured) while "vagrant up" continues to say "Waiting for machine to boot".

I'm running VirtualBox 4.3.2 r90405 and vagrant1.3.5 under OS X 10.9 with the precise64 box from vagrantbox.es

I actually had this issue with two boxes but some rebooting over and over magic seemed to fix one of them, the other is still stuck.

@rigbyjacob

This comment has been minimized.

Copy link

commented Nov 27, 2013

I tracked my particular issue down to plugins/communicators/ssh/communicator.rb

It looks like the SSH communicator is not able to access the machine via the host:127.0.0.1 port:2222 that it expects because manually entering the private_network IP address for the machine allows it to work (vagrant up/vagrant halt)

I don't know how to fix this but it jives with the reports of restarting networking helping and possibly the boot/reboot dance fix.

UPDATE - this is possibly not a vagrant problem - denyhosts seems to be getting involved.
UPDATE 2 - clearing out the various denyhost files does indeed seem to have fixed my issue - i guess this would be hard for vagrant to report since the only feedback from ssh is: "ssh_exchange_identification: Connection closed by remote host"

@cast-networks

This comment has been minimized.

Copy link

commented Jan 4, 2014

Have same issue on Ubuntu 12.04, Vagrant 1.4.3 , Virtualbox 4.2.20r90983, fresh installed Debian Wheezy.
I upgraded to current version of Virtualbox today, had much older one before.
While in a past I had similar issues with Debian, not Ubuntu, after latest upgrade to of Virtualbox, it seems that behavior is in my case is changed.

Before upgrade re-leasing using dhclient solved the problem.

After upgrade it hangs out on "Waiting for machine to boot." message till timed out , while i am able to log in into the box using : ssh vagrant@127.0.0.1 -p 2222

@jmagnusson

This comment has been minimized.

Copy link

commented Mar 25, 2014

Am I the only one who had this problem disappear without knowing why? The only thing I can think of is the Vagrant 1.5 release or possibly switching to the 13.10 box from this repo https://github.com/ffuenf/vagrant-boxes instead of Ubuntu's own official box.

@nocive

This comment has been minimized.

Copy link

commented Mar 25, 2014

No, @jmagnusson, you're not the only one, same thing happened to me.
For me this stopped being an issue after upgrading to virtualbox 4.3 and vagrant 1.4.3.

@jmagnusson

This comment has been minimized.

Copy link

commented Mar 25, 2014

Well that's great! I'm surprised this hasn't been reported elsewhere?!

Would be nice to hear more confirmations so we could put all of this behind us (and update this page)

@aaronjwood

This comment has been minimized.

Copy link

commented May 2, 2014

This is still happening to me on OSX 10.9 using Vagrant 1.5.4 and VMware Fusion 6.0.3. I've seen some people pointing to this as the cause https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/797544 but I'm using CentOS 6.5 so there's something else going on.

I've also read through this https://github.com/mitchellh/vagrant/wiki/%60vagrant-up%60-hangs-at-%22Waiting-for-VM-to-boot.-This-can-take-a-few-minutes%22 but since I'm always at work on the same network when this happens I don't think it's a networking issue.

@afiune

This comment has been minimized.

Copy link

commented May 2, 2014

I would like to help but I have never seeing this error on Unix systems. Only for Windows..

Take a look here: WinRb/vagrant-windows#194 It may help ..

@volkanunsal

This comment has been minimized.

Copy link

commented Jun 14, 2014

This is also happening with me, but only if I have networking enabled:

 config.vm.network :forwarded_port, guest: 3000, host: 3000
@Neetuj

This comment has been minimized.

Copy link

commented Jun 24, 2014

@facetoe

This comment has been minimized.

Copy link

commented Jul 30, 2014

I have the same problem running Ubuntu 13.10.

@xacaxulu

This comment has been minimized.

Copy link

commented Feb 24, 2015

I have this problem too. It seems like the issue isn't actually 'closed' given how many people are reporting similar issues on mainstream OS's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.