2014年11月21日金曜日

【Vagrant】Failed to mount folders in Linux guest.


vagrant upしたときにこんなエラーがでることがある。

エラー

Failed to mount folders in Linux guest.

エラー全文

c:\vm\vagrant>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos7'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: vagrant_default_1416540764834_66350
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (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: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => C:/vm/vagrant
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

対応

下記記事を参考に
http://qiita.com/osamu1203/items/10e19c74c912d303ca0b

すでに仮想環境’default’は起動しているようで、
$ vagrant ssh
で起動した仮想マシンへ接続
[vagrant@localhost ~]$ sudo /etc/init.d/vboxadd setup
これがリビルドなのかな?

[vagrant@localhost ~]$ exit
sshを抜けて
Connection to 127.0.0.1 closed.
naichilabmba:vagrant hu$ vagrant halt
==> default: Attempting graceful shutdown of VM...
vagrant haltで仮想マシン停止。もう一度vagrant upで成功した。

スポンサーリンク

Related Posts Plugin for WordPress, Blogger...