{"record":{"id":"a7028c9fde7e9b00","repo":"hashicorp/vagrant","slug":"freebsd-hosts-do-not-support-sharing-directories-w","errorCode":null,"errorMessage":"FreeBSD hosts do not support sharing directories with whitespace in\ntheir path. Please adjust your path accordingly.","messagePattern":"FreeBSD hosts do not support sharing directories with whitespace in\ntheir path\\. Please adjust your path accordingly\\.","errorType":"exception","errorClass":"Vagrant::Errors::VagrantError","httpStatus":null,"severity":"error","filePath":"plugins/hosts/freebsd/cap/nfs.rb","lineNumber":16,"sourceCode":"# Copyright IBM Corp. 2010, 2025\n# SPDX-License-Identifier: BUSL-1.1\n\nrequire \"vagrant/util\"\nrequire \"vagrant/util/retryable\"\n\nrequire Vagrant.source_root.join(\"plugins\", \"hosts\", \"bsd\", \"cap\", \"nfs\")\n\nmodule VagrantPlugins\n  module HostFreeBSD\n    module Cap\n      class NFS\n        def self.nfs_export(environment, ui, id, ips, folders)\n          folders.each do |folder_name, folder_values|\n            if folder_values[:hostpath] =~ /\\s+/\n              raise Vagrant::Errors::VagrantError,\n                _key: :freebsd_nfs_whitespace\n            end\n          end\n\n          HostBSD::Cap::NFS.nfs_export(environment, ui, id, ips, folders)\n        end\n\n        def self.nfs_exports_template(environment)\n          \"nfs/exports_bsd\"\n        end\n\n        def self.nfs_restart_command(environment)\n          [\"sudo\", \"/etc/rc.d/mountd\", \"onereload\"]\n        end\n      end\n    end\n  end\nend","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/hosts/freebsd/cap/nfs.rb#L1-L34","documentation":"Raised as Vagrant::Errors::VagrantError with `_key: :freebsd_nfs_whitespace` in the FreeBSD host cap (plugins/hosts/freebsd/cap/nfs.rb:16). FreeBSD's exports(5) format cannot express a directory containing whitespace, so before delegating to the BSD nfs_export, Vagrant scans every folder's :hostpath against /\\s+/ and refuses to touch /etc/exports if any match. The work then defers to HostBSD::Cap::NFS.","triggerScenarios":"On a FreeBSD host, any `type: \"nfs\"` synced_folder whose expanded host path matches /\\s+/ — a space or tab anywhere in the path, e.g. \"/home/user/My Projects\".","commonSituations":"Projects living under directories like \"My Documents\" or \"VirtualBox VMs\"; paths interpolated from usernames with spaces; paths copied from Windows shares keeping spaces.","solutions":["Rename or move the host directory so the path contains no whitespace","Create a whitespace-free symlink to the real directory (`ln -s \"/path/with space\" /usr/local/nospace`) and use the symlink as the synced-folder host path","Switch that folder to another synced-folder type if renaming is impossible"],"exampleFix":"# before\nconfig.vm.synced_folder \"/home/me/My Projects\", \"/project\", type: \"nfs\"\n# after — symlink without whitespace (run once on the host)\n# ln -s \"/home/me/My Projects\" /home/me/myprojects\nconfig.vm.synced_folder \"/home/me/myprojects\", \"/project\", type: \"nfs\"","handlingStrategy":"validation","validationCode":"# In your Vagrantfile / wrapper on FreeBSD, reject whitespace host paths up front\nhost_paths = [\"/home/me/My Projects\"] # collected from your synced_folder config\nhost_paths.each do |p|\n  abort \"FreeBSD NFS cannot use whitespace paths: #{p}\" if p =~ /\\s/\nend","typeGuard":null,"tryCatchPattern":"begin\n  HostFreeBSD::Cap::NFS.nfs_export(env, ui, id, ips, folders)\nrescue Vagrant::Errors::VagrantError => e\n  raise if e.message !~ /whitespace/\n  # else: symlink the path and retry with the whitespace-free alias\nend","preventionTips":["Keep FreeBSD project paths whitespace-free by convention","Create symlinks for inherited spaced paths and point the Vagrantfile at them","Add a lint check for synced-folder paths in CI before `vagrant up`"],"tags":["nfs","freebsd","whitespace","path","synced-folders"],"backgroundTag":"path-with-spaces-unsupported","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}