hashicorp/vagrant · error · Vagrant::Errors::BoxRemoveNotFound
The box you requested to be removed could not be found. No b
Error message
The box you requested to be removed could not be found. No
boxes named '%{name}' could be found. What it means
Errors::BoxRemoveNotFound is raised by the BoxRemove builtin when the box collection contains zero entries whose name equals the requested box name. It is the plain 'no such box installed' guard before any version/provider disambiguation logic runs.
Source
Thrown at lib/vagrant/action/builtin/box_remove.rb:35
box_name = env[:box_name]
box_architecture = env[:box_architecture] if env[:box_architecture]
box_provider = env[:box_provider].to_sym if env[:box_provider]
box_version = env[:box_version]
box_remove_all_versions = env[:box_remove_all_versions]
box_remove_all_providers = env[:box_remove_all_providers]
box_remove_all_architectures = env[:box_remove_all_architectures]
box_info = Util::HashWithIndifferentAccess.new
env[:box_collection].all.each do |name, version, provider, architecture|
next if name != box_name
box_info[version] ||= Util::HashWithIndifferentAccess.new
box_info[version][provider] ||= []
box_info[version][provider] << architecture
end
# If there's no box info, then the box doesn't exist here
if box_info.empty?
raise Errors::BoxRemoveNotFound, name: box_name
end
# Filtering only matters if not removing all versions
if !box_remove_all_versions
# If no version was provided, and not removing all versions,
# only allow one version to proceed
if !box_version && box_info.size > 1
raise Errors::BoxRemoveMultiVersion,
name: box_name,
versions: box_info.keys.sort.map { |k| " * #{k}" }.join("\n")
end
# If a version was provided, make sure it exists
if box_version
if !box_info.keys.include?(box_version)
raise Errors::BoxRemoveVersionNotFound,
name: box_name,
version: box_version,View on GitHub (pinned to 35f3160f4a)
Solutions
- Run 'vagrant box list' and copy the exact name shown there.
- If the box is genuinely gone, no action is needed - treat this as already-clean.
- Check VAGRANT_HOME / which user owns ~/.vagrant.d if the box shows in another context.
- In scripts, tolerate this error (grep the box list first) so cleanup is idempotent.
Example fix
# before vagrant box remove ubutnu/jammy64 # typo -> BoxRemoveNotFound # after vagrant box list vagrant box remove ubuntu/jammy64
Defensive patterns
Strategy: validation
Validate before calling
installed = env.box_collection.all.map { |name, *, | name }.uniq
exit 0 unless installed.include?(box_name) # idempotent cleanup Type guard
def box_present?(collection, name)
collection.all.any? { |n, *, | n == name }
end Try / catch
begin
env.cli("box", "remove", name)
rescue Vagrant::Errors::BoxRemoveNotFound
# already absent - safe to continue
end Prevention
- Always read the exact name from 'vagrant box list' before removing.
- Make cleanup scripts tolerant of absent boxes so re-runs stay idempotent.
- Remember boxes are per-VAGRANT_HOME/per-user when names seem missing.
When it happens
Trigger: vagrant box remove NAME scans env[:box_collection].all building box_info keyed by version/provider/architecture, skipping entries where name != box_name; if box_info is empty afterwards, the raise fires with name: box_name.
Common situations: Typos in the box name; removing a box already removed (double-run cleanup script); box lives under a different user/VAGRANT_HOME than the shell using; name confusion between 'ubuntu/jammy64' and a locally aliased name.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- You requested to remove the box '%{name}'. This box has mult
- You requested to remove the box '%{name}' version '%{version
- You requested to remove the box '%{name}' version '%{version
- You requested to remove the box '%{name}' version '%{version
- You requested to remove the box '%{name}' version '%{version
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/0f3c18115d5e05c0.
Report an issue: GitHub.