Vagrant のインストール

VMware plugin のインストール

box のイメージを取得

cent64 実行環境の作成

[~/chef-test]$ vagrant init cent64
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.
 

生成された Vagrantfile を編集し、初回のみ GUI を有効化する

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  # All Vagrant configuration is done here. The most common configuration
  # options are documented and commented below. For a complete reference,
  # please see the online documentation at vagrantup.com.

  config.vm.provider :vmware_fusion do |v|
    v.gui = true
  end

  # Every Vagrant virtual environment requires a box to build off of.
  config.vm.box = "cent64"
 
[~/chef-test]$ vagrant up --provider=vmware_fusion
Bringing machine 'default' up with 'vmware_fusion' provider...
[default] Cloning VMware VM: 'cent64'. This can take some time...
[default] Verifying vmnet devices are healthy...
[default] Preparing network adapters...
[default] Starting the VMware VM...
[default] Waiting for the VM to finish booting...
[default] The machine is booted and ready!
[default] Forwarding ports...
[default] -- 22 => 2222
[default] Configuring network adapters within the VM...
[default] Waiting for HGFS kernel module to load...
[default] Enabling and configuring shared folders...
[default] -- /Users/atsushi/chef-test: /vagrant
 

仮想マシンをアップグレードするか聞かれるので、[今後このダイアログを表示しない] をチェックして、[アップグレードしない]ボタンを押す

update.png
 
[~/chef-test]$ vagrant halt
[default] Attempting graceful shutdown of VM...
[default] Waiting for the VMX process to go away...
 

以降 v.gui = true は不要

cent64 を使ってみる

[~/chef-test]$ vagrant up --provider=vmware_fusion
[~/chef-test]$ uname -a
Darwin hondou-no-MacBook.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013;
root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
[~/chef-test]$ vagrant ssh
[vagrant@vagrant-centos-6 ~]$ uname -a
Linux vagrant-centos-6 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Mar 13 00:26:49 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[vagrant@vagrant-centos-6 ~]$ whoami
vagrant
[vagrant@vagrant-centos-6 ~]$ exit
logout
Connection to 192.168.228.135 closed. 

Cent OS 6.4 には、user:vagrant (password:vagrant) が登録されている。vagrant は sudoer として登録されている

cent64 を停止

[~/chef-test]$ vagrant halt

cent64 をサスペンド

[~/chef-test]$ vagrant suspend

cent64 を破壊

[~/chef-test]$ vagrant destroy

Chef


添付ファイル: fileupdate.png 1608件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS   sitemap
Last-modified: 2014-01-21 (火) 23:46:23 (3972d)
Short-URL: http://at-sushi.com/pukiwiki/index.php?cmd=s&k=e3bee6abd0
ISBN10
ISBN13
9784061426061