Vagrant Ssh Not Working in Mobaxterm on Windows

vagrant ssh not working in MobaXterm on Windows

Part of the trick is that I don't want to use the Windows PATH for arbitrary commands—not even for ssh, really. I want to use the versions in MobaXterm for everything. All I want is to be able to run vagrant ssh the same way I would on Linux or Mac.

The workaround I have been using, which I found somewhere online (but can't find the page again), is:

vagrant ssh-config > vagrant-ssh
ssh -F vagrant-ssh default # Works exactly the way `vagrant ssh` should

"default" is the box name for a typical Vagrant environment with only a single vagrant box. If there is more than one box, replace "default" with the box name:

ssh -F vagrant-ssh host001  # Works the way `vagrant ssh host001` would on another system

This is a good workaround with minimal changes required to workflow. But I'd still like a way to get vagrant ssh working without needing the extra file in my vagrant directory.

SSH to Vagrant box in Windows?

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

vagrant ssh worker1 doesn't work without much feedback

Thats an issue with mobaxterm, its been reported by others (see https://groups.google.com/forum/#!topic/vagrant-up/lELRBz5npUc)

you could use Cygwin or git bash on windows, it should clear the error and allow ssh to work.

SSH into vagrant with X server set up

Install Cygwin with the following packages to resolve the problem as specified in this website:

  • xorg-server
  • xinit
  • xorg-docs (for documentation)
  • openssh (in case this wasn't installed previously)

Then load up the window using startxwin from the cygwin terminal.

A note that I discovered later is that it is better to ssh into vagrant using the following command:

vagrant -Y ssh

Than:

vagrant -X ssh

The latter is performed in untrusted mode as in this answer and times out after a while.



Related Topics



Leave a reply



Submit