{"record":{"id":"4285843739b4ef7c","repo":"hashicorp/vagrant","slug":"the-configured-host-vm-vagrantfile-could-not-be-fo","errorCode":null,"errorMessage":"The configured host VM Vagrantfile could not be found. Please fix\nthe Vagrantfile for this Docker environment to point to a valid\nhost VM.","messagePattern":"The configured host VM Vagrantfile could not be found\\. Please fix\nthe Vagrantfile for this Docker environment to point to a valid\nhost VM\\.","errorType":"exception","errorClass":"VagrantPlugins::DockerProvider::Errors::VagrantfileNotFound","httpStatus":null,"severity":"error","filePath":"plugins/providers/docker/provider.rb","lineNumber":106,"sourceCode":"        # Expand it so that the home directories and so on get processed\n        # properly.\n        vf_path = File.expand_path(vf_path, @machine.env.root_path)\n\n        vf_file = File.basename(vf_path)\n        vf_path = File.dirname(vf_path)\n\n        # Create the env to manage this machine\n        @host_vm = Vagrant::Util::SilenceWarnings.silence! do\n          host_env = Vagrant::Environment.new(\n            cwd: vf_path,\n            home_path: @machine.env.home_path,\n            ui_class: @machine.env.ui_class,\n            vagrantfile_name: vf_file,\n          )\n\n          # If there is no root path, then the Vagrantfile wasn't found\n          # and it is an error...\n          raise Errors::VagrantfileNotFound if !host_env.root_path\n\n          host_env.machine(\n            host_machine_name,\n            host_env.default_provider(\n              exclude: [:docker],\n              force_default: false,\n            ))\n        end\n\n        @host_vm\n      end\n\n      # This acquires a lock on the host VM.\n      def host_vm_lock\n        hash = Digest::MD5.hexdigest(host_vm.data_dir.to_s)\n\n        # We do a process-level mutex on the outside, since we can\n        # wait for that a short amount of time. Then, we do a process lock","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/providers/docker/provider.rb#L88-L124","documentation":"The Docker provider builds a separate Vagrant::Environment for the host VM from provider_config.vagrant_vagrantfile (expanded against the main project root; when unset, a default Vagrantfile is copied into the data dir). If that environment ends with no root_path - no Vagrantfile with the expected filename found at that path - VagrantfileNotFound is raised.","triggerScenarios":"d.vagrant_vagrantfile pointing at a missing file, a directory without a Vagrantfile, or a wrong file name (vagrantfile_name is taken from the basename); relative paths that do not resolve against the main Vagrantfile's directory.","commonSituations":"Project moved or renamed after configuring a host VM Vagrantfile; the path not committed to version control so teammates hit it; absolute paths copied from another machine.","solutions":["Fix d.vagrant_vagrantfile to an existing Vagrantfile - relative paths resolve from the main project root, e.g. \"./host-vm/Vagrantfile\"","If you do not need a custom host VM, remove the option so the built-in default Vagrantfile is used","Commit or template the host VM Vagrantfile so every checkout has it"],"exampleFix":"# before\nconfig.vm.provider \"docker\" do |d|\n  d.vagrant_vagrantfile = \"./host-vm\"        # directory without a Vagrantfile\nend\n\n# after\nconfig.vm.provider \"docker\" do |d|\n  d.vagrant_vagrantfile = \"./host-vm/Vagrantfile\"  # actual file\nend","handlingStrategy":"validation","validationCode":"# inside the Vagrantfile, fail fast with a clear message\nhost_vf = File.expand_path(\"./host-vm/Vagrantfile\", __dir__)\nunless File.file?(host_vf)\n  raise \"host VM Vagrantfile missing: #{host_vf}\"\nend\nconfig.vm.provider \"docker\" do |d|\n  d.vagrant_vagrantfile = host_vf\nend","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Commit host VM Vagrantfiles to version control","Prefer paths relative to the main Vagrantfile, never machine-specific absolute paths","Validate custom host VM paths in a wrapper script before invoking vagrant"],"tags":["vagrant","docker","host-vm","vagrantfile","path"],"backgroundTag":"config-file-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}