SSH to Vagrant box in Windows?

Sathish picture Sathish · Mar 27, 2012 · Viewed 161.1k times · Source

I'm using Vagrant to start a VirtualBox VM in windows. In other platforms, I can just

$ vagrant ssh

to connect to the VM.

How do i connect to this Vagrant box in windows?

The way suggested in Vagrant documentation to use PuTTy also did not work:

http://docs-v1.vagrantup.com/v1/docs/getting-started/ssh.html

Answer

Dror Bereznitsky picture Dror Bereznitsky · Mar 29, 2012

I use PuTTY to connect to my Vagrant boxes on Windows7.

Make sure you

  • convert the %USERPROFILE%\.vagrant.d\insecure_private_key to .ppk using PuTTYGen
  • use the .ppk key in your PuTTY session - configured in Connection > SSH > Auth > Private key file
  • use host 127.0.0.1
  • use port 2222 instead of 22
  • you can set the default username (vagrant) under Connection > SSH > Auth > Private key for authentication