{"record":{"id":"782a959cbb874113","repo":"hashicorp/vagrant","slug":"cloud-init-is-not-found-please-ensure-that-cloud","errorCode":null,"errorMessage":"cloud-init is not found. Please ensure that cloud-init is installed and\navailable on path for guest '%{guest_name}'.","messagePattern":"cloud-init is not found\\. Please ensure that cloud-init is installed and\navailable on path for guest '%(.+?)'\\.","errorType":"exception","errorClass":"Vagrant::Errors::CloudInitNotFound","httpStatus":null,"severity":"error","filePath":"lib/vagrant/action/builtin/cloud_init_wait.rb","lineNumber":41,"sourceCode":"              contents = sentinel_path.read.chomp\n              if machine.id.to_s == contents\n                @logger.info(\"Sentinel found for cloud-init, skipping\")\n                throw :complete\n              end\n              @logger.debug(\"Found stale sentinel file, removing... (#{machine.id} != #{contents})\")\n              sentinel_path.unlink\n            end\n\n            cloud_init_wait_cmd = \"cloud-init status --wait\"\n            if !machine.config.vm.cloud_init_configs.empty?\n              if machine.communicate.test(\"command -v cloud-init\")\n                env[:ui].output(I18n.t(\"vagrant.cloud_init_waiting\"))\n                result = machine.communicate.sudo(cloud_init_wait_cmd, error_check: false)\n                if result != 0\n                  raise Vagrant::Errors::CloudInitCommandFailed, cmd: cloud_init_wait_cmd, guest_name: machine.name\n                end\n              else\n                raise Vagrant::Errors::CloudInitNotFound, guest_name: machine.name\n              end\n            end\n            # Write sentinel path\n            sentinel_path.write(machine.id.to_s)\n          end\n\n          @app.call(env)\n        end\n      end\n    end\n  end\nend\n","sourceCodeStart":23,"sourceCodeEnd":54,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/action/builtin/cloud_init_wait.rb#L23-L54","documentation":"The cloud_init_wait middleware only waits on cloud-init when vm.cloud_init_configs is non-empty; before waiting it probes the guest with `command -v cloud-init`. If that probe fails, the box has no cloud-init binary and Vagrant raises CloudInitNotFound, because the requested cloud_init workflow can never run there.","triggerScenarios":"`vagrant up` with any `config.vm.cloud_init` entry while the base box lacks cloud-init (lib/vagrant/action/builtin/cloud_init_wait.rb:37-42). Typical with hand-rolled minimal boxes, stripped cloud images, or Windows guests without cloud-init for Windows.","commonSituations":"Custom/Packer-built boxes without cloud-init installed; minimal distro images (Alpine, tiny Debian) where cloud-init was never added; assuming every 'linux box' ships cloud-init because Ubuntu cloud images do.","solutions":["Switch to a box that ships cloud-init preinstalled (official Ubuntu/Debian/cloud-images boxes, 'cloud' variants).","Or install cloud-init into the box once (`vagrant ssh -c 'sudo apt-get update && sudo apt-get install -y cloud-init'`), then `vagrant package` it and use the repackaged box.","If you cannot change the box, replace the cloud_init config with an equivalent shell provisioner."],"exampleFix":"# before\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"my-minimal-box\"        # no cloud-init inside\n  config.vm.cloud_init do |cloud_init|\n    cloud_init.user_data = \"#cloud-config\\npackages: [htop]\\n\"\n  end\nend\n\n# after: either use a cloud-init capable box, or provision via shell\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"ubuntu/jammy64\"\n  # or: config.vm.provision \"shell\", inline: \"apt-get update && apt-get install -y htop\"\nend","handlingStrategy":"validation","validationCode":"# Choose/probe a cloud-init capable box before relying on cloud_init configs\n# after first bring-up of a candidate box:\nvagrant ssh -c 'command -v cloud-init' >/dev/null 2>&1 \\\n  && echo \"box supports cloud_init\" \\\n  || echo \"box lacks cloud-init: use a cloud image or shell provisioning\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer official cloud images (ubuntu/*, debian/* cloud variants) when your Vagrantfile uses config.vm.cloud_init.","Document the cloud-init requirement in the box README if you build boxes with Packer, and install cloud-init in the packer template.","If a box might lack cloud-init, ship an equivalent shell provisioner as a fallback path."],"tags":["vagrant","cloud-init","guest-tools","box"],"backgroundTag":"missing-guest-tool","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}