ペチパーノート

WEB開発系Tipsブログです。

Vagrant コマンド虎の巻

バージョン確認

vagrant -v
Vagrant 1.7.2

雛形を作成(Vagrantfileの作成)

vagrant init

※Vagrantfileにいろいろ設定してvagrant upでゲストOSが立ち上がる!

boxの追加(OSイメージの追加)

vagrant box [box名] [boxurl]
vagrant box add opscode-centos-6.5 http://opscode-vm-bento.s3.amazonaws.com/vagrantvirtualbox/opscode_centos-6.5_chef-provisionerless.box

boxはここを参照 A list of base boxes for Vagrant - Vagrantbox.es

box一覧

vagrant box list

boxの初期化

vagrant init opscode-centos-6.5

仮想サーバ起動

vagrant up

仮想サーバログイン

vagrant ssh

 仮想サーバ停止

vagrant halt

再起動

vagrant halt
vagrant up

仮想サーバ破棄

vagrant destroy

ssh vagrantでログインできるように.ssh/configに追記

vagrant ssh-config --host vagrant >> ~/.ssh/config