5
5

More than 5 years have passed since last update.

Vagrantメモ

Last updated at Posted at 2014-03-23

Box の置き場

Box (テンプレート) の取得

$ vagrant box add [boxの名前] [OSパッケージのパス]

Box のリストを表示

$ vagrant box list

仮想環境 の初期化

例: box (centos65) をもとに仮想環境を構築する。

$ mkdir centos65
$ cd centos65
$ vagrant init centos65

仮想環境の起動

$ vagrant up

仮想環境を終了する。

$ vagrant halt

仮想環境をスリープさせる。

$ vagrant suspend

仮想環境をスリープから復帰させる。

$ vagrant resume

仮想環境を削除する。

$ vagrant destroy

仮想環境にログインする

$ vagrant ssh

ディレクトリの共有

ゲスト側の以下のディレクトリが、ホスト側との共有ディレクトリになる。

/vagrant

box を作る

Vagrantファイルのあるディレクトリで以下のコマンドを実行する。

$ vagrant package

package.box をいうファイルができるので、box に追加する。

$ vagrant box add [box名] package.box
5
5
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
5
5