LoginSignup
3
3

More than 5 years have passed since last update.

Vagrant環境構築メモ (Windows)

Last updated at Posted at 2015-04-08

Vagrant環境構築メモ (Windows)

Tasks

  • Vagrantのインストール
  • ゲストOSとしてCentOSをインストール
  • Vagrant初期設定

Environments

  • Windows 7
  • Vagrant 1.7.2
  • VirtualBox 5.0.10
  • CentOS 6.5

Main

Vagrantのインストール

1)下記よりダウンロードし、インストール

2)Windowsを再起動

3)端末で以下を確認

DOS> vagrant -v
Vagrant 1.7.4

ゲストOS (CentOS) のインストール

1)作業フォルダを作成

DOS> cd %HOME%
DOS> mkdir -p ws/vagrant/centos
DOS> cd ws/vagrant/centos

2)CentOSのboxを追加

Vagrantbox.esから利用可能なboxを探してインストール
※今回はCentOS 6.5 x86_64(https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box)を使用。

DOS> vagrant box add centos-6.5 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box

(5分ぐらい待つ)

3)Vagrantfile作成

DOS> vagrant init centos-6.5

※boxを追加するときに指定したbox名("centos-6.5")を指定。

4)Vagrantfile編集

  • プライベートアドレスを指定(下記行をコメントアウト)
config.vm.network "private_network", ip: "192.168.33.10"

5)ゲストOSを起動
$ vagrant up

ゲストOSへログイン

1)puttyのインストール

下記よりダウンロードし、インストール
http://hp.vector.co.jp/authors/VA024651/PuTTYkj.html

2)putty初期設定

下記項目を設定し、「開く」をクリック

  • ホスト名またはIPアドレス: 192.168.33.10
  • ポート: 22

下記を入力し、ログイン

  • username: vagrant
  • password: vagrant

TBD: 設定の保存

Memo

ゲストOSのboxの場所

~/.vagrant.d/boxes

作ったVMの場所

~/VirtualBox\ VMs
VMのファイル名と.vagrant/machines/default/virtualbox/action_set_nameの値で結びついている?

Links

Vagrant
VirtualBox
Vagrantのbase box入手先
チートシート
3
3
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
3
3