Search code examples
windowssshvagrant

Windows 10 Vagrant is stopping at "SSH auth method: private key"


When I run vagrant up from the command line, it is a crap shoot at best as to whether vagrant will boot up or not. It stops at this line:

SSH auth method: private key

And then may or may not include this line:

Warning: Remote connection disconnect. Retrying...

As I said, sometimes it works and sometimes it does not. Why is this problem happening? For the record it would happen (less often) on my production MacBook at work.

Can I maybe change the auth method if there is no good answer for this? Trust me I have been looking and not found any answer on this yet.


Solution

  • whats happening is the following :

    • vagrant up will spin a new VM, basically it contacts virtualbox (or the specific provider) and run command to start a VM
    • the VM will start on the virtualbox side

    note: if you run form a command line terminal in macos, you can see the title switching from 'Ruby' to 'VBoxManage'

    • the VM takes some time to start
    • because the VM does not send a specific signal when its done, vagrant will check at regular interval if the VM is fully booted and available to ssh-in
    • once the VM is available, vagrant can run the ssh command and complete the config (network, shared folder, etc...)

    so in your case, the VM takes a bit longer to boot (this can be due to high activity on your mac, specific setup of the VM that runs on boot ...)

    Basically this is harmless and is not necessarily a bad sign.