Ich habe hunger

あふりかエンジニア、アフリカ向けのB2BのSaaSを開発する

vagrant upしたら、「Vagrant::Errors::LinuxMountFailed」ってエラーが出たときの対処【解決編(多分)】

sugi511.hatenablog.com


sugi511.hatenablog.com

この二本のエントリの続きです。

前回のおさらい

vagrant upして、エラー出る -> vagrant-vbguestプラグインとやらが原因 -> そもそもプラグイン入ってないやないかーい -> vagrant-vbguestインストールしよ -> うわっ、インストールでエラー出た! -> nokogiriをvagrantフォルダにインストール! -> vagrant-vbguestインストールできたー!!(イマココ

お楽しみのvagrant up!!

    default: Warning: Connection timeout. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
GuestAdditions versions on your host (4.3.14) and guest (4.3.20) do not match.
Loaded plugins: fastestmirror
Setting up Install Process

な、なんだと・・・!?
しかし、この後に

Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Installing Virtualbox Guest Additions 4.3.14 - guest version is 4.3.20
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.14 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.3.20 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
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  ]
Installing the Window System drivers

おぉ、ズレてるversionのGuest Additionsがインストールされておる・・・!!

そして、vagrant haltして、もう一度upさせてみる(多分reloadでもOK)

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
GuestAdditions 4.3.14 running --- OK.
==> default: Checking for guest additions in VM...
(以下略)

という感じで、無事にshared_folderもきちんと読み込まれるし、動くようになりましたー!!

とりあえず、
1. vagrant upしてMountFailedになったときは、エラーメッセージ読む
2. vagrant-vbguestがインストールされてるか調べる
3. インストールされてたら、バージョンが適切かもついでに調べる

という感じですかね。


vbguestのバージョンアップ関連は以下の記事が参考になります。
特に自動更新の停止とかしておくと良いかもしれないけど、それはまた今度考えよ。

jitsu102.hatenablog.com


ノシノシ