Vagrant
2018-07-22 (Sun) · 169 words

プログラミング勉強用の仮想環境作成手順

Vagrant インストール

[pureone@mbp MyVagrant]$ vagrant -v
Vagrant 2.1.2

boxの追加

(イメージファイルのようなもの)

$ vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.
$ vagrant box add centos/7
.....
1) hyperv
2) libvirt
3) virtualbox
4) vmware_desktop

Enter your choice: 3
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

transfer closed with 112519168 bytes remaining to read

エラー発生!!!一旦、調べながら再チャレンジを試みる。

==> box: Successfully added box 'centos/7' (v1804.02) for 'virtualbox'!

OK!!!

初期設定

$ vagrant init centos/7
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
$ ll
-rw-r--r--  1 pureone  staff  3015  7 22 22:47 Vagrantfile

起動

$ vagrant up # 起動
$ vagrant status # 確認
$ vagrant ssh # SSH接続
$ vagrant halt # 終了

Top     back     Posts     Tags     About Me