Vagrant :: Unable to run vagrant up; Connection timeout. Retrying

15,749

The SSH connection timeout during boot phase can happen from different reasons such as:

  • system awaits for user interaction (e.g. share partition is not ready),
  • sshd misconfiguration,
  • firewall misconfiguration (in case it's not local),
  • mismatch of your private key,
  • the booting process takes too much time (try increasing config.vm.boot_timeout),
  • check whether virtualization is enabled in BIOS (as per comment).

To debug the problem, please run it as:

VAGRANT_LOG=debug vagrant up

If there is nothing obvious, then try to connect to it from another terminal, by vagrant ssh or by:

vagrant ssh-config > vagrant-ssh; ssh -F vagrant-ssh default

If the SSH still fails, re-run it with a GUI (e.g. config.gui = true).

If it's not, check the running processes (e.g. by: vagrant ssh -c 'pstree -a') or verify your sshd_config.


If it is disposable VM, you can always destroy it and up it again. Also consider upgrading your Vagrant and Virtualbox.

Share:
15,749

Related videos on Youtube

davidxd33
Author by

davidxd33

now my about me is not empty

Updated on September 18, 2022

Comments

  • davidxd33
    davidxd33 over 1 year

    I'm starting to migrate from wamp to the laravel homestead vagrant box however I've been stumped when it came to starting the box. I've downloaded and configured all assets and ran vagrant up to boot the box however, here's the outcome of vagrant up:

    $ vagrant up
    Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Checking if box 'laravel/homestead' is up to date...
    ==> default: Clearing any previously set forwarded ports...
    ==> default: Fixed port collision for 22 => 2222. Now on port 2200.
    ==> default: Clearing any previously set network interfaces...
    ==> default: Preparing network interfaces based on configuration...
        default: Adapter 1: nat
        default: Adapter 2: hostonly
    ==> default: Forwarding ports...
        default: 80 => 8000 (adapter 1)
        default: 3306 => 33060 (adapter 1)
        default: 5432 => 54320 (adapter 1)
        default: 22 => 2200 (adapter 1)
    ==> default: Running 'pre-boot' VM customizations...
    ==> default: Booting VM...
    ==> default: Waiting for machine to boot. This may take a few minutes...
        default: SSH address: 127.0.0.1:2200
        default: SSH username: vagrant
        default: SSH auth method: private key
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
        default: Warning: Connection timeout. Retrying...
    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.
    

    Here's the outcome of vagrant halt:

    $ vagrant halt
    ==> default: Attempting graceful shutdown of VM...
        default: Guest communication could not be established! This is usually because
        default: SSH is not running, the authentication information was changed,
        default: or some other networking issue. Vagrant will force halt, if
        default: capable.
    ==> default: Forcing shutdown of VM...
    

    It seems the issue may be opening SSH. The answers here https://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying did not help even though it seems to be a similar issue.

    I'm running Windows 8.1.

    • Fred the Magic Wonder Dog
      Fred the Magic Wonder Dog over 9 years
      Is the VM 64 bit? I was having similar problems until I enabled the virtualization features in the BIOS on my machine. I could use 32 bit VM's but not 64. The ssh timeout is a symptom of the VM not booting correctly.
    • davidxd33
      davidxd33 over 9 years
      How can I tell?
    • davidxd33
      davidxd33 over 9 years
      I enabled the feature in BIOS and it seems to work now. I got Remote connection timeout twice but it booted after that.