hashicorp/vagrant · error · Vagrant::Errors::NFSNoHostIP
No host IP was given to the Vagrant core NFS helper. This is
Error message
No host IP was given to the Vagrant core NFS helper. This is an internal error that should be reported as a bug.
What it means
The NFS synced folder's enable step requires the caller (Vagrant's synced-folder action middleware) to pass nfsopts[:nfs_host_ip]. When that key is missing it raises Vagrant::Errors::NFSNoHostIP, and the message itself labels it an internal error to report as a bug — user config alone is not supposed to reach this raise.
Source
Thrown at plugins/synced_folders/nfs/synced_folder.rb:48
def usable?(machine, raise_error=false)
# 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 optionsView on GitHub (pinned to 35f3160f4a)
Solutions
- Update Vagrant — host-IP resolution bugs in the NFS middleware have been fixed over releases
- Reduce host-interface ambiguity (disconnect stale VPN adapters/bridges) and retry
- If you call enable() from plugin code, pass nfsopts[:nfs_host_ip] explicitly
- File a Vagrant issue with --debug output, as the message directs
Example fix
# plugin code calling NFS enable directly
# before
plugin.enable(machine, folders, {})
# after
plugin.enable(machine, folders, { nfs_host_ip: host_ip, nfs_machine_ip: guest_ip }) Defensive patterns
Strategy: try-catch
Validate before calling
# plugin authors: never call NFS enable without host/guest IPs raise ArgumentError, "nfs_host_ip required" if nfsopts[:nfs_host_ip].nil?
Type guard
def nfs_opts_complete?(nfsopts) !nfsopts[:nfs_host_ip].nil? && !nfsopts[:nfs_machine_ip].nil? end
Try / catch
begin
action_runner.run(...) # action that enables synced folders
rescue Vagrant::Errors::NFSNoHostIP => e
# message says: internal bug - capture debug log and file an issue
report_vagrant_bug("NFSNoHostIP", e)
end Prevention
- Keep Vagrant and provider plugins updated together
- Prefer stable host networking (avoid many transient VPN/bridge adapters) when using NFS
- Plugin code: always pass nfs_host_ip/nfs_machine_ip into enable()
When it happens
Trigger: Vagrant's action stack failing to compute/propagate the host IP before enabling NFS (hosts with unusual/many network interfaces after VPN or docker bridge changes), or third-party plugins/scripts calling SyncedFolderNFS#enable directly without supplying nfs_host_ip.
Common situations: Host network topology changes confusing host-IP detection; custom provider plugins orchestrating synced folders manually; version mismatches between core Vagrant and provider plugins.
Related errors
- No guest IP was given to the Vagrant core NFS helper. This i
- 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/ff5e7ca6d0d0b828.
Report an issue: GitHub.