hashicorp/vagrant · error · Vagrant::Errors::NFSNoGuestIP
No guest IP was given to the Vagrant core NFS helper. This i
Error message
No guest IP was given to the Vagrant core NFS helper. This is an internal error that should be reported as a bug.
What it means
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).
Source
Thrown at plugins/synced_folders/nfs/synced_folder.rb:49
# If the machine explicitly said NFS is not supported, then
# it isn't supported.
if !machine.config.nfs.functional
return false
end
if machine.env.host.capability?(:nfs_installed)
return true if machine.env.host.capability(:nfs_installed)
end
return false if !raise_error
raise Vagrant::Errors::NFSNotSupported
end
def prepare(machine, folders, opts)
# Nothing is necessary to do before VM boot.
end
def enable(machine, folders, nfsopts)
raise Vagrant::Errors::NFSNoHostIP if !nfsopts[:nfs_host_ip]
raise Vagrant::Errors::NFSNoGuestIP if !nfsopts[:nfs_machine_ip]
if machine.config.nfs.verify_installed
if machine.guest.capability?(:nfs_client_installed)
installed = machine.guest.capability(:nfs_client_installed)
if !installed
can_install = machine.guest.capability?(:nfs_client_install)
raise Vagrant::Errors::NFSClientNotInstalledInGuest if !can_install
machine.ui.info I18n.t("vagrant.actions.vm.nfs.installing")
machine.guest.capability(:nfs_client_install)
end
end
end
machine_ip = nfsopts[:nfs_machine_ip]
machine_ip = [machine_ip] if !machine_ip.is_a?(Array)
# Prepare the folder, this means setting up various options
# and such on the folder itself.View on GitHub (pinned to 35f3160f4a)
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
Example fix
# before config.vm.synced_folder ".", "/vagrant", type: "nfs" # guest IP unresolvable # after config.vm.network "private_network", ip: "192.168.33.10" config.vm.synced_folder ".", "/vagrant", type: "nfs"
Defensive patterns
Strategy: validation
Validate before calling
# ensure the guest exposes an IP before relying on NFS return unless machine.state.id == :running ips = machine.provider.capability(:ip_address) rescue nil
Type guard
def nfs_guest_ip_resolvable?(machine)
machine.state.id == :running &&
machine.provider.driver.respond_to?(:read_ip_addresses)
end Try / catch
begin
machine.env.action_runner.run(action, env)
rescue Vagrant::Errors::NFSNoGuestIP
ui.error("Guest IP unresolvable - add a private_network and retry")
end Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- No host IP was given to the Vagrant core NFS helper. This is
- No valid IDs were given to the NFS synced folder implementat
- The synced folder type '%{type}' is reporting as unusable fo
- NFS is reporting that your exports file is invalid. Vagrant
- FreeBSD hosts do not support sharing directories with whites
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/46bf759a90fdc18b.
Report an issue: GitHub.