ドキュメント:
$ gem install vagrant
vagrantコマンドを使っていろいろな操作を行うvagrant -hで help 表示vagrant COMMAND -hで各サブコマンドの help 表示
- 仮想マシンの雛形を用意する →
vagrant box add [NAME] [URL] - 仮想マシンを作成する → ディレクトリを作成しそこに移動して
vagrant initし、作成されたVagrantfileを適宜編集 - 仮想マシンを起動する →
vagrant up
例:
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
$ mkdir foo
$ cd foo
$ vagrant init lucid32
$ vagrant up
その他のよく行うと思われる操作:
- ssh でログインする →
vagrant ssh - シャットダウンする →
vagrant halt - 再起動する →
vagrant reload - ステータスを確認する →
vagrant status - 一時停止する →
vagrant suspend - 一時停止から復帰する →
vagrant resume