WindowsへVagrantインストール
前提条件
VirtualBoxインストール済み。
-
msiのダウンロード
以下からWindows用ファイルをダウンロードして実行して下さい。 -
インストール確認
$ vagrant -v
Vagrant 1.6.3
仮想マシンの作成
Vagrantでは[box]という仮想マシンのイメージを作成する事で簡単に複数の仮想マシンを作成できます。
vagrantにcentosのboxを追加
追加したboxから仮想マシンを作成して起動
boxの追加
-
vagrantにCentos6.5のbox追加
以下から、作成したいOSを選択してURLをコピーします -
centos6.5の64bitがほしかった!
-
必要なURL
[version]をクリックして
URLをコピーして下記コマンドを実行します。
※URLの前は、任意に設定できるBoxの名前です。
※今回は「centos6.5_x86_64」としてみました。$ vagrant box add centos6.5_x86_64 https://vagrantcloud.com/nrel/CentOS-6.5-x86_64/version/4/provider/virtualbox.box
-
確認
$ vagrant box list
centos6.5_x86_64 (virtualbox,0)
VMの作成
- 作成 VMを作成する場所へ移動し、以下のコマンドを実行。
$ vagrant init centos6.5_x86_64
準備が完了!
VMの起動
$ vagrant up
- 接続 puttyで接続してみる。
IP 127.0.0.1
PORT 2222
OK!!!
以下、その他のコマンドです。
-
VMの再起動
$ vagrant reload
-
VMの終了
$ vagrant halt
-
VMの状況の確認
$ vagrant status
お疲れ様でした♪
備考
その後、出会した現象と回避サイトの紹介
vagrantで実行したrailsにhost側からアクセスする
ポートフォワーディングをしないといけないらしい。
http://harapeko.wktk.so/blog/ruby/2013-11-22/1715vagrantで起動中のmysql にアクセスする
http://terurou.hateblo.jp/entry/2013/09/10/151744