3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[解決]ゲストOSが opscode Centos6.5 で vagrant mount ができない

Last updated at Posted at 2015-10-28

OSX 10.9.5
Virtualbox 5.0.6 r103037
Virtualbox Guest Additions 5.0.6
vagrant 1.7.4
CentOS 6.5(ゲストOS)

上記の環境で
opscode の CentOS6.5 で、vagrant up 途中で下記のような mount 失敗エラーがでる

    default: /vagrant => /projects/vagrant/guest_name
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
$ sudo /etc/init.d/vboxadd setup
Removing existing VirtualBox non-DKMS kernel modules       [  OK  ]
Building the VirtualBox Guest Additions kernel modules
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-431.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  ]

kernel-devel-2.6.32-431.el6.x86_64 をインストールしろと言われるので、
外部サイトから rpm をインストール

$ sudo yum install -y http://vault.centos.org/6.4/cr/x86_64/Packages/kernel-devel-2.6.32-431.el6.x86_64.rpm
$ sudo /etc/init.d/vboxadd setup

uname -aのkernelバージョンをあわせないと、
最新版 kernel-devel-2.6.32-504.el6.x86_64.rpm をインストールしても直らない

ゲストOSを再起動

vagrant halt
vagrant up

以上で、解決しました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?