LoginSignup
3
0

More than 5 years have passed since last update.

MacでVagrantを使いCentOS7の仮想環境を作る

Last updated at Posted at 2016-12-08

環境

macOS Sierra 10.12

前提

VagrantとVirtualBoxはインストール済みであること

ディレクトリを作成し移動

$ mkdir centos7
$ cd centos7

CentOS7のboxを追加

boxを探す場合はこちらから (http://www.vagrantbox.es/)

$ vagrant box add centos7 https://github.com/CommanderK5/packer-centos-template/releases/download/0.7.1/vagrant-centos-7.1.box
$ vagrant init

Vagrantfileのbox名を変更

デフォルトのbaseは重複している場合エラーになるので変更するように

Vagrantfile
# baseから指定したbox名に
config.vm.box = "centos7"

仮想サーバーを起動・接続

$ vagrant up
$ vagrant ssh
3
0
0

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
3
0