お手本どおりやったらエラーが出て何個かの記事を行き来したため。
やること
バーチャルボックスにosを立ち上げるだけ
前提
- vagrantをインストール済みである
- VirtualBoxをインストール済みである
- macOSを使用している
test用を作る
$cd ~
$cd Desktop
$mkdir vagrant_test
$cd vagrant_test
boxをとってくる
$ vagrant box add https://atlas.hashicorp.com/envimation/boxes/ubuntu-xenial-docker
==> box: Loading metadata for box 'https://atlas.hashicorp.com/envimation/boxes/ubuntu-xenial-docker'
==> box: Adding box 'envimation/ubuntu-xenial-docker' (v1.0.0-1516241473) for provider: virtualbox
box: Downloading: https://vagrantcloud.com/envimation/boxes/ubuntu-xenial-docker/versions/1.0.0-1516241473/providers/virtualbox.box
==> box: Successfully added box 'envimation/ubuntu-xenial-docker' (v1.0.0-1516241473) for 'virtualbox'!
initiする
vagrant init envimation/ubuntu-xenial-docker
注意文をよく読む
もし読めない単語があったらここで単語翻訳をしてくれる(文章流し込めば単語で翻訳してくれる...)
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:
https://www.virtualbox.org/manual/ch04.html#sharedfolders
This option can be disabled globally with an environment variable:
VAGRANT_DISABLE_VBOXSYMLINKCREATE=1
or on a per folder basis within the Vagrantfile:
config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
完了
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'envimation/ubuntu-xenial-docker' is up to date...
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
確認
注意点
vagrant init の時は後ろにName(ボックスの)名前を加えること。