Mac OSX 10.9.4にVirtualBoxとVagrantをインストールして仮想環境を構築した時の備忘録

Mac OSX 10.9.4にVagrantで仮想環境を構築した時の記録です。

Mac OSX 10.9.4で、Vagrantで仮想環境を構築するのは、とても簡単でした。Windows7にVagrantの環境を用意した時は、いくつか詰まったところがありましたが、Macでは、詰まるところなく、簡単に構築できました。



VirtualBox-4.3.14-95030-OSX.dmg をダウンロードしてインストールしました。

vagrant_1.6.3.dmg をダウンロードしてインストールしました。


MacBookAir:vagrant [user name]$ mkdir centos65
MacBookAir:vagrant [user name]$ cd centos65/

MacBookAir:centos65 [user name]$ vagrant init chef/centos-6.5
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 で仮想環境を立ち上げるタイミングで、chef版のためか
MacBookAir:centos65 [user name]$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'chef/centos-6.5' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'chef/centos-6.5'
    default: URL: https://vagrantcloud.com/chef/centos-6.5
==> default: Adding box 'chef/centos-6.5' (v1.0.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/chef/centos-6.5/version/1/provider/virtualbox.box
==> default: Successfully added box 'chef/centos-6.5' (v1.0.0) for 'virtualbox'!
==> default: Importing base box 'chef/centos-6.5'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'chef/centos-6.5' is up to date...
==> default: Setting the name of the VM: centos65_default_1409229402124_23165
==> 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: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/[user name]/Documents/vagrant/centos65

vagrant ssh で仮想環境に接続します。
MacBookAir:centos65 [user name]$ vagrant ssh
Last login: Fri Mar  7 16:57:20 2014 from
[vagrant@localhost ~]$ pwd

[vagrant@localhost ~]$ exit
Connection to closed.
MacBookAir:centos65 [user name]$

vagrant halt で仮想環境を終了させます。
MacBookAir:centos65 [user name]$ vagrant halt
==> default: Attempting graceful shutdown of VM...

0 件のコメント:

人気の投稿 (過去 30 日間)