1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrant の備忘録

Last updated at Posted at 2016-09-17

概要

自分用に Vagrantの備忘録を記しています。

vagrantのホーム変更

環境変数に"VAGRANT_HOME"を指定することで変更可能

デフォルトではユーザホーム配下に作成される。
boxのファイルが配置されるため肥大化するのが嫌であれば以下で任意フォルダに変更可能

環境変数
VAGRANT_HOME=\<AnyPath>\.vagrant.d

box作成

  • boxリストから作成
vagrant package --base <BoxName> --output \<AnyPath>\<BoxName>.box
  • 既存 VBoxのVMファイルから作成
vagrant package --base \<AnyPath>\<VMName>.vbox --output \<AnyPath>\<BoxName>.box

boxをリストへ登録

vagrant box add  <NewBoxName> <BoxFile>

boxのリストを確認

vagrant box list

初期化(Vagrantfileの作成)

vagrant init <BoxName>

VMの起動

vagrant up

VMの停止

vagrant halt

VMの破棄

vagrant destroy

VMにログイン

WindowsではSSHクライアントが入っていないと不可

vagrant ssh
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?