Vagrant

Vagrant 立ち上げると mount エラー が表示されちゃったときの解決方法(new

More than 3 years have passed since last update.


vboxsf が壊れると

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

つー、エラーが表示され。下記サイトの手順とおりに行っても解消しなかったので、調査し解決したメモ。


vagrantでmountエラーの解決方法

Failed to mount folders in Linux guest. This is usually because the "vboxsf" file system is not available.を直す方法



vboxadd setup を再実行

ゲストOS上で下記のコマンドを実行する。

# 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.3.1.el6.x86_64

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

ああ。なんだかカーネルが。。っていってるので。

# yum install http://vault.centos.org/6.5/updates/x86_64/Packages/kernel-devel-2.6.32-431.3.1.el6.x86_64.rpm

# yum install gcc

再度、・・・結構コンパイルに時間がかかります。

# sudo /etc/init.d/vboxadd setup

Removing existing VirtualBox non-DKMS kernel modules [ OK ]
Building the VirtualBox Guest Additions kernel modules
Building the main Guest Additions module [ OK ]
Building the shared folder support module [ OK ]
Building the OpenGL support module [ OK ]
Doing non-kernel setup of the Guest Additions [ OK ]
Starting the VirtualBox Guest Additions [ OK ]

ゲストOSをlogoutして、ホストOSで

C:\> vagrant halt

C:\> vagrant up

うまくいった。