Set up a Vagrant box on macOS Sierra

  1. Download Vagrant install package then install and verify.
    link: https://www.vagrantup.com/downloads.html
$ vagrant
  1. Create a directory for your vagrant box environment.
mkdir work
cd work
vagrant init
  1. Download a box template(ubuntu) from official site
$ vagrant box add hashicorp/precise64
  1. Edit Vagrantfile : set vagrant box by editing the config.
$ sudo vim Vagrantfile

**make sure this line is uncommented and the value is set for the box.

config.vm.box = "hashicorp/precise64"
config.vm.network "private_network", ip: "192.168.33.10"
  1. Vagrant Up
$ vagrant up
$ vagrant ssh

Type vagrant ssh to log in.

  1. Your ubuntu vagrant box is good to go. Install nginx or whatever you want in the box.
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容