{"record":{"id":"5be5e08c8bb7a5d9","repo":"hashicorp/vagrant","slug":"cfengine-appears-not-to-be-installed-on-the-guest","errorCode":null,"errorMessage":"CFEngine appears not to be installed on the guest machine. Vagrant\ncan attempt to install CFEngine for you if you set the \"install\"\nsetting to \"true\", but this setting was not set. Please install\nCFEngine on the guest machine or enable the \"install\" setting for\nVagrant to attempt to install it for you.","messagePattern":"CFEngine appears not to be installed on the guest machine\\. Vagrant\ncan attempt to install CFEngine for you if you set the \"install\"\nsetting to \"true\", but this setting was not set\\. Please install\nCFEngine on the guest machine or enable the \"install\" setting for\nVagrant to attempt to install it for you\\.","errorType":"exception","errorClass":"Vagrant::Errors.CFEngineNotInstalled","httpStatus":null,"severity":"error","filePath":"plugins/provisioners/cfengine/provisioner.rb","lineNumber":119,"sourceCode":"        if @config.am_policy_hub\n          @machine.ui.info(I18n.t(\"vagrant.cfengine_bootstrapping_policy_hub\"))\n          cfagent(\"-KI -f /var/cfengine/masterfiles/failsafe.cf#{cfagent_classes_args}\")\n          cfagent(\"-KI #{cfagent_classes_args}#{cfagent_extra_args}\")\n        end\n      end\n\n      # This handles verifying the CFEngine installation, installing it\n      # if it was requested, and so on. This method will raise exceptions\n      # if things are wrong.\n      def handle_cfengine_installation\n        if !@machine.guest.capability?(:cfengine_installed)\n          @machine.ui.warn(I18n.t(\"vagrant.cfengine_cant_detect\"))\n          return\n        end\n\n        installed = @machine.guest.capability(:cfengine_installed)\n        if !installed || @config.install == :force\n          raise Vagrant::Errors::CFEngineNotInstalled if !@config.install\n\n          @machine.ui.info(I18n.t(\"vagrant.cfengine_installing\"))\n          @machine.guest.capability(:cfengine_install, @config)\n\n          if !@machine.guest.capability(:cfengine_installed)\n            raise Vagrant::Errors::CFEngineInstallFailed\n          end\n        end\n      end\n\n      # This installs a set of files into the CFEngine folder within\n      # the machine.\n      #\n      # @param [Pathname] local_path\n      def install_files(local_path)\n        @logger.debug(\"Copying local files to CFEngine: #{local_path}\")\n        @machine.communicate.sudo(\"rm -rf /tmp/cfengine-files\")\n        @machine.communicate.upload(local_path.to_s, \"/tmp/cfengine-files\")","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/provisioners/cfengine/provisioner.rb#L101-L137","documentation":"Raised by handle_cfengine_installation when the `cfengine_installed` guest capability reports CFEngine is absent (or `install == :force`) and the `install` config option is not enabled. Vagrant deliberately will not install software on the guest unless you opt in with `cfengine.install = true`, so an uninstalled CFEngine plus no opt-in aborts provisioning. Note the earlier branch: if the guest has no `cfengine_installed` capability at all, it only warns and continues.","triggerScenarios":"Running the cfengine provisioner on a box without CFEngine binaries present while `@config.install` is nil/false - i.e. the capability check `cfengine_installed` returned false and `raise ... if !@config.install` fired.","commonSituations":"Using stock base boxes (ubuntu/jammy, centos/stream) that ship no CFEngine; Vagrantfile copied from a CFEngine-ready environment into a plain box; expecting Vagrant to auto-install like the shell provisioner does.","solutions":["Enable opt-in installation: `cfengine.install = true` in the Vagrantfile block","Use `cfengine.install = :force` to reinstall even when the guest reports it installed","Or bake CFEngine into a custom box / preinstall it so the capability check passes"],"exampleFix":"# Vagrantfile - before\nconfig.vm.provision \"cfengine\" do |cfengine|\n  cfengine.policy_server_address = \"10.0.2.2\"\nend\n\n# Vagrantfile - after\nconfig.vm.provision \"cfengine\" do |cfengine|\n  cfengine.policy_server_address = \"10.0.2.2\"\n  cfengine.install = true\nend","handlingStrategy":"validation","validationCode":"# Vagrantfile: make the intent explicit instead of relying on box contents\nconfig.vm.provision \"cfengine\" do |cfengine|\n  cfengine.install = true          # or omit if you guarantee the box ships CFEngine\n  cfengine.policy_server_address = \"10.0.2.2\"\nend","typeGuard":"def cfengine_available?(machine)\n  machine.guest.capability?(:cfengine_installed) &&\n    machine.guest.capability(:cfengine_installed)\nend","tryCatchPattern":null,"preventionTips":["Build or choose boxes that preinstall CFEngine, or always set cfengine.install = true","Document in the project README which boxes the cfengine provisioner is validated against","Use cfengine.install = :force when a guaranteed-clean reinstall matters"],"tags":["cfengine","provisioning","vagrant","missing-dependency"],"backgroundTag":"required-package-not-installed","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}