Vagrant&VirtualBoxの設定
$ vagrant box add mychuno_centos CentOS6.5-minimal-vagrant.box Downloading or copying the box... Extracting box...te: 254M/s, Estimated time remaining: 0:00:01) Successfully added box 'mychuno_centos' with provider 'virtualbox'!
$ vagrant box list
mychuno_centos (virtualbox)
$ vagrant init 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 * The box 'base' could not be found.
Vagrantfileの
config.vm.box 〜
の場所を
config.vm.box = “mychuno_centos”
に修正。
$ vagrant up /Users/chuno/.vagrant.d/boxes/mychuno_centos/virtualbox/Vagrantfile:5: warning: already initialized constant VAGRANTFILE_API_VERSION Bringing machine 'default' up with 'virtualbox' provider... [default] Importing base box 'mychuno_centos'... No base MAC address was specified. This is required for the NAT networking to work properly (and hence port forwarding, SSH, etc.). Specifying this MAC address is typically up to the box and box maintiner. Please contact the relevant person to solve this issue.
Virtual Boxを起動(ターミナル外の作業)して、再度Vagrantを起動。
$ vagrant up /Users/chuno/.vagrant.d/boxes/mychuno_centos/virtualbox/Vagrantfile:5: warning: already initialized constant VAGRANTFILE_API_VERSION Bringing machine 'default' up with 'virtualbox' provider... [default] Setting the name of the VM... [default] Clearing any previously set forwarded ports... [default] Creating shared folders metadata... [default] Clearing any previously set network interfaces... [default] Preparing network interfaces based on configuration... [default] Forwarding ports... [default] -- 22 => 2222 (adapter 1) [default] Running 'pre-boot' VM customizations... [default] Booting VM... [default] Waiting for machine to boot. This may take a few minutes... 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. This can mean a number of things. 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 /Users/chuno/.vagrant.d/boxes/mychuno_centos/virtualbox/Vagrantfile:5: warning: already initialized constant VAGRANTFILE_API_VERSION Bringing machine 'default' up with 'virtualbox' provider... [default] VirtualBox VM is already running.
起動した模様だが、スッキリしない…
$ vagrant status14:44 /Users/chuno/.vagrant.d/boxes/mychuno_centos/virtualbox/Vagrantfile:5: warning: already initialized constant VAGRANTFILE_API_VERSION Current machine states: defaultrunning (virtualbox) The VM is running. To stop this VM, you can run `vagrant halt` to shut it down forcefully, or you can run `vagrant suspend` to simply suspend the virtual machine. In either case, to restart it again, simply run `vagrant up`.
commandキーでゲストOSとホストOSとの行き来が可能。
↓ゲストOSでMySQLに接続した絵。