{"record":{"id":"8afe532122dc9db8","repo":"hashicorp/vagrant","slug":"vagrant-attempted-to-execute-the-capability-cap","errorCode":null,"errorMessage":"Vagrant attempted to execute the capability '%{cap}'\non the detect guest OS '%{guest}', but the guest doesn't\nsupport that capability. This capability is required for your\nconfiguration of Vagrant. Please either reconfigure Vagrant to\navoid this capability or fix the issue by creating the capability.","messagePattern":"Vagrant attempted to execute the capability '%(.+?)'\non the detect guest OS '%(.+?)', but the guest doesn't\nsupport that capability\\. This capability is required for your\nconfiguration of Vagrant\\. Please either reconfigure Vagrant to\navoid this capability or fix the issue by creating the capability\\.","errorType":"exception","errorClass":"Vagrant::Errors::GuestCapabilityNotFound","httpStatus":null,"severity":"error","filePath":"lib/vagrant/guest.rb","lineNumber":47,"sourceCode":"      @machine      = machine\n    end\n\n    # This will detect the proper guest OS for the machine and set up\n    # the class to actually execute capabilities.\n    def detect!\n      guest_name = @machine.config.vm.guest\n      initialize_capabilities!(guest_name, @guests, @capabilities, @machine)\n    rescue Errors::CapabilityHostExplicitNotDetected => e\n      raise Errors::GuestExplicitNotDetected, value: e.extra_data[:value]\n    rescue Errors::CapabilityHostNotDetected\n      raise Errors::GuestNotDetected\n    end\n\n    # See {CapabilityHost#capability}\n    def capability(*args)\n      super\n    rescue Errors::CapabilityNotFound => e\n      raise Errors::GuestCapabilityNotFound,\n        cap: e.extra_data[:cap],\n        guest: name\n    rescue Errors::CapabilityInvalid => e\n      raise Errors::GuestCapabilityInvalid,\n        cap: e.extra_data[:cap],\n        guest: name\n    end\n\n    # Returns the specified or detected guest type name.\n    #\n    # @return [Symbol]\n    def name\n      capability_host_chain[0][0]\n    end\n\n    # This returns whether the guest is ready to work. If this returns\n    # `false`, then {#detect!} should be called in order to detect the\n    # guest OS.","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/lib/vagrant/guest.rb#L29-L65","documentation":"Raised as Vagrant::Errors::GuestCapabilityNotFound from Vagrant::Guest#capability (lib/vagrant/guest.rb:47): the underlying CapabilityHost#capability (capability_host.rb:97) raises CapabilityNotFound when no guest in the machine's guest chain provides the requested capability, and Guest re-raises it naming both the capability and the detected guest. It means the guest resolved, but it cannot perform the OS-specific operation some provider or plugin requires.","triggerScenarios":"Overriding config.vm.guest to a minimal/wrong guest so the chain lacks a capability an action needs (e.g. synced-folder mounting caps when :linux is forced where :ubuntu was detected); outdated guest/provider plugins after a Vagrant upgrade where a capability was renamed or newly required; custom guest plugins that never implemented the capability.","commonSituations":"Manually pinning config.vm.guest to work around a detection issue and silently losing the parent guest chain's capabilities; version drift between Vagrant core and provider/guest plugins; boxes whose OS is newer than the plugin's guest definitions.","solutions":["Remove the manual config.vm.guest override so full detection rebuilds the guest chain with all parent capabilities","Update the provider/guest plugins — capabilities are frequently added and renamed across versions (vagrant plugin update / reinstall)","If you maintain the guest plugin, implement the named capability for that guest","As a stopgap, disable the feature that invokes the capability (e.g. config.vm.synced_folder ... , disabled: true for mount caps)"],"exampleFix":"# before\nconfig.vm.guest = :minimal_linux    # custom guest lacking mount capabilities\nconfig.vm.synced_folder \".\", \"/vagrant\"\n\n# after\nconfig.vm.guest = :ubuntu            # full chain provides the mount capability\nconfig.vm.synced_folder \".\", \"/vagrant\"","handlingStrategy":"validation","validationCode":"# CapabilityHost#capability? (capability_host.rb:85) is the built-in guard\nif machine.guest.capability?(:mount_virtualbox_shared_folder)\n  machine.guest.capability(:mount_virtualbox_shared_folder, folder)\nelse\n  raise \"guest #{machine.guest.name} lacks the required capability\"\nend","typeGuard":null,"tryCatchPattern":"begin\n  machine.guest.capability(:configure_networks, networks)\nrescue Vagrant::Errors::GuestCapabilityNotFound => e\n  abort \"Guest #{e.extra_data[:guest]} lacks capability '#{e.extra_data[:cap]}' — fix config.vm.guest or update plugins\"\nend","preventionTips":["Always probe with machine.guest.capability?(cap_name) before invoking optional capabilities","Don't override config.vm.guest with minimal names that drop parent-chain capabilities","Keep Vagrant core and provider/guest plugins upgraded together so capability sets stay in sync"],"tags":["vagrant","guest","capability","plugin","configuration"],"backgroundTag":"capability-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}