升级系统后习惯性的进入 homestaed 执行 vagrant up
,结果发现报错了
==> homestead-7: Checking for guest additions in VM...
==> homestead-7: Setting hostname...
==> homestead-7: Configuring and enabling network interfaces...
==> homestead-7: Exporting NFS shared folders...
NFS is reporting that your exports file is invalid. Vagrant does
this check before making any changes to the file. Please correct
the issues below and execute "vagrant reload":
exports:2: exported dir/fs mismatch: /Users/yuanchao/Code /System/Volumes/Data
==> homestead-7: Checking for guest additions in VM...
==> homestead-7: Setting hostname...
==> homestead-7: Configuring and enabling network interfaces...
==> homestead-7: Exporting NFS shared folders...
==> homestead-7: Preparing to edit /etc/exports. Administrator privileges will be required...
==> homestead-7: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o vers=3,udp,actimeo=1,nolock 192.168.10.1:/Users/yuanchao/Code /home/vagrant/Code
Stdout from the command:
Stderr from the command:
mount.nfs: access denied by server while mounting 192.168.10.1:/Users/yuanchao/Code
后研究发现是因为 Catalina 系统对权限划分的更细致,所以我们要赋予 vagrant
用户一些权限
sudo vim /etc/sudoers
# 添加到文件结尾后保存
vagrant ALL=(ALL) NOPASSWD:ALL
# 删除之前的 exports 文件
sudo rm /etc/exports
# 进入目录执行 up
vagrant up
参考地址
https://discourse.roots.io/t/nfs-mounting-in-trellis-on-mac-os-catalina/16785/8
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。