LoginSignup
1
0

More than 5 years have passed since last update.

今更だけどvagrant入門

Last updated at Posted at 2018-05-10

お手本どおりやったらエラーが出て何個かの記事を行き来したため。

やること

バーチャルボックスに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.

確認

Screen Shot 2018-05-09 at 20.11.57.png

注意点

vagrant init の時は後ろにName(ボックスの)名前を加えること。

Screen Shot 2018-05-09 at 20.13.27.png

1
0
1

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
0