PC:ThinkPad X250(Corei7 8GB)
OS:Windows10
Vagrant:2.0.1(12/12現在の最新版)
VirtualBox:5.2.2(12/12現在の最新版)
半年ぐらい前に作ったVagrant環境を再び使うことになり、vagrant upをしてみたところ、共有フォルダでエラーが出てしまいました。
(以前は共有フォルダも含めて正常に使えていました)
==> default: Mounting shared folders...
default: /vagrant => C:/Vagrant/centos70
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
The error output from the command was:
mount: unknown filesystem type 'vboxsf'
エラーが出る状態前にやったこと
・Windows8を10にアップデート
・Vagrantを最新版にアップデート(エラー後にアンインストールから再インストール)
・VirtualBoxを最新版にアップデート(エラー後にアンインストールから再インストール)
Vagrantで共有フォルダのマウントに失敗するときの対処方法
上記のようにhostとgestでGuestAdditionsのバージョンが異なるというエラーが出ていました。
[default] GuestAdditions versions on your host (5.2.2) and guest (4.3.28) do not match.
この記事を参考にvagrant-vbguestのインストールしGuest Additions更新を試みてみましたが、以下のエラーが出てしまい、記事のように解決はできませんでした。
$ vagrant vbguest
[default] GuestAdditions versions on your host (5.2.2) and guest (4.3.28) do not match.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
- base: ftp.tsukuba.wide.ad.jp
- extras: ftp.tsukuba.wide.ad.jp
- updates: ftp.tsukuba.wide.ad.jp
Package gcc-4.8.5-16.el7_4.1.x86_64 already installed and latest version
Package binutils-2.25.1-32.base.el7_4.1.x86_64 already installed and latest version
Package 1:make-3.82-23.el7.x86_64 already installed and latest version
Package 4:perl-5.16.3-292.el7.x86_64 already installed and latest version
Package bzip2-1.0.6-13.el7.x86_64 already installed and latest version
Nothing to do
Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Mounting Virtualbox Guest Additions ISO to: /mnt
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 5.2.2 - guest version is 4.3.28
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.2.2 Guest Additions for Linux........
VirtualBox Guest Additions installer
This system appears to have a version of the VirtualBox Guest Additions
already installed. If it is part of the operating system and kept up-to-date,
there is most likely no need to replace it. If it is not up-to-date, you
should get a notification when you start the system. If you wish to replace
it with this version, please do not continue with this installation now, but
instead remove the current version first, following the instructions for the
operating system.
If your system simply has the remains of a version of the Additions you could
not remove you should probably continue now, and these will be removed during
installation.
Do you wish to continue? [yes or no]
Cancelling installation.
An error occurred during installation of VirtualBox Guest Additions 5.2.2. Some functionality may not work as intended.
In most cases it is OK that the "Window System drivers" installation failed.
Redirecting to /bin/systemctl start vboxadd.service
Failed to issue method call: Unit vboxadd.service failed to load: No such file or directory.
Unmounting Virtualbox Guest Additions ISO from: /mnt
なお、私物のPC(PCはVaio(Corei3 8GB)、それ以外の環境は冒頭の情報と一致しているもの)で同じように試したところ、こちらではバージョン違いのエラーがそもそも出ず、問題なく共有フォルダも機能していました。
Vaio側と問題の起きているThinkPadの違いを考えたところ、Vaioは一度Vagrant,VirtualBoxをアンインストールしていたため、同じようにアンインストールから再インストールをしてみましたが、状況は変わりませんでした。
Guest Additionsのバージョン違いを解消し、共有設定を有効に機能させるためには、どうしたらよいか、ご助言をいただけましたら大変助かります。
よろしくお願い致します。
【追記1】
Vagrantでフォルダがmountできないエラーが出たときの対応
上記の記事を参考に以下のコマンドをゲスト側で実行し、カーネルのアップデートは実行されたようですが、現象としては変化ありませんでした。
sudo yum update kernel*
【追記2】
VagrantでBox追加してvagrant upしてdestroyしてまたvagrant upするとか
上記の記事を参考に以下のコマンドを試してみましたが、現象としては変化ありませんでした。
vagrant destroy
【追記3】
vagrant up時にGuestAdditionsがnot runningになる場合、ゲストマシンのkernelをupdateすることで解決できる可能性がある
上記の記事を参考に以下のコマンドを試してみましたが、現象としては変化ありませんでした。
sudo yum update
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。