エロサイトの作り方

2013年11月から勉強しながらエロサイトを作っています。

VagrantでVirtualBoxのGuest Additionsを自動でバージョンアップさせる

どこかから持ってきたイメージで仮想マシンを作って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.1.0
VirtualBox Version: 4.2

どうやらGuest AdditionsとVirtualBoxのバージョンが一致しないらしい。

調べたら最新は4.3.4なのでどちらも古い。

手動で更新するやり方もあるみたいだけど、vagrant-vbguestプラグインを使うと起動時にバージョンをチェックして、Guest Additions側が古ければ自動でアップデートしてくれるみたい。

vagrant-vbguestを入れる

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

Vagrantを再起動

$ vagrant reload

これで起動時に更新してくれる。便利。