I recently updated to MacOS Catalina and began some development from it. The problem is when I "vagrant up" on the terminal, NFS shared folders fail to mount and I am forced to use rsync. However, rsync does not let me use git seamlessly for my work. The reason this is happening I figured out was because the new MacOS created multiple volumes so vagrant is confused where the root of the file in Documents may be: MacOS Disk Image
Is there some way to set the root to something different in the /etc/exports file without it replacing the exports file on every vagrant up? The root is sadly no longer just "/..." it is "System/Volumes/Data/..." in this new MacOS but there is a copy of everything on "/" so vagrant is confused on which to use as the root.
I am repeatedly getting this error message when trying to vagrant up: Terminal Image
For me the workaround suggested in the github issue (https://github.com/hashicorp/vagrant/issues/10961#issuecomment-526132132) took the following form, so it does not break non-Catalina hosts:
nfsPath = "."
if Dir.exist?("/System/Volumes/Data")
nfsPath = "/System/Volumes/Data" + Dir.pwd
end
config.vm.synced_folder nfsPath, "/vagrant", type: "nfs"
This still requires you to remove existing nfs exports from /etc/exports
, or vagrant will complain about a mismatch between what's in the /etc/exports
file vs what is configured in Vagrantfile
.
I have figured out the solution after tinkering. For me, I had to update everything including vagrant (v2.2.6) and virtual box.
Then, in MacOS Catalina, navigate to System Preferences → Security & Privacy → Privacy → Full Disk Access and press '+' then Command-Shift-G and enter the /sbin
directory and find the nfsd
file and add that to Full Disk Access.
Then sudo nano to your /etc/exports
and delete everything in the file and vagrant up should work flawlessly!
For me this was the solution: https://github.com/hashicorp/vagrant/issues/10961#issuecomment-526132132
"workaround is to add /System/Volumes/Data/... to your paths in VagrantFile and /etc/exports"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With