hashicorp/vagrant · error · Vagrant::Errors::ProviderCantInstall

The provider '%{provider}' doesn't support automatic install

Error message

The provider '%{provider}' doesn't support automatic installation. This is a limitation of this provider. Please report this as a feature request to the provider in question. To install this provider, you'll have to do so manually.

What it means

`vagrant provider --install` looks up the host capability `provider_install_<provider_name>` (e.g. provider_install_hyperv). If @env.host.capability?(key) is false, Vagrant raises Vagrant::Errors::ProviderCantInstall: this provider plugin does not implement automated installation on the current host, so it must be installed manually.

Source

Thrown at plugins/commands/provider/command.rb:61

        with_target_vms(argv, single_target: true) do |m|
          machine = m
        end

        # Output some machine readable stuff
        @env.ui.machine("provider-name", machine.provider_name, target: machine.name.to_s)

        # Check if we're just doing a usability check
        if options[:usable]
          @env.ui.output(machine.provider_name.to_s)
          return 0 if machine.provider.class.usable?(false)
          return 1
        end

        # Check if we're requesting installation
        if options[:install]
          key = "provider_install_#{machine.provider_name}".to_sym
          if !@env.host.capability?(key)
            raise Vagrant::Errors::ProviderCantInstall,
              provider: machine.provider_name.to_s
          end

          @env.host.capability(key)
          return
        end

        # No subtask, just output the provider name
        @env.ui.output(machine.provider_name.to_s)

        # Success, exit status 0
        0
      end
    end
  end
end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Install the provider manually per its documentation (run the VMware/VirtualBox installer or `apt install virtualbox` / `dnf install libvirt` etc.).
  2. Verify afterwards with `vagrant provider --usable`.
  3. If you maintain the provider plugin, implement the provider_install_<name> host capability so --install works.

Example fix

# before
vagrant provider --install vmware_workstation
# after
# 1) install VMware Workstation from the vendor installer
# 2) vagrant plugin install vagrant-vmware-desktop
# 3) verify: vagrant provider --usable
Defensive patterns

Strategy: validation

Validate before calling

name = 'libvirt'
require 'vagrant'
unless Vagrant.host.capability?("provider_install_#{name}".to_sym)
  warn 'this provider cannot be auto-installed; install it manually per its docs'
end

Try / catch

begin
  env.cli(['provider', '--install', name])
rescue Vagrant::Errors::ProviderCantInstall => e
  warn e.extra_data[:provider] # route to manual install instructions
  exit 1
end

Prevention

When it happens

Trigger: `vagrant provider --install vmware_workstation`, `--install libvirt`, or any provider whose plugin never defined a provider_install_* host capability; also a capability that exists for one host OS being requested on another.

Common situations: Providers installed via vendor GUI installers or distro packages (VMware Workstation, VirtualBox on some Linux distros, libvirt via apt/dnf) that Vagrant cannot automate; custom provider plugins missing the capability.

Related errors


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