Winrm config does not behave deterministic - reboot fails

Hi!

I am creating a hybrid environment that contains (amoungst others) some Windows machines. I successfully created some Windows boxes with winrm configuration etc.

Now I face an oddity with one of my boxes: without changing the config, just by doing “vagrant destroy -f ; vagrant up”, thus recreating the VM (vmware_desktop_provider, Vagrant 2.2.10), I see a random element:

The winrm port is being forwarded to localhost. Sometime WinRM comes up as:

==> default: Forwarding ports...
    default: -- 3389 => 2216
    default: -- 5985 => 2217
    default: -- 5986 => 2218
    default: -- 22 => 2219
==> default: Waiting for machine to boot. This may take a few minutes...
    default: WinRM address: 192.168.11.175:5985
    default: WinRM username: vagrant
    default: WinRM execution_time_limit: PT2H
    default: WinRM transport: plaintext
==> default: Machine booted and ready!

So WinRM is on the default network and native port.

Maybe the next run looks like this:

==> default: Waiting for the VM to receive an address...
==> default: Forwarding ports...
    default: -- 3389 => 2216
    default: -- 5985 => 2217
    default: -- 5986 => 2218
    default: -- 22 => 2219
==> default: Waiting for machine to boot. This may take a few minutes...
    default: WinRM address: 127.0.0.1:2217
    default: WinRM username: vagrant
    default: WinRM execution_time_limit: PT2H
    default: WinRM transport: negotiate
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

Notice the difference: here the WinRM is configured to the localhost forwarded port: 127.0.0.1:2217!

There are two issues with this: one … with the localhost config, that theoretically should even work, the reboot fails. (I disabled the Windows firewall, in case you want to mention this). And basically … what make Vagrant change its mind regarding the interface to use.

My workflow is design in such a way, that I can retry the “up” for a specific machine when needed, but it is annoying nevertheless.

Any clue? Is this a configuration error or just a bug?

Thanks in advance!

Hi,

What is the host platform you are using? And do you have any provider specific configuration defined within your Vagrantfile?