VagrantのプラグインでVirtualBoxゲストOSのGuest Additionsのバージョンをあげる

このエントリーをはてなブックマークに追加
はてなブックマーク - VagrantのプラグインでVirtualBoxゲストOSのGuest Additionsのバージョンをあげる
Facebook にシェア
[`yahoo` not found]
[`livedoor` not found]
[`friendfeed` not found]
[`tweetmeme` not found]

2012/12/12 追記 0.10.0の正式版がでてこの手順はすべて不要!


$ vagrant plugin uninstall vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.10.0)'!

ですべて解決です。以下は過去の記録という事で。

2013/11/15現在この方法が一番よいのではという方法。


$ vagrant plugin install --plugin-source https://rubygems.org/ --plugin-prerelease vagrant-vbguest
Installing the 'vagrant-vbguest --prerelease' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.10.0.pre1)'!

$ vagrant up 

環境は下記の通り


ホストOS: Mac OS X Marvericks
ゲストOS: CentOS release 6.4 (Final),  Ubuntu 12.04.3 LTS

$ vagrant --version
Vagrant 1.3.5

$ VBoxManage --version
4.3.2r90405

上記にいたるまでの紆余曲折をログとして。


$ vagrant up
(略)
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
cause things such as shared folders to not work properly. If you see
shared folder errors, please update the guest additions within the
virtual machine and reload your VM.

Guest Additions Version: 4.2.16
VirtualBox Version: 4.3

現在のVirtualBoxのバージョンとゲストにインストールされているGuest Additions Versionが違うといっています。まあ、今まで無視していたんだけどちょっとさくっと直そうと思い立ちました。

vagrant-vbguestというvagrantのプラグインを使うといいらしいと聞いていましたのでインストールを試みました。


$ vagrant plugin uninstall vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.9.0)'!

インストールは普通にできました。

vagrant upしてみます。


$ vagrant up
(略)
[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
cause things such as shared folders to not work properly. If you see
shared folder errors, please update the guest additions within the
virtual machine and reload your VM.

Guest Additions Version: 4.2.16
VirtualBox Version: 4.3
Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.

ゲストと通信できないそうです。

どうやらこれのようです。
Guest-specific operations on a machine not ready for guest communication. · Issue #85 · dotless-de/vagrant-vbguest

vagrant-vbguest-0.10.0.pre0.gemをダウンロードしてインストールすればいいそうです。やってみましょう。


$ curl -O https://rubygems.org/downloads/vagrant-vbguest-0.10.0.pre0.gem
$ vagrant plugin install ./vagrant-vbguest-0.10.0.pre0.gem 
/Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_input.rb:122:in `initialize': no metadata found in ./vagrant-vbguest-0.10.0.pre0.gem (Gem::Package::FormatError)
        from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_input.rb:20:in `new'
        from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package/tar_input.rb:20:in `open'
        from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/package.rb:44:in `open'
        from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:62:in `from_io'
        from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:46:in `block in from_file_by_path'
        from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:45:in `open'
        from /Applications/Vagrant/embedded/lib/ruby/1.9.1/rubygems/format.rb:45:in `from_file_by_path'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/action/install_gem.rb:29:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/action/bundler_check.rb:20:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builder.rb:116:in `call'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in `block in run'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:in `busy'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in `run'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/command/base.rb:17:in `action'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/command/install.rb:27:in `execute'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/commands/plugin/command/root.rb:52:in `execute'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/cli.rb:38:in `execute'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/environment.rb:478:in `cli'
        from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/bin/vagrant:96:in `'
        from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
        from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `
'

まただよ・・・内臓出すなよ・・・。
なんかこれの原因を追っかける気が全くしない。さっきのスレッド読んでると
Home · tmatilai/vagrant-proxyconf Wiki
でプレリリースのバージョン入れる方法書いてくれてたんでやってみる。


$ vagrant plugin install --plugin-source https://rubygems.org/ --plugin-prerelease vagrant-vbguest
Installing the 'vagrant-vbguest --prerelease' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.10.0.pre1)'!

グッツ!!きた。

起動してみます。


$ vagrant up
[default] Machine booted and ready!
GuestAdditions versions on your host (4.3.2) and guest (4.2.16) do not match.
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * rpmforge: ftp.kddilabs.jp
 * updates: ftp.iij.ad.jp
Setting up Install Process
Package kernel-devel-2.6.32-358.23.2.el6.x86_64 already installed and latest version
Package gcc-4.4.7-3.el6.x86_64 already installed and latest version
Package 1:make-3.81-20.el6.x86_64 already installed and latest version
Package 4:perl-5.10.1-131.el6_4.x86_64 already installed and latest version
Nothing to do
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
Installing Virtualbox Guest Additions 4.3.2 - guest version is 4.2.16
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.3.2 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.2.16 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules[  OK  ]
Removing existing VirtualBox non-DKMS kernel modules[  OK  ]
Building the VirtualBox Guest Additions kernel modules[  OK  ]
Doing non-kernel setup of the Guest Additions[  OK  ]
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers[FAILED]
(Could not find the X.Org or XFree86 Window System.)
An error occurred during installation of VirtualBox Guest Additions 4.3.2. Some functionality may not work as intended.
[default] Configuring and enabling network interfaces...
[default] Mounting shared folders...
[default] -- /vagrant

ファッ!!
「An error occurred during installation of VirtualBox Guest Additions 4.3.2. Some functionality may not work as intended.」
いくつかの機能は動かないかもねじゃねーし。。。
でも「Installing the Window System drivers[FAILED]
(Could not find the X.Org or XFree86 Window System.)」だし、X Window入れてないからいらないし問題ないものと理解する。

こっちの人もエラーでてる。
vagrant upで"The guest additions on this VM do not match the install version of VirtualBox!"と言われた時の対策 - k-mats' memo

とりあえず接続して、再起動してみる。


$ vagrant ssh
Last login: Thu Nov 14 16:06:00 2013 from xx.xx.xx.xx
Welcome to your Vagrant-built virtual machine.
[vagrant@localhost ~]$ exit
$ vagrant halt
[default] Attempting graceful shutdown of VM...

$ vagrant up
GuestAdditions 4.3.2 running --- OK.

グッツ!!すばらしいですね。これですっきりです。

Popular Posts:

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*