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
Ruby on Rails - $ Rails Server Fails Because Uglifier Gem Could Not Be Found
How to Make a Ruby Script Using Trollop for Command Line Parsing
Error Creating Rails Db Using Rake Db:Create
Rails - Multi Tenant Application with Customization Framework
Having Difficulty Accessing Validation Errors in Sinatra
Rails 4 Error with Every Command "'Load': No Implicit Conversion of Nil into String" (MAC Os X 10.9)
How Does Count Method Works in Ruby
Cron Is Running in Home Directory Instead of File Directory
Shortening Socket Timeout Using Timeout::Timeout(N) Does Not Seem to Work for Me
Advice on How to Validate Names and Surnames Using Regex
Nanoc Changing the Base Path When Deploying Page in Github
Array#Rotate Equivalent in Ruby 1.8.7
Sending Array of Values to a SQL Query in Ruby
Callback for Active Storage File Upload
Why Won't Ruby Allow Me to Specify Self as a Receiver Inside a Private Method
Installing Ncurses for Ruby on Windows