hashicorp/vagrant · error · Vagrant::Errors.VirtualBoxNoName

Vagrant was unable to determine the recommended name for you

Error message

Vagrant was unable to determine the recommended name for your
VirtualBox VM. This is usually an issue with VirtualBox. The output
from VirtualBox is shown below, which may contain an error to fix.
The best way to fix this issue is usually to uninstall VirtualBox,
restart your computer, then reinstall VirtualBox.

VirtualBox output:

%{output}

What it means

During `vagrant up`, the VirtualBox 5.x driver dry-runs `VBoxManage import -n <ovf>` and parses the line `Suggested VM name "..."` from the output to build a parallel-safe unique VM name. If that regex does not match (because VBoxManage printed an error or unexpected output), Vagrant raises VirtualBoxNoName with the raw VBoxManage output embedded in the message. It almost always indicates a broken or mismatched VirtualBox installation rather than a Vagrantfile problem.

Source

Thrown at plugins/providers/virtualbox/driver/version_5_0.rb:434

        end

        def halt
          execute("controlvm", @uuid, "poweroff", retryable: true)
        end

        def import(ovf)
          ovf = Vagrant::Util::Platform.windows_path(ovf)

          output = ""
          total = ""
          last  = 0

          # Dry-run the import to get the suggested name and path
          @logger.debug("Doing dry-run import to determine parallel-safe name...")
          output = execute("import", "-n", ovf)
          result = /Suggested VM name "(.+?)"/.match(output)
          if !result
            raise Vagrant::Errors::VirtualBoxNoName, output: output
          end
          suggested_name = result[1].to_s

          # Append millisecond plus a random to the path in case we're
          # importing the same box elsewhere.
          specified_name = "#{suggested_name}_#{(Time.now.to_f * 1000.0).to_i}_#{rand(100000)}"
          @logger.debug("-- Parallel safe name: #{specified_name}")

          # Build the specified name param list
          name_params = [
            "--vsys", "0",
            "--vmname", specified_name,
          ]

          # Extract the disks list and build the disk target params
          disk_params = []
          disks = output.scan(/(\d+): Hard disk image: source image=.+, target path=(.+),/)
          disks.each do |unit_num, path|

View on GitHub (pinned to 35f3160f4a)

Solutions

  1. Read the 'VirtualBox output:' section of the error — it contains the actual VBoxManage failure to fix
  2. Verify VirtualBox works: run `VBoxManage import -n <box.ovf>` manually and confirm it prints a Suggested VM name
  3. Re-download / re-add the box (`vagrant box remove <box> && vagrant up`) in case the .ovf was truncated
  4. As the message suggests: uninstall VirtualBox, reboot, reinstall the latest 5.x/6.x build, then retry
  5. Upgrade Vagrant so its VirtualBox driver matches the installed VirtualBox major version
Defensive patterns

Strategy: validation

Validate before calling

out = `VBoxManage import -n /path/to/box/box.ovf 2>&1`
abort 'VirtualBox import dry-run broken - reinstall VirtualBox' unless out.match?(/Suggested VM name "/)

Prevention

When it happens

Trigger: Calling the provider's import path (first `vagrant up` / `vagrant box add` + up) where `execute("import", "-n", ovf)` returns output that does not contain /Suggested VM name "(.+?)"/ — e.g. VBoxManage itself errors out, the .ovf inside the box is unreadable, or the installed VBoxManage version emits a different dry-run format than the 5.x driver expects.

Common situations: Corrupted VirtualBox install after an OS upgrade; VirtualBox 5.x CLI tools partially removed or a version mismatch between VBoxManage and the driver Vagrant selected; a damaged/truncated box download; paths with unusual encoding on Windows causing import to fail before printing the suggested name.

Related errors


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