LoginSignup
7

More than 5 years have passed since last update.

Vagrantによる仮想マシンの構築

Last updated at Posted at 2015-05-18

Step1. VirtualBoxのダウンロード&インストール https://www.virtualbox.org/wiki/Downloads

Step2. Vagrantのダウンロード&インストール http://www.vagrantup.com/downloads.html

Step3. 仮想マシン用のディレクトリをつくる。

$ mkdir vagrant_getting_started

$ cd vagrant_getting_started

$ vagrant init

Step4. Boxイメージを選択し設定する。その際、https://atlas.hashicorp.com/boxes/search?utm_source=vagrantcloud.com&vagrantcloud=1
を利用する。

vagrant box add ボックス名

Step5. 仮想マシンの起動

vagrant up

Step6. 仮想マシンへのリモートログイン

vagrant ssh

補足1
詳細は https://docs.vagrantup.com/v2/getting-started/index.html
書いてあります。

補足2
ホストのvagrant initしたディレクトリ(Vagrantfileがあるディレクトリ)
とゲストの/vagrantは同期しているので、ゲスト上でrm -rf /をすると、
ホスト上のVagrantfileがあるディレクトリも削除されます。

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
7