/ Vagrant



$ sudo rm -rf /Applications/Vagrant
$ sudo rm -rf /usr/bin/vagrant
$ sudo pkgutil --forget com.vagrant.vagrant


$ vagrant --version
Vagrant 1.7.2

http://www.vagrantbox.es/ でcentos6.5を取得

$ vagrant box add centos65 \

box add時にエラー発生

Vagrant failed to initialize at a very early stage:

The home directory you specified is not accessible. The home
directory that Vagrant uses must be both readable and writable.

You specified: $HOME/.vagrant.d


$ rm -rf ~/.vagrant.d/


$ vagrant box add centos65 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box
==> box: Adding box 'centos65' (v0) for provider:
    box: Downloading: https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box
==> box: Successfully added box 'centos65' (v0) for 'virtualbox'!

$ vagrant box list
centos65 (virtualbox, 0)

$ mkdir -p ~/work/vagrant/sample
$ cd ~/work/vagrant/sample

$ vagrant init centos65
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.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos65'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: sample_default_1434785939617_19449
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address:
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Remote connection disconnect. Retrying...
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => ~/work/vagrant/sample


$ vi install_nginx.sh

echo "Nginx install..."
sudo rpm -ivh \
sudo yum -y install nginx
sudo service nginx start
sudo chkconfig nginx on

$ vi Vagrantfile

 config.vm.provision "shell", path: "install_nginx.sh"


$ vi Vagrantfile
  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  config.vm.network "private_network", ip: ""


$ vagrant ssh

$ curl -v


$ vagrant halt
$ vagrant destroy