LoginSignup
23
24

More than 5 years have passed since last update.

Vagrant で NFS マウント関連のエラーが出たときのメモ

Last updated at Posted at 2015-10-07

こういうのが出る時の対応。
(NFSで接続してた環境をもとに vagrant package して作ったBOXを使うと起きがち→事前にやってあれば大丈夫と思われる)

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o 'vers=3,udp' 192.168.44.1:'/Users/xxx/yyy/vagrant' /vagrant

Stdout from the command:

Stderr from the command:

mount.nfs: access denied by server while mounting 192.168.33.10:/Users/xxx/yyy/vagrant

一旦、Vagrant にアクセスして、以下を実行。

Mac
vagrant ssh
Vagrant
sudo ln -s -f /dev/null /etc/udev/rules.d/70-persistent-net.rules
exit

/etc/exports から、当該部分を削除。

Mac
sudo vi /etc/exports

こんなのを削除する

/etc/exports
# VAGRANT-BEGIN: 501 xxxxxxxxx-1234-yyyy-zzzz-11111111
"/Users/xxx/yyy/vagrant" 192.168.44.10 -alldirs -mapall=501:20
# VAGRANT-END: 501 xxxxxxxxx-1234-yyyy-zzzz-11111111

Vagrant を再起動。

Mac
vagrant reload

追記

チェックする(何も表示されなければOK)

Mac
sudo nfsd checkexports

ダメな場合編集

Mac
sudo vi /etc/exports

再起動する

Mac
sudo nfsd stop
sudo nfsd start

追記2

共有フォルダに日本語が使われているときにエラーが出る場合がある様子

追記3

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:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

stdin: is not a tty
/sbin/mount.vboxsf: mounting failed with the error: No such device
  1. 慌てず、 vagrant ssh する
  2. sudo /etc/init.d/vboxadd setup

ここでさらにエラーが出る場合→Vagrantのmountエラーを解決しようとしたらvboxのリビルドがこける

23
24
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
24