Any one can help on this error "Timed out while waiting for the machine to boot"?

D:\university\Mongodb\M103\m103-vagrant-env>vagrant up
Bringing machine ‘mongod-m103’ up with ‘virtualbox’ provider…
==> mongod-m103: Importing base box ‘ubuntu/trusty64’…
==> mongod-m103: Matching MAC address for NAT networking…
==> mongod-m103: Setting the name of the VM: mongod-m103
==> mongod-m103: Clearing any previously set forwarded ports…
==> mongod-m103: Clearing any previously set network interfaces…
==> mongod-m103: Preparing network interfaces based on configuration…
mongod-m103: Adapter 1: nat
mongod-m103: Adapter 2: hostonly
==> mongod-m103: Forwarding ports…
mongod-m103: 22 (guest) => 2222 (host) (adapter 1)
==> mongod-m103: Running ‘pre-boot’ VM customizations…
==> mongod-m103: Booting VM…
==> mongod-m103: Waiting for machine to boot. This may take a few minutes…
mongod-m103: SSH address: 127.0.0.1:2222
mongod-m103: SSH username: vagrant
mongod-m103: SSH auth method: private key
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.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

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.

2 Likes

Having the same error here!

1 Like

Hi All,

Can you try re-provisioning the vagrant or check this thread here: Vagrant Issues on Windows, if it can help.

Let me know if it doesn’t.

Kanika

It turned out that my issue was that Hyper-V was enabled on my Windows 10 machine. I followed @kanikasingla’s instructions about turning off Windows features from this Vagrant Issues on Windows with some modifications. He says to deselect “Hyper-V”. I ended up de-selecting “Virtual Machine Platform” and “Windows Hypervisor Platform”. After re-booting several times, the virtual machine began working.

2020-02-20

I hope this may help people not go through the four frustrating hours of trying to setup the Vagrant environment on their Windows machine that I did.

@William_Moore_97877, the installation typically wouldn’t hang on “SSH auth method: private key” if Hyper-V was the issue. It would actually throw an error message. This old thread is about the installation hanging on “SSH auth method: private key”. Can you share a screenshot of your exact problem?

I re-enabled Hyper-V and re-traced my steps, so that we can have a well-documented answer to what I can only assume a lot of people are running into. I should note that I am on a Windows 10 machine with an Intel processor.

First, a couple checks as listed in the documentation for setting VirtualBox on Windows.

C:\Users\wmoor>cd C:\Program Files\Oracle\VirtualBox

C:\Program Files\Oracle\VirtualBox>vboxmanage --version
6.1.2r135662

C:\Program Files\Oracle\VirtualBox>cd C:\

C:\>rsync
rsync  version 3.0.8  protocol version 30
... (truncated)

C:\>ssh
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
... (truncated)

C:\>vagrant --version
Vagrant 2.2.7

Everything checks out, so I attempt to run vagrant up --provision:

C:\>cd C:\Users\wmoor\m103\m103-vagrant-env

C:\Users\wmoor\m103\m103-vagrant-env>vagrant up --provision
Bringing machine 'mongod-m103' up with 'virtualbox' provider...
==> mongod-m103: Setting the name of the VM: mongod-m103
==> mongod-m103: Clearing any previously set forwarded ports...
==> mongod-m103: Clearing any previously set network interfaces...
==> mongod-m103: Preparing network interfaces based on configuration...
    mongod-m103: Adapter 1: nat
    mongod-m103: Adapter 2: hostonly
==> mongod-m103: Forwarding ports...
    mongod-m103: 22 (guest) => 2222 (host) (adapter 1)
==> mongod-m103: Running 'pre-boot' VM customizations...
==> mongod-m103: Booting VM...
==> mongod-m103: Waiting for machine to boot. This may take a few minutes...
    mongod-m103: SSH address: 127.0.0.1:2222
    mongod-m103: SSH username: vagrant
    mongod-m103: SSH auth method: private key

NOTE: Up to this point, the messages were moving along relatively quickly, but then hung. I know it looks like it is hanging on SSH auth, but this is all part of the boot process, which is failing.

Since I know that are issues with hardware virtualization and Hyper-V, I opened up the Oracle VM VirtualBox Manager. I searched the VBox.log for mongod-m103 and found this error.

00:00:01.286859 CPUM: No hardware-virtualization capability detected

Continuing the vagrant up session, this message finally came up after several minutes:

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.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

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.

While searching for an answer, I ran into this one by @007_jb on Windows 10 giving error for vagrant up –provision (as well as the one I mentioned earlier). I tried it, and after re-booting everything worked. There is some difference between this solution and the one I mentioned earlier. This solution looks like it is turning off the hypervisor at the hardware level using the boot configuration, whereas, the one posted by @kanikasingla turns it off for Windows.

C:\Windows\system32>bcdedit /set hypervisorlaunchtype off
The operation completed successfully.

Some supporting screen shots.

BEFORE MAKING CHANGES
These first two (according to Intel), show that my CPU is capable of hardware virtualization, but that another process is using a hypervisor and preventing it.


AFTER MAKING CHANGES
After running the command to change the boot config, this is what the Intel utility reported.

The funny thing is that the Windows feature is still enabled.

after

1 Like