Ich habe hunger

あふりかエンジニア、アフリカ向けのB2BのSaaSを開発する

vagrant upしたら、「Vagrant::Errors::LinuxMountFailed」ってエラーが出たときの対処

vagrant upした時、下記のようなエラーが出てました。

Vagrant::Errors::LinuxMountFailed: 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

こういう時は、vboxをリビルドする必要があるらしいので
sshログインして、sudo /etc/init.d/vboxadd setupでリビルド。

vagrant ssh
Last login: Mon Jun 22 06:57:40 2015 from 10.0.2.2
[vagrant@localhost ~]$ sudo /etc/init.d/vboxadd setup
Removing existing VirtualBox non-DKMS kernel modules       [  OK  ]
Building the VirtualBox Guest Additions kernel modules
The gcc utility was not found. If the following module compilation fails then
this could be the reason and you should try installing it.

The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-devel-2.6.32-504.23.4.el6.x86_64

Building the main Guest Additions module                   [失敗]
(Look at /var/log/vboxadd-install.log to find out what went wrong)
Doing non-kernel setup of the Guest Additions              [  OK  ]

エラーも出るし、一旦指示に従って下記コマンドを実行!

sudo yum install -y kernel-devel-2.6.32-504.23.4.el6.x86_64

そして、vboxをリビルドしても同じエラーが出る。

もともとVagrantfileで指定していたshared_folderをきちんと初めにupする時に設定していたことが悪かったのかな?とか思って、一旦悩んだ結果vagrant destroy。これで、同じ問題が起こったら、ゼロから始めてみることにする。

結果

同じ問題起こったので次の日にもう一回チャレンジしてみます:;(∩´﹏`∩);:

参考

qiita.com

qiita.com