hashicorp/vagrant · error · Vagrant::Errors.ProvisionerWinRMUnsupported

The provisioner '%{name}' doesn't support provisioning on Wi

Error message

The provisioner '%{name}' doesn't support provisioning on
Windows guests via WinRM. This is likely not a limitation
of the provisioner itself but rather that Vagrant doesn't know
how to run this provisioner over WinRM.

If you'd like this provisioner to work over WinRM, please
take a look at the Vagrant source code linked below and try
to contribute back support. Thank you!

https://github.com/hashicorp/vagrant

What it means

The CFEngine provisioner begins by refusing to run when the machine's communicator is :winrm: it raises ProvisionerWinRMUnsupported with name "cfengine". Vagrant's provisioners drive guests over the configured communicator, and CFEngine support was only implemented for ssh; the message explicitly invites contributing WinRM support rather than claiming a CFEngine limitation.

Source

Thrown at plugins/provisioners/cfengine/provisioner.rb:11

# Copyright IBM Corp. 2010, 2025
# SPDX-License-Identifier: BUSL-1.1

require "log4r"

module VagrantPlugins
  module CFEngine
    class Provisioner < Vagrant.plugin("2", :provisioner)
      def provision
        if @machine.config.vm.communicator == :winrm
          raise Vagrant::Errors::ProvisionerWinRMUnsupported,
            name: "cfengine"
        end

        @logger = Log4r::Logger.new("vagrant::plugins::cfengine")

        @logger.info("Checking for CFEngine installation...")
        handle_cfengine_installation

        if @config.files_path
          @machine.ui.info(I18n.t("vagrant.cfengine_installing_files_path"))
          install_files(Pathname.new(@config.files_path).expand_path(@machine.env.root_path))
        end

        handle_cfengine_bootstrap if @config.mode == :bootstrap

        if @config.mode == :single_run
          # Just let people know
          @machine.ui.info(I18n.t("vagrant.cfengine_single_run"))

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Drop the cfengine provisioner from the WinRM machine (scope it: `config.vm.provision "cfengine", only: ...` or move it under the Linux machine's block)
  2. Or switch that machine's communicator back to :ssh (`config.vm.communicator = :ssh`) if the guest supports sshd
  3. If cfengine must manage a Windows guest, run it via a shell provisioner over WinRM (e.g. cf-agent installed and invoked manually)
  4. Or contribute WinRM support upstream per the linked repository

Example fix

# Vagrantfile — before
config.vm.communicator = :winrm
config.vm.provision "cfengine"
# after — only provision via ssh guests
config.vm.communicator = :winrm
config.vm.provision "shell", inline: "cf-agent -K -f /path/policy.cf"  # run cfengine without the native provisioner
Defensive patterns

Strategy: validation

Validate before calling

raise 'cfengine requires ssh communicator' if machine.config.vm.communicator == :winrm && provisioner_name == 'cfengine'

Type guard

def ssh_communicator?(machine)
  machine.config.vm.communicator != :winrm
end

Prevention

When it happens

Trigger: A Vagrantfile (or multi-machine expansion) that sets `config.vm.communicator = :winrm` (or a box defaulting to it, e.g. Windows boxes) and then configures `config.vm.provision "cfengine"` — provision() raises on the first provision attempt.

Common situations: Applying an existing Linux-oriented cfengine block to a newly added Windows (WinRM) machine in a mixed multi-machine environment; base templates that globally set communicator :winrm; copying provisioner config between projects without checking communicator requirements.

Related errors


AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21). Data as JSON: /api/errors/54c3fd2ceba205d3. Report an issue: GitHub.