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

Vagrant up not working: Remote connection disconnect. Retrying... #9416

Closed
rmertens opened this issue Jan 30, 2018 · 9 comments
Closed

Vagrant up not working: Remote connection disconnect. Retrying... #9416

rmertens opened this issue Jan 30, 2018 · 9 comments

Comments

@rmertens
Copy link

rmertens commented Jan 30, 2018

Vagrant version

Vagrant 2.0.2

Host operating system

macOS High Sierra 10.13.2

Guest operating system

ubuntu/xenial64

Vagrantfile

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  # Box
  config.vm.box = "ubuntu/xenial64"

  # based on https://github.com/mitchellh/vagrant/issues/5186
  config.ssh.username = "ubuntu"

  # increase memory per https://www.vagrantup.com/docs/virtualbox/configuration.html
  config.vm.provider "virtualbox" do |v|
    v.memory = 2048
  end

  # Provision
  config.vm.provision :shell, :path => "vagrant-bootstrap.sh", binary: true

  config.vm.network "forwarded_port", guest: 80, host: 8004
  config.vm.network "forwarded_port", guest: 3306, host: 33306

  # Shared folders
  config.vm.synced_folder ".", "/var/admin"

end

Debug output

https://gist.github.com/rmertens/a9cc66c8f53b61dd0642acd1a85fbdf0

Expected behavior

We should be able to get a virtual machine and ssh into it.

Actual behavior

    default: SSH address: 127.0.0.1:2222
    default: SSH username: ubuntu
    default: SSH auth method: private key
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...
    default: Warning: Authentication failure. Retrying...

Then when I try vagrant ssh, I get:

ubuntu@127.0.0.1: Permission denied (publickey).

Steps to reproduce

  1. vagrant up

References

/

@Bennit
Copy link

Bennit commented Jan 30, 2018

Confirmed on linux - ubuntu 17.10
SSH key doesn't seem to be properly installed onto the guest OS - the machine is properly running according to virtualbox. Did not see any weird stuff on startup.
I tried falling back to older boxes - no change. Hard to switch back to vagrant 1.9 because that requires an older version of virtualbox which is not compatible with vagrant 2+.

@chrisroberts
Copy link
Member

The underlying issue is just an authentication problem. I just pulled this box and vagrant upd it without issue. My guess is that you no longer need to define the username in your Vagrantfile. Please try removing that option and see if it will up the guest correctly.

Cheers!

@rmertens
Copy link
Author

That solved it for me! Thanks @chrisroberts. For the record here's the output:

    default: SSH address: 127.0.0.1:2201
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Connection reset. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...

@byronglendon
Copy link

Where exactly do you do this? Can you possibly please give instructions on how to go about doing this, Thanks.

@BinaryAlps
Copy link

I have the same issue in one box but I have no user defined in the Vagrantfile.

@RimuJim
Copy link

RimuJim commented Jul 5, 2018

I have the same issue in one box but I have no user defined in the Vagrantfile.

Any progress on this?

@punkrokk
Copy link

I am experiencing this on CentOS 7.5

@eopo
Copy link

eopo commented Feb 5, 2019

Same host os, but no username defined in Vagrantfile. Guest OS is a jessie/amd64

@ghost
Copy link

ghost commented Mar 28, 2020

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.

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants