適当なディレクトリでvagrant init (引っ張りたいコンテナの名前) してからvagrant up
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
$ vagrant init hashicorp/bionic64 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.
$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'hashicorp/bionic64' could not be found. Attempting to find and install... default: Box Provider: virtualbox default: Box Version: >= 0 ==> default: Loading metadata for box 'hashicorp/bionic64'
(中略)
==> default: Machine booted and ready!
コンテナが起動し終わってターミナルに戻ってきたらvagrant sshでもう繋げられる
破壊
いらなくなったら vagrant destroy で破壊できる
1 2 3 4
$ vagrant destroy default: Are you sure you want to destroy the 'default' VM? [y/N] y ==> default: Forcing shutdown of VM... ==> default: Destroying VM and associated drives...