LoginSignup
1
2

More than 5 years have passed since last update.

vagrant upするときのマウントエラー

Posted at

原因

  • virtualbox上で電源オフした場合(非正常に終了された場合)、発生するぽい。
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
  • mountで始まるコマンドを貼ってくださいと言われているが、やっても無駄。

対応

  • ぐっぐってみたら、ゲストでvboxadd setupを行えばいいと書かれていたが「Building the main Guest Additions module」がNGで表示されると直らない。
  • この項目さえOK(他の項目がNGでも)だったら、exitでゲストからホストに戻って「vagrant reload」でゲストを再起動すれば直る。
$ 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-573.18.1.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ソースをインストールしてvboxadd setupをもう一度試す。
  • Building the OpenGL support moduleがNGだが無視する。
$ sudo yum install -y kernel-devel 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                         [失敗]
(Look at /var/log/vboxadd-install.log to find out what went wrong. The module is not built but the others are.)
Doing non-kernel setup of the Guest Additions              [  OK  ]
Starting the VirtualBox Guest Additions                    [  OK  ]
  • ゲストからホストに戻って再起動したら直った。

参考

1
2
1

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