[Vagrant & VirtualBox] ディレクトリ移動後に vagrant up すると NFS が動かない

プロジェクトディレクトリを移動した際に起こりました。

状況

プロジェクトが一段落。
/Users/****/projects/middleman/ をディレクトリ毎移動しました。
念のため vagrant up すると、下記のような表示がされ、NFS が意図したとおりに動かなくなりました。

==> default: 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:7: path contains non-directory or non-existent components: /Users/****/projects/middleman/build
exports:7: no usable directories in export entry
exports:7: using fallback (marked offline): /

Host OS (mac) 側の設定を確認します。

対応

メッセージによると exports file を確認する必要があるよう。

メッセージは nfsd checkexports の実行結果でした。

% nfsd checkexports
exports:7: path contains non-directory or non-existent components: /Users/****/projects/middleman/build
exports:7: no usable directories in export entry
exports:7: using fallback (marked offline): /

/etc/exports ファイルを確認すると、

% sudo vi /etc/exports

該当しそうな情報が書き込まれていました。

/etc/exports
# VAGRANT-BEGIN: 501 139ad2e1-58f1-486d-8fcc-c449093d4c2e
"/Users/****/projects/middleman/build" 192.168.33.10 -alldirs -mapall=501:20
# VAGRANT-END: 501 139ad2e1-58f1-486d-8fcc-c449093d4c2e

これを削除し、vagrant reload すればOK。

補遺

今回のケースでは、その後、/sbin/mount.vboxsf: mounting failed with the error: No such device という表示が出ました。

==> default: Mounting shared folders...
    default: /vagrant => /Users/****/projects/foo/middleman/VM
Failed to mount folders in Linux guest. This is usually because the "vboxsf" file system is not available. Please verify that the guest additions are properly installed in the guest and can work properly. The command attempted was:
    :

こちらは別にまとめました。