{"record":{"id":"895a686d91f8b4e6","repo":"hashicorp/vagrant","slug":"the-specified-host-network-could-not-be-found","errorCode":null,"errorMessage":"The specified host network could not be found: '%{name}.'\nIf the name specification is removed, Vagrant will create a new\nhost only network for you. Alternatively, please create the\nspecified network manually.","messagePattern":"The specified host network could not be found: '%(.+?)\\.'\nIf the name specification is removed, Vagrant will create a new\nhost only network for you\\. Alternatively, please create the\nspecified network manually\\.","errorType":"exception","errorClass":"Vagrant::Errors::NetworkNotFound","httpStatus":null,"severity":"error","filePath":"plugins/providers/virtualbox/action/network.rb","lineNumber":394,"sourceCode":"            mac:         options[:mac],\n            name:        options[:name],\n            netmask:     options[:netmask],\n            nic_type:    options[:nic_type],\n            type:        options[:type]\n          }.merge(dhcp_options)\n        end\n\n        def hostonly_adapter(config)\n          @logger.info(\"Searching for matching hostonly network: #{config[:ip]}\")\n          interface = hostonly_find_matching_network(config)\n\n          if !interface\n            @logger.info(\"Network not found. Creating if we can.\")\n\n            # It is an error if a specific host only network name was specified\n            # but the network wasn't found.\n            if config[:name]\n              raise Vagrant::Errors::NetworkNotFound, name: config[:name]\n            end\n\n            # Create a new network\n            interface = hostonly_create_network(config)\n            @logger.info(\"Created network: #{interface[:name]}\")\n          end\n\n          if config[:type] == :dhcp\n            create_dhcp_server_if_necessary(interface, config)\n          end\n\n          return {\n            adapter:     config[:adapter],\n            hostonly:    interface[:name],\n            mac_address: config[:mac],\n            nic_type:    config[:nic_type],\n            type:        :hostonly\n          }","sourceCodeStart":376,"sourceCodeEnd":412,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/providers/virtualbox/action/network.rb#L376-L412","documentation":"hostonly_adapter tries to find an existing host-only network matching the config (hostonly_find_matching_network). If none matches and the config carries an explicit :name, Vagrant raises NetworkNotFound rather than silently creating a different network — the name pin means the user expects that exact interface to exist.","triggerScenarios":"`config.vm.network 'private_network', ip: ..., name: '<name>'` (or virtualbox__hostonly_adapter style options) where no host-only interface with that name or display name exists on the host; occurs during `vagrant up`/`reload` network setup.","commonSituations":"Vagrantfiles naming a host-only interface that was deleted or exists only on a teammate's machine; names copied from another host where VirtualBox assigned vboxnet0 vs VirtualBox Host-Only Ethernet Adapter #2; host-only networks wiped by a VirtualBox upgrade/reinstall.","solutions":["Create the interface first: VirtualBox GUI > File > Host Network Manager > Create, or `VBoxManage hostonlyif create` (then `VBoxManage hostonlyif ipconfig <name> --ip ...`)","Remove the name: option so Vagrant creates/uses a matching host-only network automatically","Fix the name to one that exists: list with `VBoxManage list hostonlyifs`","After VirtualBox upgrades, re-check names — they are renumbered and stale names in Vagrantfiles break"],"exampleFix":"# before:\nconfig.vm.network 'private_network', ip: '192.168.56.10',\n  name: 'VirtualBox Host-Only Ethernet Adapter #3'  # doesn't exist\n\n# after (let Vagrant manage it):\nconfig.vm.network 'private_network', ip: '192.168.56.10'\n# or create it: VBoxManage hostonlyif create && VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1","handlingStrategy":"validation","validationCode":"def hostonly_name_exists?(name)\n  `VBoxManage list hostonlyifs`.lines.any? { |l| l =~ /^(Name|DisplayName):\\s+#{Regexp.escape(name)}$/ }\nend\nabort \"host-only interface '#{n}' not found\" unless hostonly_name_exists?(n)","typeGuard":null,"tryCatchPattern":"begin\n  env.cli('up')\nrescue Vagrant::Errors::NetworkNotFound => e\n  warn \"Create #{e.extra_data[:name]} (VBoxManage hostonlyif create) or drop the name: option\"\nend","preventionTips":["Prefer omitting name: on private_network unless reproducibility demands it","Provision required host-only interfaces in the same setup script that installs VirtualBox","Re-verify interface names after VirtualBox upgrades — numbering changes"],"tags":["virtualbox","network","hostonly","interface-name"],"backgroundTag":"network-interface-not-found","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}