Homestaed 在 macOS Catalina 系統下沒法啓動

升級系統後習慣性的進入 homestaed 執行 vagrant up,結果發現報錯了git

==> 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 用戶一些權限github

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/8vim

vagrant 2.2.6 已針對 Catalina 作了修復ui

相關文章
相關標籤/搜索