vagrant・virtualBoxインストール方法

vagrantを使って、開発環境を作りたい時もあるでしょう。

この記事では、vagrantとvirtualBoxのインストール方法を書きます。

vagrantダウンロード

vagrantのダウンロードページに進み、任意のボタンをクリックする。 Download - Vagrant by HashiCorp f:id:utr066:20170930193122p:plain 自分はMacを使っているので、Macのリンクをクリックしてインストール。 Windowsの方は、windowsのボタンをクリックすればいけるはず。

f:id:utr066:20170930193303p:plain

インストールしたらこんな画面が出てくる。 「vagrant.pkg」をクリックし、インストールしよう。

f:id:utr066:20170930193419p:plain

あとは画面にしたがって進んでいくだけ。

f:id:utr066:20170930193314p:plain

インストールが完了したらこんな画面になる。 これでvagrantコマンドが使えるようになります。

VirtualBoxインストール

vagrantを入れて、vagrantコマンドを使えるようになってもエラーが起きます。

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.

上記はvagrantのみを入れて、vagrant upをして起きたエラーです。 providerがねえよカスとか言われてますね。

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.

例として、VirtualBox, VMware, Hyper-Vが挙げられていますね。 今回は、VirtualBoxを入れてみましょう。

https://www.virtualbox.org/wiki/Downloads

上記のページから任意のものをインストールします。

f:id:utr066:20170930195603p:plain

この部分ですね。自分はmacなのでmacと書かれているものをクリックしてインストール。 若干時間がかかるので、待ちましょう。

f:id:utr066:20170930195932p:plain こんな画面になるので、画面にしたがってインストールしましょう。

f:id:utr066:20170930200122p:plain

これでok。 vagrant upもこれでできるはずです。