1. Vagrantfileを作成

    mkdir -p (適当なフォルダ)
    cd (上で作ったフォルダ)
    vagrant init bento/centos-6.8
  2. Vagrantfileを編集(サーバとして使いたいので以下のように編集)

    # "forwarded_port", guest: 80, host: 8080
    # ↓コメントを外す+ポートは空いているものを指定 "forwarded_port", guest: 8010, host: 8010
    # "private_network", ip: ""
    # ↓コメントを外す+IPは空いているものを指定 "private_network", ip: ""
    # Centos6.8限定で以下も追記(※1 詳細は後述)
    config.vm.provider "virtualbox" do |vb|
    vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
  3. 起動する

    vagrant up
    vagrant ssh


vagrant up で private key で先に進まずエラーになる


Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.




vagrant upで以下のエラーが出ている

Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:


  1. まずはエラーを一旦無視してログインし、カーネルをアップデート

    vagrant ssh
    su                     # pass:"vagrant"
    yum -y update kernel
  2. アップデートが完了すればexitを2回でログアウトする

  3. Guest Additionsをインストール

    vagrant plugin install vagrant-vbguest
    vagrant vbguest
  4. リロードをかけてエラーが出なければOK

    vagrant reload