{"record":{"id":"46bf759a90fdc18b","repo":"hashicorp/vagrant","slug":"no-guest-ip-was-given-to-the-vagrant-core-nfs-help","errorCode":null,"errorMessage":"No guest IP was given to the Vagrant core NFS helper. This is an\ninternal error that should be reported as a bug.","messagePattern":"No guest IP was given to the Vagrant core NFS helper\\. This is an\ninternal error that should be reported as a bug\\.","errorType":"exception","errorClass":"Vagrant::Errors::NFSNoGuestIP","httpStatus":null,"severity":"error","filePath":"plugins/synced_folders/nfs/synced_folder.rb","lineNumber":49,"sourceCode":"        # If the machine explicitly said NFS is not supported, then\n        # it isn't supported.\n        if !machine.config.nfs.functional\n          return false\n        end\n        if machine.env.host.capability?(:nfs_installed)\n          return true if machine.env.host.capability(:nfs_installed)\n        end\n        return false if !raise_error\n        raise Vagrant::Errors::NFSNotSupported\n      end\n\n      def prepare(machine, folders, opts)\n        # Nothing is necessary to do before VM boot.\n      end\n\n      def enable(machine, folders, nfsopts)\n        raise Vagrant::Errors::NFSNoHostIP if !nfsopts[:nfs_host_ip]\n        raise Vagrant::Errors::NFSNoGuestIP if !nfsopts[:nfs_machine_ip]\n\n        if machine.config.nfs.verify_installed\n          if machine.guest.capability?(:nfs_client_installed)\n            installed = machine.guest.capability(:nfs_client_installed)\n            if !installed\n              can_install = machine.guest.capability?(:nfs_client_install)\n              raise Vagrant::Errors::NFSClientNotInstalledInGuest if !can_install\n              machine.ui.info I18n.t(\"vagrant.actions.vm.nfs.installing\")\n              machine.guest.capability(:nfs_client_install)\n            end\n          end\n        end\n\n        machine_ip = nfsopts[:nfs_machine_ip]\n        machine_ip = [machine_ip] if !machine_ip.is_a?(Array)\n\n        # Prepare the folder, this means setting up various options\n        # and such on the folder itself.","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/synced_folders/nfs/synced_folder.rb#L31-L67","documentation":"Mirror of NFSNoHostIP: the NFS enable step raises Vagrant::Errors::NFSNoGuestIP when nfsopts[:nfs_machine_ip] is absent, meaning Vagrant's middleware never resolved an address for the guest. Like its sibling it is framed as an internal error, but in practice it surfaces when the guest's IP cannot be determined (no usable network attachment).","triggerScenarios":"Enabling an NFS synced folder when the machine's address is unresolvable: guest not actually running, attached only to NAT with no readable IP, or the provider failing IP detection; also plugin code invoking enable without nfs_machine_ip.","commonSituations":"NFS folders on machines without a private_network; provider plugins (custom clouds) that don't expose guest addresses; vagrant reload/halt races where the machine's state is inconsistent.","solutions":["Ensure the VM is running and attached to a network Vagrant can read an address from — adding a private_network usually fixes it","Add a static IP if DHCP detection is flaky: config.vm.network \"private_network\", ip: \"192.168.33.10\"","Update Vagrant and provider plugins","Pass nfs_machine_ip in nfsopts if you drive enable() programmatically"],"exampleFix":"# before\nconfig.vm.synced_folder \".\", \"/vagrant\", type: \"nfs\"   # guest IP unresolvable\n\n# after\nconfig.vm.network \"private_network\", ip: \"192.168.33.10\"\nconfig.vm.synced_folder \".\", \"/vagrant\", type: \"nfs\"","handlingStrategy":"validation","validationCode":"# ensure the guest exposes an IP before relying on NFS\nreturn unless machine.state.id == :running\nips = machine.provider.capability(:ip_address) rescue nil","typeGuard":"def nfs_guest_ip_resolvable?(machine)\n  machine.state.id == :running &&\n    machine.provider.driver.respond_to?(:read_ip_addresses)\nend","tryCatchPattern":"begin\n  machine.env.action_runner.run(action, env)\nrescue Vagrant::Errors::NFSNoGuestIP\n  ui.error(\"Guest IP unresolvable - add a private_network and retry\")\nend","preventionTips":["Attach a private_network (static IP if DHCP is flaky) to machines using NFS folders","Only enable NFS folders on running machines","Keep provider plugins updated so IP detection works"],"tags":["nfs","synced-folders","internal-error","guest-network"],"backgroundTag":"internal-invariant-violated","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}