LoginSignup
23
24

More than 5 years have passed since last update.

Vagrantで使用するVirtualBoxを5.0にする。

Last updated at Posted at 2015-07-21

VirtualBoxの5.0が出たので,Vagrant環境を最新のものに更新しました。
本稿執筆時点でのVagrantとVirtualBoxの最新バージョンは以下の通りです。

  • VirtualBox 5.0
  • Vagrant 1.7.4

なおVirtualBox 5.0に対応するVagrantのバージョンは1.7.31以降です。

VirtualBoxのインストール

https://www.virtualbox.org/wiki/Downloads より最新のVirtualBoxを取得してインストールします。

筆者はVirtualBox 5.0 for Windows hosts版を使用しています。

VirtualBox 5.0 Oracle VM VirtualBox Extension Packのインストール

やはり同じく https://www.virtualbox.org/wiki/Downloads よりVirtualBox Extension Packを取得します。
取得したVirtualBox Extension PackはVirtualBoxのファイルメニューから[環境設定]>[機能拡張]メニューを表示してインストールします。

Vagrant 1.7.4のインストール

https://www.vagrantup.com/downloads.html より最新のvagrantを取得してインストールします。

筆者の環境ではファイル使用量をチェックするところでかなり待たされたので、これはフリーズしたのかと思い少し焦りましたが、3分ほどでチェックが終わって、Istall Wizardが次のステージに進み最終的には無事インストールが完了しました。

vagrant-vbguestのインストール

ここでちょっとトラブルが発生。sharaを使ってサンドボックスモードにしようとしたら、そんなコマンドは知らんというつれない返答が。どうもインストールしたはずのpluginがきれいさっぱりなくなってしまった模様。ここでトラブルを追求せずに先に進んだためさらなるトラブルが。

起動中に以下のメッセージが表示されます。

==> target: Checking for guest additions in VM...
target: The guest additions on this VM do not match the installed version of
target: VirtualBox! In most cases this is fine, but in rare cases it can
target: prevent things such as shared folders from working properly. If you see
target: shared folder errors, please make sure the guest additions within the
target: virtual machine match the version of VirtualBox you have installed on
target: your host and reload your VM.
target:
target: Guest Additions Version: 4.3.28
target: VirtualBox Version: 5.0

既存のVMのGuest Additionsのバージョンと動いているVirtualBoxのバージョンが違うとのこと。さらににSharing Folderのマウントに失敗したという赤字のエラーも発生。Guest Additionsのアップデートが必要になりました。

Guest Additionsをアップデートするにはvagrant-vbguest pluginをインストールします。

これはコマンドラインから

vagrant plugin install vagrant-vbguest

と打ち込めばOK。後はVMの起動時に

GuestAdditions versions on your host (5.0.0) and guest (4.3.28) do not match.

と表示され、以下Guest Additionsのインストールシーケンスが表示されます。

なお Could not find the X.Org or XFree86 Window System, skipping. という警告が出ますが、VMにはX Windowをインストールしていないので問題はないはず。

以上でVirtual BoxとVagrantのアップデートが完了しました。

23
24
0

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
23
24