Vagrant マウントエラー
Vagrant を起動しようとするとマウントエラーになる場合がある。
1 2 3 4 5 6 7 8 9 10 11 12 |
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: /sbin/mount.vboxsf: mounting failed with the error: No such device |
解決方法
Windows のコンソールのプロンプトが出た状態で
1 |
vagrant ssh -c 'sudo /etc/init.d/vboxadd setup;exit' |
を実行。
※この前久々にCentOS 7.2 でやってみたら場所が違っていた。(バージョンは都度変わるので注意)
1 |
sudo /opt/VBoxGuestAdditions-5.0.20/init/vboxadd setup |
sshで一回ログインして探しながら実行した方がいいかもしれない。
1 2 3 4 5 6 7 |
Removing existing VirtualBox non-DKMS kernel modules [ OK ] Building the VirtualBox Guest Additions kernel modules Building the main Guest Additions module [ OK ] Building the shared folder support module [ OK ] Building the OpenGL support module [失敗] (Look at /var/log/vboxadd-install.log to find out what went wrong) Doing non-kernel setup of the Guest Additions [ OK ] |
vagrant再起動
これでエラーは解消される。
1 2 |
vagrant halt vagrant up |