Search code examples
windowssshvirtual-machinevirtualboxvagrant

SSH to Vagrant box in Windows?


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


Solution

  • 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