LoginSignup
10
10

More than 5 years have passed since last update.

macにvagrantでcentoOS環境構築

Last updated at Posted at 2014-01-29

virtualBox install

バイナリDLしてインストール

vagrant install

http://www.vagrantup.com/downloads.html
上記からバイナリDLしてインストール

  • gem があるけど使えない

CentOS6を作成する

boxにcentos63という名前をつける
※init時に名称指定しないと「base」というboxがdefaultになるらしい

vagrant box add centos63 http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.3-x86_64-v20130101.box

仮想環境を保存するディレクトリで以下コマンド

cd ~/virtual_work/centos63

vagrant init centos63

ネットワーク設定

vim Vagrantfile

# config.vm.network :private_network, ip: "192.168.33.10"

上記のコメントを解除する。

 config.vm.network :private_network, ip: "192.168.33.10"

仮想環境起動!

vagrant up

ssh でログインしてみる

vagrant ssh

ssh 設定

vagrant ssh-config --host centos63 >> ~/.ssh/config

ssh centos63

ssh root@192.168.33.10

上記で設定したipでログインもできた。
ちなみにrootの初期パスワードは「vagrant」

vagrant コマンドまとめ

vagrant up
vagrant halt
vagrant destroy

とりあえず仮想環境構築まで完了

knife-soloを導入 に続く
http://qiita.com/astrsk_hori/items/35b76c32961319f5d69b

10
10
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
10
10