5

I'm trying to connect to Homestead using the vagrant ssh command but I'm getting the below error message. I'm using Windows 7. How do I fix this issue?

ssh_exchange_identification read connection reset by peer

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos-64-x64-vbox4210'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: rafael_default_1396403974194_51967
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: Connection timeout. Retrying...
default: Error: 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.
bobhope
  • 113
  • 1
  • 3
  • 10

2 Answers2

1

For everyone else with this problem try using the gui of the virtual machine:

Vagrant.configure(2) do |config|
.... # your other stuff from vagrant here
    config.vm.provider "virtualbox" do |vb|
        vb.gui = true
    end
end

And then with the gui go to Devices/Network/Connect Network Adapter and connect it, in my installation it comes disconnected by default and causes the problems with the ssh and the provision.

civilian
  • 147
  • 1
  • 12
  • Can you explain where to put this code? And isn't there any way to do this from the terminal? (I can get there with VirtualBox) – Niels Jan 17 '17 at 14:16
  • 1
    @Niels Hello, have a great day :). This code goes in the _Vagrantfile_ that is generated after you use the command: **$ php vendor/bin/homestead make**. I'm not sure if its possible to do this from console, i did something similar with the commands of VBoxManage https://www.virtualbox.org/manual/ch08.html you can look from there. The basic problem in here is that the homestead vagrant machine have been badly build, and i think maybe that should be a reported bug. Sorry it took me so long to answer Thanks for your time :). – civilian Jan 20 '17 at 21:21
0

Could be that your IP was blocked after multiple failed attempts to log into SSH. Call your hosting service and get them to unblock your IP/remove restrictions.

Or B
  • 1,857
  • 15
  • 22
Mrba88
  • 11
  • 2