Windows7 64 に VirtualBox4.3.20 と Vagrant1.7.0 をインストールしようとしたメモの続きです。
CentOS6.5 64bitのboxを取得する
https://atlas.hashicorp.com/puppetlabs/boxes/centos-6.5-64-puppet/versions/1.0.0
今回は↑にしてみます。
理由は特にないです。。。
boxをaddする
vagrant box add puppetlabs/centos-6.5-64-puppet
↑をていっとやる。
This box can work with multiple providers! The providers that it
can work with are listed below. Please review the list and choose
the provider you will be working with.
1) virtualbox
2) vmware_desktop
3) vmware_fusion
Enter your choice:
するとproviderを聞かれたので、選択。
自分の場合はvirtualboxを入れているので1を選択。
Enter your choice: virtualbox
Invalid choice. Try again: 1
==> box: Adding box 'puppetlabs/centos-6.5-64-puppet' (v1.0.0) for provider: virtualbox
box: Downloading: https://vagrantcloud.com/puppetlabs/boxes/centos-6.5-64-puppet/versions/1.0.0/providers/virtualbox
.box
box: Progress: 100% (Rate: 951k/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'puppetlabs/centos-6.5-64-puppet' (v1.0.0) for 'virtualbox'!
まあ、virtualboxって打っちゃったんですけどね。
念のためboxが追加されたか確認。
vagrant box list
puppetlabs/centos-6.5-64-puppet (virtualbox, 1.0.0)
OKですね。
初期化
ここまででboxの準備ができたので作業ディレクトリを適当に作って、そこに移動。
初期化コマンドはvagrant init box名
なので先ほど確認したbox名をコピってinit。
vagrant init puppetlabs/centos-6.5-64-puppet
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
このようになればOK。
起動から接続、停止まで
起動
起動コマンドはvagrant up
接続
接続コマンドはvagrant ssh
wとか適当に確認してみた↓
[vagrant@localhost ~]$ w
02:37:21 up 2 min, 1 user, load average: 0.01, 0.02, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
vagrant pts/0 10.0.2.2 02:35 0.00s 0.00s 0.00s w
終了
exitしたらvagrant halt
で終了。