Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant failing on mounting NFS due to MacOS Catalina beta update

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

like image 876
Bik Avatar asked Jul 09 '19 19:07

Bik


3 Answers

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.

like image 113
Asciiom Avatar answered Oct 21 '22 04:10

Asciiom


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!

like image 19
Bik Avatar answered Oct 21 '22 04:10

Bik


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"

like image 2
izevai Avatar answered Oct 21 '22 03:10

izevai