guests/windows: nicer error if winrm not in use to configure networks [GH-3651]

This commit is contained in:
Mitchell Hashimoto 2014-05-06 19:00:58 -07:00
parent 326e8012f7
commit 8bb9d18260
4 changed files with 18 additions and 0 deletions

View File

@ -11,6 +11,7 @@ BUG FIXES:
- commands/package: `--base` works without crashing for VirtualBox. - commands/package: `--base` works without crashing for VirtualBox.
- commands/reload: If `--provision` is specified, force provisioning. [GH-3657] - commands/reload: If `--provision` is specified, force provisioning. [GH-3657]
- guests/redhat: Fix networking issues with CentOS. [GH-3649] - 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] - providers/docker: Show proper error message when on Linux. [GH-3654]
- synced\_folders/rsync: Create the directory before syncing. - synced\_folders/rsync: Create the directory before syncing.

View File

@ -9,6 +9,10 @@ module VagrantPlugins
@@logger = Log4r::Logger.new("vagrant::guest::windows::configure_networks") @@logger = Log4r::Logger.new("vagrant::guest::windows::configure_networks")
def self.configure_networks(machine, networks) def self.configure_networks(machine, networks)
if machine.config.vm.communicator != :winrm
raise Errors::NetworkWinRMRequired
end
@@logger.debug("Networks: #{networks.inspect}") @@logger.debug("Networks: #{networks.inspect}")
guest_network = GuestNetwork.new(machine.communicate) guest_network = GuestNetwork.new(machine.communicate)

View File

@ -9,6 +9,10 @@ module VagrantPlugins
class CantReadMACAddresses < WindowsError class CantReadMACAddresses < WindowsError
error_key(:cant_read_mac_addresses) error_key(:cant_read_mac_addresses)
end end
class NetworkWinRMRequired < WindowsError
error_key(:network_winrm_required)
end
end end
end end
end end

View File

@ -9,3 +9,12 @@ en:
Until then, you must remove any networking configurations other Until then, you must remove any networking configurations other
than forwarded ports from your Vagrantfile for Vagrant to continue. 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.