LoginSignup
2
2

More than 5 years have passed since last update.

久しぶりにvagrant upでFailed to mount foldersのエラー発生 (vagrant1.8.1)

Posted at

はじめに

久しぶりに触るサービスがあり、vagrant upしたらエラーになったので回避策を書きます。

環境

[ホストOS] Mac OSX Yosemite
[ゲストOS] CentOS6.5
Vagrant 1.8.1
VirtualBox 5.0.14

起きたエラー

vagrant upの途中で

GuestAdditions versions on your host (5.0.14) and guest (4.3.4) do not match.

のようにバージョン合わないよの警告が出て、最終的に

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

が発生

解決した方法

まずはゲストOSにログイン

vagrant ssh

yum.confの編集

sudo vi /etc/yum.conf

exclude=kernel*をコメントアウト

#exclude=kernel*

kernelたぐいのupdate

sudo yum -y update kernel
sudo yum -y install kernel-devel kernel-headers dkms gcc gcc-c++

ゲストOSをexitして

exit

再起動 (多分vagrant reloadでも大丈夫)

vagrant halt
vagrant up

すると無事成功しました。

==> default: Complete!
==> default: Initializing database: 
==> default: [  OK  ]

まとめ

一定の頻度で何らかvagrant upでエラーが起きて対応している気が。
前回はvagrant-vbguestの適用した気がします。

dockerも良いけど、vagrantはvagrantで好きなんですけどね。
何だか相性が合わない:disappointed_relieved:

2
2
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
2
2