16

It seems I can't SSH to my virtual box.

I have a virtual box running with Win7. The host PC is also in Win7. The virtual box was created through Vagrant with the following Vagrantfile.

Vagrant.configure("2") do |config|  
    config.vm.box = "http://aka.ms/vagrant-win7-ie11"  
end

Open cmd. Go to the root folder of the VagrantFile. Execute the following command:

vagrant up

cmd displays:

Bringing machine 'default' up with 'virtualbox' provider...  
==> 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 (guest) => 2222 (host) (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

Timed out while waiting for the machine to boot...

Time out appears though the virtual box has already finished the boot. (Checking via VirtualBox Manager)

Execute the following command:

vagrant ssh

cmd displays:

ssh_exchange_identification: read: Connection reset by peer  

While debugging the vagrant ssh, I may have found some useful logs:

INFO subprocess: Starting process: ["C:\\Program Files\\Git\\usr\\bin/ssh.EXE"]

INFO ssh: Invoking SSH: ss ["vagrant@127.0.0.1", "-p", "2222", "-o", "Compression=yes", "-o", "DSAAuthentication=yes", "-o", "LogLevel=FATAL", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-o", "IdentitiesOnly=yes", "-i", "C:/Users/hostpcname/.vagrant.d/insecure_private_key"]  

Can you suggest some ways on how to get out of this? I've tried the non-Windows image - hashicorp/precise64, and it worked fine.

Back2WorkMinion
  • 221
  • 1
  • 2
  • 8

6 Answers6

12

I have the same issue. Do by follow this step and working for me.

vagrant reload

and

vagrant ssh

again and working fine

Xman Classical
  • 5,179
  • 1
  • 26
  • 26
2

These steps will work

  1. vagrant halt

  2. open virtual box and uncheck hardware virtualization , save it

  3. vagrant up

  4. vagrant ssh

Note: vagrant halt is must, settings can't be edited in running state

enter image description here

Hemanthvrm
  • 2,319
  • 1
  • 17
  • 26
1

The following commands worked for me.

vagrant halt
vagrant up
vagrant ssh
Zeshan
  • 2,496
  • 3
  • 21
  • 26
0

Enable de virtualization on BIOS

0

After rebooting my computer and enabling intel virtualization in BIOS, I was able to get past this.

M. Urban
  • 11
  • 1
-1

I was getting error as : ssh_exchange_identification connection reset by peer Please follow below link ,it worked for me. https://talk.openmrs.org/t/error-on-vagrant-up/8833/30

Step:

Please open virtualbox and check if any vm is running.

Run vagrant destroy to remove all vms created by current Vagrantfile. Remove .vagrant directory in the bahmni-vagrant directory. Make sure you have the same Vagrantfile file as https://github.com/Bahmni/bahmni-vagrant/blob/master/Vagrantfile 37. Run vagrant up. Monitor virtualbox while it is starting up.

Ashish
  • 1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. [how to answer](https://stackoverflow.com/help/how-to-answer) . – Agilanbu Jan 02 '19 at 05:51