diff --git a/CHANGELOG.md b/CHANGELOG.md index 81ba16950..7e88b47d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ BUG FIXES: - commands/package: `--base` works without crashing for VirtualBox. - commands/reload: If `--provision` is specified, force provisioning. [GH-3657] - guests/redhat: Fix networking issues with CentOS. [GH-3649] + - guests/windows: Human error if WinRM not in use to configure networks. [GH-3651] - providers/docker: Show proper error message when on Linux. [GH-3654] - synced\_folders/rsync: Create the directory before syncing. diff --git a/plugins/guests/windows/cap/configure_networks.rb b/plugins/guests/windows/cap/configure_networks.rb index 931c67345..c8c2c1061 100644 --- a/plugins/guests/windows/cap/configure_networks.rb +++ b/plugins/guests/windows/cap/configure_networks.rb @@ -9,6 +9,10 @@ module VagrantPlugins @@logger = Log4r::Logger.new("vagrant::guest::windows::configure_networks") def self.configure_networks(machine, networks) + if machine.config.vm.communicator != :winrm + raise Errors::NetworkWinRMRequired + end + @@logger.debug("Networks: #{networks.inspect}") guest_network = GuestNetwork.new(machine.communicate) diff --git a/plugins/guests/windows/errors.rb b/plugins/guests/windows/errors.rb index 4b6b3c716..ca1e3fb36 100644 --- a/plugins/guests/windows/errors.rb +++ b/plugins/guests/windows/errors.rb @@ -9,6 +9,10 @@ module VagrantPlugins class CantReadMACAddresses < WindowsError error_key(:cant_read_mac_addresses) end + + class NetworkWinRMRequired < WindowsError + error_key(:network_winrm_required) + end end end end diff --git a/templates/locales/guest_windows.yml b/templates/locales/guest_windows.yml index dbdb2d7ce..4f247930d 100644 --- a/templates/locales/guest_windows.yml +++ b/templates/locales/guest_windows.yml @@ -9,3 +9,12 @@ en: Until then, you must remove any networking configurations other than forwarded ports from your Vagrantfile for Vagrant to continue. + network_winrm_required: |- + Configuring networks on Windows requires the communicator to be + set to WinRM. To do this, add the following to your Vagrantfile: + + config.vm.communicator = "winrm" + + Note that the Windows guest must be configured to accept insecure + WinRM connections, and the WinRM port must be forwarded properly from + the guest machine. This is not always done by default.