Vagrant: Vagrant freezes on 'SSH auth method: private key' again

Created on 19 Jul 2020  ยท  2Comments  ยท  Source: hashicorp/vagrant

Vagrant version

Vagrant 2.2.9

Host operating system

Archlinux 5.7.9-arch1-1

Guest operating system

ubuntu/focal64

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.network "forwarded_port", guest: 22, host: 2222, host_ip: "127.0.0.1", id: 'ssh'
  config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
  end
  config.vm.box = "ubuntu/focal64"
end

Debug output

https://gist.github.com/Tehada/ddcc23ea26a2432f7cb4a6ba557cd5c0

Expected behavior

Expected vm to start.

Actual behavior

Command vagrant up stuck at line default: SSH auth method: private key, then timeout happens with this error:

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.

Steps to reproduce

vagrant init
vagrant up

References

https://github.com/hashicorp/vagrant/issues/8157
https://github.com/hashicorp/vagrant/issues/10045

I tried these suggestions from previous issues:

Add port 22 forwarding:
```
config.vm.network "forwarded_port", guest: 22, host: 2222, host_ip: "127.0.0.1", id: 'ssh'

Add cableconnect:

config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
end

As of virtualization, I use macbook air 2015 and it seems that it is enabled by default. At least I was able to run virtual machines in virtualbox before and several months ago vagrant also worked fine.

I use virtualbox 6.1.12-2. Also I noticed that while I wait for `vagrant up` to fail due to timeout virtualbox gui freezes if I try to click on vagrant's vm there. It only unfreezes as soon as I kill vm using this command:

vboxmanage startvm 3c32d31c-702a-482e-b886-2be0176b849f --type emergencystop
```

After this command I can open vm's settings in gui of virtualbox.

Also I noticed that Nested VT-x/AMD-V is disables in my log, so may be it is somehow related.

Most helpful comment

Hi there!
Thanks for opening an issue with Vagrant. There is a confirmed bug that causes some of the newer Ubuntu boxes to boot slowly, which is causing the SSH timeout in this case.
You can work around this by adding the following customizations to your Vagrantfile:

  config.vm.provider :virtualbox do |v|
    v.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
    v.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL]
  end

Cheers!

All 2 comments

Hi there!
Thanks for opening an issue with Vagrant. There is a confirmed bug that causes some of the newer Ubuntu boxes to boot slowly, which is causing the SSH timeout in this case.
You can work around this by adding the following customizations to your Vagrantfile:

  config.vm.provider :virtualbox do |v|
    v.customize ["modifyvm", :id, "--uart1", "0x3F8", "4"]
    v.customize ["modifyvm", :id, "--uartmode1", "file", File::NULL]
  end

Cheers!

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rhencke picture rhencke  ยท  3Comments

DreadPirateShawn picture DreadPirateShawn  ยท  3Comments

tomhking picture tomhking  ยท  3Comments

Cbeck527 picture Cbeck527  ยท  3Comments

rrzaripov picture rrzaripov  ยท  3Comments