LoginSignup
8
5

More than 5 years have passed since last update.

VirtualboxのGuest Additionsをvagrantで(それなりに)手軽に更新する方法

Posted at

はじめに

VirtualboxのGuest Additionsは

console
$ yum update 
console
$ apt-get upgrade

なんかを行うとkernelのバージョンが上がってインストールされているGuest Additionsのバージョンが上がってしまうことがあります。
一々、ビルドしてとやるのは面倒ですので、vagrant upした時に自動でguest-additionsのバージョンも上げてほしいものです。

プラグインを使う

vagrant-vbguestを利用することで、vagrant upをした際に勝手にVirtualboxのGuest Additionsをビルドしてくれるようになります。

$ vagrant plugin install vagrant-vbguest

(注意) Guest Additionsのビルドに失敗するケース

Vagrantfile
Vagrant.configure("2") do |config|
  config.vbguest.auto_update = false
end

  1. vagrant-vbguestがGuest Additionsを見つけられずビルドエラーが起きる 

  2. vagrant-vbguestを使用する場合はVirtualBoxを常に最新のStableに保っていたほうが安心でしょう 

  3. 上記のようにVagrantfileに記述することで回避可能です。 

8
5
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
8
5