Vagrant共有ディレクトリ同期できない

エラー内容

Vagrant was unable to mount VirtualBox shared folders.

上記エラー発生し、Vagrantの共有ディレクトリにファイルを置いているのに共有ができない。

環境

ホストOS:macOS Sierra バージョン10.12.6
ゲストOS:CentOS Linux release 7.4.1708 (Core)
Vagrant:1.9.7

対処方法

vagrant plugin install vagrant-vbguest

上記コマンド実施後、再起動。

vagrant reload

下記がインストールされ、復旧できます。

Installing:
gcc x86_64 4.8.5-16.el7_4.1 updates 16 M
kernel-devel x86_64 3.10.0-693.17.1.el7 updates 14 M
Installing for dependencies:
cpp x86_64 4.8.5-16.el7_4.1 updates 5.9 M
glibc-devel x86_64 2.17-196.el7_4.2 updates 1.1 M
glibc-headers x86_64 2.17-196.el7_4.2 updates 676 k
kernel-headers x86_64 3.10.0-693.17.1.el7 updates 6.0 M

Transaction Summary

コマンド実行前に発生したエラー

~/vagrant vagrant reload
==> default: Attempting graceful shutdown of VM...
==> default: Checking if box 'viniciusxavier/centos7.4' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Mounting shared folders...
default: /vagrant => /Users/vagrant/
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:

mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

ABOUTこの記事をかいた人

山中 雅彦

大分でWebシステム受託開発会社のバックエンドエンジニアとして働いてます。 Laravel5でのシステム開発を中心に仕事してます。 高校卒業後に鉄鋼会社で電気整備の仕事をする傍ら、HTML、CSS、JS、PHP、MySQL、サーバ関連技術を独学で勉強。 2017年9月にWebシステム開発会社に入社し、システム開発をしています。 Web技術全般が好きなPHPerです。