I have a “good enough” solution, similar to what @alexrotaru mentioned on GitHub https://github.com/roots/trellis/issues/1210#issuecomment-884011080. But here are some more details:
My exports File
At the top of this file, I mount the root of my external drive for each of my virtual machines. Note that I tried to set this up with a IP range to avoid the repetition … documentation for the
exports files says it’s possible, but I could not get it to work. Then I remove any mounts inside the Vagrant comment blocks.
"/System/Volumes/Data/Volumes/Storage" -alldirs -mapall=502:20 192.168.50.52
"/System/Volumes/Data/Volumes/Storage" -alldirs -mapall=502:20 192.168.50.39
"/System/Volumes/Data/Volumes/Storage" -alldirs -mapall=502:20 192.168.50.85
... vagrant blocks can be removed
To Avoid This Problem Persisting
In Vagrantfile, utilize the
nfs_export parameter and set it to
false. This will prevent Vagrant from messing the exports file you just manually fixed. To be consistent, I set this variable in vagrant.default.yml (e.g.
vagrant_nfs_export: false). Then in my Vagrantfile, I added
nfs_export: vconfig.fetch('vagrant_nfs_export', false)
where applicable (for me, 3 instances: Wordpress, Trellis, and any shared folders … see lines 93, 98, and 107 below).