hashicorp/vagrant · error · Vagrant::Errors.VirtualBoxConfigNotFound
Vagrant was unable to locate the configuration file for the
Error message
Vagrant was unable to locate the configuration file for the requested
VirtualBox VM. Verify the requested VM exists and try again.
UUID provided: %{uuid} What it means
VirtualBox 7.0.0 shipped a bug where `showvminfo --machinereadable` could omit machine details Vagrant relies on, so the 7.0 driver special-cases exactly version 7.0.0: it re-implements read_forward_ports by parsing the VM's config file, locating it via `CfgFile="..."` in showvminfo output. If that attribute cannot be matched, VirtualBoxConfigNotFound is raised for the UUID. Any VirtualBox release other than 7.0.0 takes the normal `super` path and never hits this code.
Source
Thrown at plugins/providers/virtualbox/driver/version_7_0.rb:238
# information can be found in the `showvminfo` output. Once more than a
# single port forward is defined, no forwarding information is provided
# in the `showvminfo` output. To work around this we grab the VM configuration
# file from the `showvminfo` output and extract the port forward information
# from there instead.
def read_forwarded_ports(uuid=nil, active_only=false)
# Only use this override for the 7.0.0 release.
return super if get_version.to_s != "7.0.0"
uuid ||= @uuid
@logger.debug("read_forward_ports: uuid=#{uuid} active_only=#{active_only}")
results = []
info = execute("showvminfo", uuid, "--machinereadable", retryable: true)
result = info.match(/CfgFile="(?<path>.+?)"/)
if result.nil?
raise Vagrant::Errors::VirtualBoxConfigNotFound,
uuid: uuid
end
File.open(result[:path], "r") do |f|
doc = REXML::Document.new(f)
networks = REXML::XPath.each(doc.root, "Machine/Hardware/Network/Adapter")
networks.each do |net|
REXML::XPath.each(doc.root, net.xpath + "/NAT/Forwarding") do |fwd|
# Result Array values:
# [NIC Slot, Name, Host Port, Guest Port, Host IP]
result = [
net.attribute("slot").value.to_i + 1,
fwd.attribute("name")&.value.to_s,
fwd.attribute("hostport")&.value.to_i,
fwd.attribute("guestport")&.value.to_i,
fwd.attribute("hostip")&.value.to_s
]
@logger.debug(" - #{result.inspect}")View on GitHub (pinned to 35f3160f4a)
Solutions
- Update VirtualBox to any 7.0.x patch release above 7.0.0 — the workaround (and the bug) only target 7.0.0 exactly
- Verify the VM exists: `VBoxManage showvminfo <uuid>` with the UUID from the error
- If the VM is gone, run `vagrant destroy <name>` (or remove the .vagrant/machines folder) and `vagrant up` to recreate it
- Upgrade Vagrant to a release with refined VirtualBox 7 handling
Defensive patterns
Strategy: fallback
Validate before calling
version = `VBoxManage --version`.strip
puts 'Upgrade VirtualBox past 7.0.0 to avoid the read_forward_ports bug' if version.start_with?('7.0.0') Type guard
def vbox_700?(vagrant_env) vagrant_env.machine(:default, :virtualbox).driver.read_version.to_s == '7.0.0' end
Prevention
- Never stay on the x.0.0 release of a VirtualBox major version - install patch releases
- When copying Vagrant projects between hosts, run `vagrant destroy && vagrant up` to rebuild stale UUIDs
When it happens
Trigger: read_forward_ports on a host running exactly VirtualBox 7.0.0, where `execute("showvminfo", uuid, "--machinereadable")` output has no CfgFile= entry — an unregistered/invalid UUID, a VM whose registration is broken, or the 7.0.0 formatting bug itself.
Common situations: Users who stayed on the initial 7.0.0 release while Vagrant added VirtualBox 7 support; `.vagrant/machines/.../id` pointing at a UUID VirtualBox no longer knows (VM removed from VirtualBox GUI); moving/copying a project directory between hosts with stale machine IDs.
Related errors
- No synced folder implementation is available for your synced
- The guest machine entered an invalid state while waiting for
- The snapshot name `%{snapshot_name}` was not found for the v
- The snapshot name `%{snapshot_name}` was not found for the v
- The checksum of the downloaded provider '%{provider}' did no
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/a589f41988bec782.
Report an issue: GitHub.