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

You requested to remove the box '%{name}' version '%{version

Error message

You requested to remove the box '%{name}' version '%{version}'
with provider '%{provider}'. This box has multiple architectures.
You must explicitly select a single architecture to remove with
`--architecture` or specify the `--all-architectures` flag to
remove all architectures. The available architectures for this
box are:

%{architectures}

What it means

Raised by `vagrant box remove` when the selected box name/version/provider has more than one architecture installed (box_info's arch set size > 1) and the command line did not disambiguate. Since boxes can carry multiple architectures per provider (e.g. amd64 and arm64), Vagrant refuses to guess which one to delete. The message enumerates the installed architectures so you can pick one.

Source

Thrown at lib/vagrant/action/builtin/box_remove.rb:95

                  raise Errors::BoxRemoveProviderNotFound,
                    name: box_name,
                    version: box_version,
                    provider: box_provider.to_s,
                    providers: box_info.values.first.keys.map(&:to_s).sort.join(", ")
                else
                  box_info.values.first.delete_if { |k, _| k.to_s != box_provider.to_s }
                end
              end

              # Only a single provider remains
              box_provider = box_info.values.first.keys.first

              # Further filtering only matters if not removing all architectures
              if !box_remove_all_architectures
                # If no architecture was given, check if there are more
                # than a single architecture for the provider in version
                if !box_architecture && box_info.values.first.values.first.size > 1
                  raise Errors::BoxRemoveMultiArchitecture,
                    name: box_name,
                    version: box_version,
                    provider: box_provider.to_s,
                    architectures: box_info.values.first.values.first.sort.join(", ")
                end

                # If architecture was given, check the provider for the version has it
                if box_architecture
                  if !box_info.values.first.values.first.include?(box_architecture)
                    raise Errors::BoxRemoveArchitectureNotFound,
                      name: box_name,
                      version: box_version,
                      provider: box_provider.to_s,
                      architecture: box_architecture,
                      architectures: box_info.values.first.values.first.sort.join(", ")
                  else
                    box_info.values.first.values.first.delete_if { |v| v != box_architecture }
                  end

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Re-run the remove command with `--architecture <arch>` using one of the architectures listed in the error message (e.g. `vagrant box remove mybox --provider virtualbox --architecture arm64`).
  2. Or pass `--all-architectures` to delete every architecture of that box/version/provider in one go.
  3. Check what is actually installed first with `vagrant box list` (it shows provider and architecture per entry) to avoid a second wrong guess.

Example fix

# before
vagrant box remove generic/ubuntu2204 --provider virtualbox
# => BoxRemoveMultiArchitecture (amd64, arm64 listed)

# after
vagrant box remove generic/ubuntu2204 --provider virtualbox --architecture arm64
# or remove everything at once:
vagrant box remove generic/ubuntu2204 --provider virtualbox --all-architectures
Defensive patterns

Strategy: validation

Validate before calling

# Before removing, detect multi-arch installs and disambiguate
list=$(vagrant box list 2>/dev/null | grep -F "${BOX_NAME} (${PROVIDER}")
if [ "$(echo "$list" | grep -cE ', (amd64|x86_64|arm64|aarch64|i386)' )" -gt 1 ] || [ "$(echo "$list" | grep -c "${BOX_NAME} (${PROVIDER}, ")" )" -ge 1 ]; then
  vagrant box remove "$BOX_NAME" --provider "$PROVIDER" --all-architectures
else
  vagrant box remove "$BOX_NAME" --provider "$PROVIDER"
fi

Prevention

When it happens

Trigger: Running `vagrant box remove NAME --provider PROVIDER` (optionally with `--version V`) where that provider/version has 2+ architectures installed, without passing `--architecture` or `--all-architectures`. In code it fires when box_architecture is nil, box_remove_all_architectures is false, and box_info.values.first.values.first.size > 1 (lib/vagrant/action/builtin/box_remove.rb:93-100).

Common situations: Apple Silicon users who previously added both x86_64 and arm64 builds of the same box; shared CI caches accumulating multi-arch boxes; scripts written before architecture support (Vagrant < 2.3.x) that assume one install per provider.

Related errors


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