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 ["[email protected]", "-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.

1
  • Same error. Did you find a solution?
    – egor7
    Sep 23, 2016 at 13:40

6 Answers 6

12

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

vagrant reload

and

vagrant ssh

again and working fine

2
  • 6
    this is just a temporary solution, the problem comes back. this does not fix anything.. Apr 3, 2017 at 8:58
  • 3
    I am facing the same issue. But this one doesnt fixed mine. Jun 25, 2017 at 23:08
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

1
  • how can I get the vagrant machine being displayed in virtualbox?
    – Magier
    Oct 7, 2020 at 12:57
1

The following commands worked for me.

vagrant halt
vagrant up
vagrant ssh
0

Enable de virtualization on BIOS

2
0

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

-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.

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 . Jan 2, 2019 at 5:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.