Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the vagrant-winrm Vagrant plugin to resolve VM IP address. #155

Merged
merged 1 commit into from
Mar 26, 2015

Conversation

fnichol
Copy link
Contributor

@fnichol fnichol commented Mar 26, 2015

It turns out that the IP address of the Vagrant VM returned by the
vagrant ssh-config varies with each Vagrant provider and so can't be
relied on to return a private/nat'ed address. In some cases
"127.0.0.1" is returned and the locally forward port is returned for
the port number.

To resolve this, the vagrant-winrm Vagrant plugin will be used,
exposing a vagrant winrm-config subcommand to return WinRM-specific
connection details of the form:

Host CustomHostname
  HostName Windows2008VM.vagrant.up
  Port 5985
  User vagrant
  Password vagrant

This plugin requires version 1.6 of Vagrant or higher and this Driver
will check to see that the plugin is installed and the Vagrant version
is sufficient--if not a UserError is raised with a message describing
what action(s) to take.

If a WinRM transport is not used, then the minimum version of Vagrant
remains 1.1.0 (as before) and the vagrant-winrm plugin will not be
required keeping a slimer set of requirements for users who don't care
to manage Windows VMs.

For more details about the vagrant-winrm plugin, please see:

https://github.com/criteo/vagrant-winrm

Closes #153

It turns out that the IP address of the Vagrant VM returned by the
`vagrant ssh-config` varies with each Vagrant provider and so can't be
relied on to return a private/nat'ed address. In some cases
`"127.0.0.1"` is returned and the locally forward port is returned for
the port number.

To resolve this, the `vagrant-winrm` Vagrant plugin will be used,
exposing a `vagrant winrm-config` subcommand to return WinRM-specific
connection details of the form:

    Host CustomHostname
      HostName Windows2008VM.vagrant.up
      Port 5985
      User vagrant
      Password vagrant

This plugin requires version 1.6 of Vagrant or higher and this Driver
will check to see that the plugin is installed and the Vagrant version
is sufficient--if not a UserError is raised with a message describing
what action(s) to take.

If a WinRM transport is not used, then the minimum version of Vagrant
remains 1.1.0 (as before) and the `vagrant-winrm` plugin will not be
required keeping a slimer set of requirements for users who don't care
to manage Windows VMs.

For more details about the `vagrant-winrm` plugin, please see:

https://github.com/criteo/vagrant-winrm

Closes #153
fnichol added a commit that referenced this pull request Mar 26, 2015
Use the vagrant-winrm Vagrant plugin to resolve VM IP address.
@fnichol fnichol merged commit 78b8178 into master Mar 26, 2015
@fnichol fnichol deleted the vagrant-winrm-config branch March 26, 2015 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

find way to auto detect winrm port (or alternatively list host only network)
1 participant