Skip to content

Instantly share code, notes, and snippets.

@kazu69
Created November 3, 2014 01:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazu69/4576d886089358ad61b0 to your computer and use it in GitHub Desktop.
Save kazu69/4576d886089358ad61b0 to your computer and use it in GitHub Desktop.
Mac 10.9.5, Vagrant, Virtualbox4.3.18 mount folders in Linux guest

Vagrant failed to mount folders in Linux guest

  • Mac 10.9.5,
  • Virtualbox4.3.18
  • Vagrant 1.6.5
  • vagrant-vbguest (0.10.0) installed

上記の条件で以下のようにエラーになった

Failed to mount folders in Linux guest. 
. 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

hashicorp/vagrant#3341 にあることらしい dotless-de/vagrant-vbguest#117 こっち

vagrant ssh
Last login: Fri Mar  7 16:57:20 2014 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 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  ]```

yum install kernel-devel-2.6.32-431.el6.x86_64でエラーっぽい インストールする。

 sudo yum install kernel-devel-2.6.32-431.el6.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.nara.wide.ad.jp
 * extras: ftp.nara.wide.ad.jp
 * updates: ftp.nara.wide.ad.jp
Setting up Install Process
No package kernel-devel-2.6.32-431.el6.x86_64 available.
Error: Nothing to do

存在しないみたい。

http://qiita.com/kangju1988/items/1a7444b8886260d5105f http://stackoverflow.com/questions/6513731/linux-yum-install-gcc-missing-kernel-headers

から etc/yum.confを修正とあるが、そもそもそのような行がない。

ということで直接インストールする http://mogproject.blogspot.jp/2013/12/how-to-solve-vagrantcentosvirtualbox.html

vagrant ssh

sudo yum install http://vault.centos.org/6.4/cr/x86_64/Packages/kernel-2.6.32-431.el6.x86_64.rpm

sudo yum install http://vault.centos.org/6.4/cr/x86_64/Packages/kernel-2.6.32-431.el6.x86_64.rpm
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.nara.wide.ad.jp
 * extras: ftp.nara.wide.ad.jp
 * updates: ftp.nara.wide.ad.jp
base                                                                                                                                                       | 3.7 kB     00:00
extras                                                                                                                                                     | 3.3 kB     00:00
updates                                                                                                                                                    | 3.4 kB     00:00
Setting up Install Process
kernel-2.6.32-431.el6.x86_64.rpm                                                                                                                           |  28 MB     00:28
Examining /var/tmp/yum-root-zWdZb6/kernel-2.6.32-431.el6.x86_64.rpm: kernel-2.6.32-431.el6.x86_64
Marking /var/tmp/yum-root-zWdZb6/kernel-2.6.32-431.el6.x86_64.rpm to be installed
Package kernel-2.6.32-431.el6.x86_64 already installed and latest version
/var/tmp/yum-root-zWdZb6/kernel-2.6.32-431.el6.x86_64.rpm: does not update installed package.
Error: Nothing to do
[vagrant@localhost ~]$ Loaded plugins: fastestmirror
ras: ftp.nara.wide.ad.jp
 * updates: ftp.nara.wide.ad.jp
base                                                                                                                                                       | 3.7 kB     00:00
extras                                                                                                                                                     | 3.3 kB     00:00
updates                                                                                                                                                    | 3.4 kB     00:00
Setting up Install Process
kernel-2.6.32-431.el6.x86_64.rpm                                                                                                                           |  28 MB     00:28
Examining /var/tmp/yum-root-zWdZb6/kernel-2.6.32-431.el6.x86_64.rpm: kernel-2.6.32-431.el6.x86_64
Marking /var/tmp/yum-root-zWdZb6/kerne-bash: Loaded: コマンドが見つかりません
[vagrant@localhost ~]$ Loading mirror speeds from cached hostfile
-bash: Loading: コマンドが見つかりません

しかしだめでした。

yum update kernel*

でいけたっぽい。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment