{"record":{"id":"5e0d015234056345","repo":"hashicorp/vagrant","slug":"the-capability-host-could-not-be-detected-this-is","errorCode":null,"errorMessage":"The capability host could not be detected. This is an internal error that users should never see. Please report a bug.","messagePattern":"The capability host could not be detected\\. This is an internal error that users should never see\\. Please report a bug\\.","errorType":"exception","errorClass":"Vagrant::Errors::CapabilityHostNotDetected","httpStatus":null,"severity":"error","filePath":"lib/vagrant/capability_host.rb","lineNumber":40,"sourceCode":"    #   we should auto-detect it.\n    # @param [Hash<Symbol, Array<Class, Symbol>>] hosts Potential capability\n    #   hosts. The key is the name of the host, value[0] is a class that\n    #   implements `#detect?` and value[1] is a parent host (if any).\n    # @param [Hash<Symbol, Hash<Symbol, Class>>] capabilities The capabilities\n    #   that are supported. The key is the host of the capability. Within that\n    #   is a hash where the key is the name of the capability and the value\n    #   is the class/module implementing it.\n    def initialize_capabilities!(host, hosts, capabilities, *args)\n      @cap_logger = Log4r::Logger.new(\n        \"vagrant::capability_host::#{self.class.to_s.downcase}\")\n\n      if host && !hosts[host]\n        raise Errors::CapabilityHostExplicitNotDetected, value: host.to_s\n      end\n\n      if !host\n        host = autodetect_capability_host(hosts, *args) if !host\n        raise Errors::CapabilityHostNotDetected if !host\n      end\n\n      if !hosts[host]\n        # This should never happen because the autodetect above uses the\n        # hosts hash to look up hosts. And if an explicit host is specified,\n        # we do another check higher up.\n        raise \"Internal error. Host not found: #{host}\"\n      end\n\n      name      = host\n      host_info = hosts[name]\n      host      = host_info[0].new\n      chain     = []\n      chain << [name, host]\n\n      # Build the proper chain of parents if there are any.\n      # This allows us to do \"inheritance\" of capabilities later\n      if host_info[1]","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/capability_host.rb#L22-L58","documentation":"CapabilityHostNotDetected is raised in initialize_capabilities! (lib/vagrant/capability_host.rb:40) when no host was given and autodetect_capability_host could not find any registered host whose detect? returns true. For guests this means Vagrant could not identify the operating system inside the machine; for hosts, the running platform was not recognized.","triggerScenarios":"host is nil and autodetect_capability_host(hosts, *args) returns nil after trying each host class's detect? — commonly Guest#new during 'vagrant up' when the guest OS cannot be probed (communicator broken, unusual distro, box lacking hints), or on an unsupported host platform without the right plugin.","commonSituations":"Boxes with exotic/minimal OSes (busybox, custom images) where detection scripts fail; SSH/WinRM broken so detection commands never run; exotic host platforms needing a provider plugin; heavily stripped boxes with no /etc/os-release.","solutions":["Set the host explicitly so detection is skipped: 'config.vm.guest = :linux' (or :windows)","Fix the underlying communicator first: verify 'vagrant ssh' works, correct credentials/ssh config in the Vagrantfile","Try a standard upstream box for the same OS to confirm the box, not Vagrant, is the problem; report/fix box detection hints"],"exampleFix":"# before (Vagrantfile)\n# (no guest setting, autodetect fails on minimal box)\n\n# after\nconfig.vm.guest = :linux","handlingStrategy":"fallback","validationCode":"# sanity-check communicator before relying on guest autodetect\nraise 'ssh unreachable' unless machine.communicate.ready?","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer standard upstream boxes whose OS detection works out of the box","Set config.vm.guest explicitly in Vagrantfiles for minimal/custom images"],"tags":["vagrant","capability-host","detection","guest","autodetect"],"backgroundTag":"platform-detection-failed","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}