目次





ダウンロード

  1. virtualbox(windows) http://download.virtualbox.org/virtualbox/5.0.14/VirtualBox-5.0.14-105127-Win.exe
  1. vagrant(windows) https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1.msi

    それぞれインストール

コマンドプロンプト

c:\Users\ユーザ名>mkdir MyVagrant
c:\Users\ユーザ名>cd MyVagrant
c:\Users\ユーザ名\MyVagrant>mkdir mycentos
c:\Users\ユーザ名\MyVagrant>cd mycentos
c:\Users\ユーザ名\MyVagrant\mycentos>vagrant box add centos http://developer.nrel.
gov/downloads/vagrant-boxes/CentOS-6.5-x86_64-v20140110.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos' (v0) for provider:
    box: Downloading: http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6
.5-x86_64-v20140110.box
    box: Progress: 100% (Rate: 1718k/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'centos' (v0) for 'virtualbox'!

ダウンロード中
6.5にした
c:\Users\ユーザ名\MyVagrant\mycentos>vagrant init centos
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.

共有するディレクトリ作成

mycentosと並列のところにdorというフォルダを作成
メモ帳でVagrantfileを編集
IPアドレスのところのみコメントアウト 192.168.33.10の部分

dataを../dorなどというフォルダを作成して、

config.vm.synced_folder "../dor", "/var/www/html"

にする。

c:\Users\ユーザ名\MyVagrant\mycentos>vagrant up



ログイン

あとはputtyでログインするだけ ユーザ名、パスワードともにvagrant IPアドレスはデフォルトの192.168.33.10

仮想ホストシャットダウン

コマンドプロンプト

c:\Users\ユーザ名\MyVagrant\mycentos>vagrant suspend

マウントエラー対応

http://nekyo.wp.xdomain.jp/2015/11/18/vagrant-%E3%83%9E%E3%82%A6%E3%83%B3%E3%83%88%E3%82%A8%E3%83%A9%E3%83%BC/

もし設定ファイルを間違えたら、

mycentos内のフォルダを全部削除でもう一度mycentos内で

vagrant init centos

と打つ。

最終更新:2016年06月10日 00:50