SPOILER: It works fine out of the box if you have git’s bin directory in your path.
I was chatting recently with friend of mine, David Jacoby, and he mentioned a desire to purchase a Mac for development. Since he already had a Windows machine, I asked him why.
(A few years ago, I would have simply nodded in agreement. But Windows has been doing a great job lately of putting open source development tech onto their OS. Either by baking it into Visual Studio or paying the open source developers to port it like they did with node.)
He tells me there’s some difficulty when you mix ssh, vagrant, and windows (or at least, there was a difficulty).
I was planning to use vagrant, so I needed to find out for myself. First off I googled
vagrant putty ssh, and then read the linked stack overflow question.
Supposedly it’s been fixed for 10 months. But it was unclear to me if the vagrant ssh on windows fix works with putty or with the ssh command installed with git.
Since I’d have to test to be sure anyway, I installed vagrant and virtual box.
I followed the Vagrant Getting Started instructions:
$ vagrant init precise32 http://files.vagrantup.com/precise32.box $ vagrant up
Vagrant up returned an error, but it was a very helpful error that told me to put the VBoxManage.exe binary on my path. I found it in C:\Program Files\Oracle\VirtualBox, added that to my path, and ran
vagrant up again.
And away it went!
Bringing machine ‘default’ up with ‘virtualbox’ provider…
[default] Box ‘precise32’ was not found. Fetching box from specified URL for
the provider ‘virtualbox’. Note that if the URL does not have
a box for this provider, you should interrupt Vagrant now and add
the box yourself. Otherwise Vagrant will attempt to download the
full box prior to discovering this error.
Downloading or copying the box…
Extracting box…ate: 5401k/s, Estimated time remaining: –:–:–)
Successfully added box ‘precise32’ with provider ‘virtualbox’!
[default] Importing base box ‘precise32’…
[default] Matching MAC address for NAT networking…
[default] Setting the name of the VM…
[default] Clearing any previously set forwarded ports…
[default] Creating shared folders metadata…
[default] Clearing any previously set network interfaces…
[default] Preparing network interfaces based on configuration…
[default] Forwarding ports…
[default] — 22 => 2222 (adapter 1)
[default] Booting VM…
[default] Waiting for machine to boot. This may take a few minutes…
[default] Machine booted and ready!
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
cause things such as shared folders to not work properly. If you see
shared folder errors, please update the guest additions within the
virtual machine and reload your VM.
Guest Additions Version: 4.2.0
VirtualBox Version: 4.3
[default] Mounting shared folders…
[default] — /vagrant
Now for the moment of truth, I type in
vagrant ssh and got:
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
* Documentation: https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 06:22:31 2012 from 10.0.2.2
So it works great. The only question I have left is, “Is this relying on the SSH command that’s already on my machine? If so, did it come with PowerShell, installing Git on my path, posh-git, Github for Windows, or some forgotten tool?
Update: In the comments, Dave Jacoby posted a command to check your path:
($env:Path).Replace(‘;’,”`n”). We determined that having Git’s bin directory in your path is required.