LoginSignup
68
71

More than 5 years have passed since last update.

vagrant で centosを使ってみる

Posted at

vagrant で cenotsを使ってみる

色々とサーバで遊ぶ為にvagrantでcentosを起動できるようにしておく

vagrantのインストール

以下のダウンロードページからダウンロードしてインストール
http://www.vagrantup.com/downloads.html

box

以下のページで探します
http://www.vagrantbox.es/

今回はcentosという名前でcentos6.5の64bitを使います

$ vagrant box add centos http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.5-x86_64-v20140110.box

初期設定

適当なディレクトリを作って、初期化処理と設定ファイルの変更をします

$ mkdir centos
$ cd centos
$ vagrant init centos
$ vi Vagrantfile

HOSTからアクセスしたいので、IPアドレスを振ります
Vagrantfileに次の一行を追加

config.vm.network :public_network, ip:"<割り振りたいIPアドレス>"

サーバの起動

$ vagrant up

この時にNetwork Interfaceを聞かれたら普段使っている物を選択して下さい

サーバへ接続

$ vagrant ssh
68
71
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
68
71