addictionwhite’s diary

考え中のことを整理と忘備録のために綴ります。ここに書かれている考えは翌日には変わる可能性があります

VagrantとVirtualBoxの環境を整えた際に詰まったことの忘備録


久々にMacのPCでvagrant upを叩くと以下のエラーが出た。

vagrant up
-----------------------
No usable default provider could be found for your system.

Vagrant relies on interactions with 3rd party systems, known as
"providers", to provide Vagrant with resources to run development
environments. Examples are VirtualBox, VMware, Hyper-V.

The easiest solution to this message is to install VirtualBox, which
is available for free on all major platforms.

If you believe you already have a provider available, make sure it
is properly installed and configured. You can see more details about
why a particular provider isn't working by forcing usage with
`vagrant up --provider=PROVIDER`, which should give you a more specific
error message for that particular provider.
-----------------------

 

VirtualBoxはインストールしているので、
バージョンが合っていないか、

紐付け的なものがうまく行っていないのかと考えた。


とりあえずVagrantVirtualBoxを新しいバージョンに差し替えるとエラー内容が変わった(ここで特にバージョンを調べず思いつきでやってしまったのがまずよくない)。
というよりVagrantのコマンドがエラーで叩けなくなった。

 

Vagrantのバージョンを戻して解決(以下のURLを参考)
https://github.com/hashicorp/vagrant/issues/9136


same issue on macOS Sierra 10.12.6
rollback (https://releases.hashicorp.com/vagrant/2.0.0/vagrant_2.0.0_x86_64.dmg) fixes the problem at the moment

要するにvagrantのバージョンを下げた。
vagrantコマンドを叩けるようにはなったが、エラーが上のものに戻った。
VirtualBoxを更新しても最初のエラー内容は変わらず。

 

調べてみると、vagrant up の際にproviderを明記できるのでvirtualboxを指定。
そうすると原因がわかった。
--------------------------
0 master % vagrant up --provider virtualbox
The provider 'virtualbox' that was requested to back the machine
'default' is reporting that it isn't usable on this system. The
reason is shown below:

Vagrant has detected that you have a version of VirtualBox installed
that is not supported by this version of Vagrant. Please install one of
the supported versions listed below to use Vagrant:

4.0, 4.1, 4.2, 4.3, 5.0, 5.1

A Vagrant update may also be available that adds support for the version
you specified. Please check www.vagrantup.com/downloads.html to download
the latest version.
--------------------------


*確かそのとき入っていたVirtualBoxは5.2~だったように思う。

VirtualBoxをダウングレードして再度
vagrant up --provider virtualbox

 

vagrant up が機能した。
一応その時のバージョンをメモ。
-------------
0 master % vagrant -v
Vagrant 2.0.0

0 master % VBoxManage -v
4.3.40r110317
-------------

参考

https://github.com/hashicorp/vagrant/issues/9136

// VirtualBoxをダウングレードしてみる
http://d.hatena.ne.jp/yk5656/20141013/1415360753