Windows 7 ã§Vagrantã§Cent OS 6.3å ¥ãã¦ã¿ã
Vagrant - naoyaのはてなダイアリー
æè¿naoyaããã«å½±é¿ããã¾ãã£ã¦ããkazuphã§ãã
naoyaããã¯ä»ã¾ã§ä½¿ãæ¹ãããããªãã¦äºã®è¶³ãè¸ãã§ãã人ã§ãã使ããããªããããªããããããè¨äºãæ¸ãã¦ããã¦æ¬å½ã«å©ããã¾ãã
ã¨ãããã¨ã§ä¾ã«ç¿ã£ã¦vagrantã使ã£ã¦ã¿ã¾ãã
ä»åã¯æå
ã«Win7ã転ãã£ã¦ããã®ã§ãã¡ãã«ã¤ã³ã¹ãã¼ã«ãã¦ã¿ã¾ããã
æé ã¯æ£ç´ããã¨naoyaããã®è¨äºã ãèªãã§ãã°å¤§ä¸å¤«ã§ãã
http://docs.vagrantup.com/v1/docs/getting-started/index.html
ã¡ãªã¿ã«ããã£ã¦ããåºã¦ããRubyã¨RubyGemãå ¥ããæ¹æ³ã¯ä»åã¯å¿ è¦ããã¾ããã§ããã
1. VirtualBoxã®ã¤ã³ã¹ãã¼ã«
https://www.virtualbox.org/wiki/Downloads
âã®ãVirtualBox 4.2.6 for Windows hosts x86/amd64ãã¨æ¸ãã¦ãé¨åã®ãªã³ã¯ãããã¦ã³ãã¼ãããã¦ã³ãã¼ãå¾ã¯ã¤ã³ã¹ãã¼ã©ã«å¾ã£ã¦é£æãã¦ãã°OKã§ãã
2. Vagrantã®ã¤ã³ã¹ãã¼ã«
http://downloads.vagrantup.com/
âããç¾å¨ï¼2013/02/05ï¼ã®ææ°çã®v1.0.6ã®Vagrant.msiããã¦ã³ãã¼ãã
ãã¦ã³ãã¼ãå¾ã¯ã¤ã³ã¹ãã¼ã©ã«å¾ã£ã¦é£æãã¦ãã°OKã§ãã
3. CentOSã®ã¤ã³ã¹ãã¼ã«
http://www.vagrantbox.es/
âã«èª¬æã¨OSã®ãªã¹ããããã¾ãã
$ vagrant box add {title} {url} $ vagrant init {title} $ vagrant up
ããã¥ã¡ã³ãã ã¨ä»¥ä¸ã®ããã«æ¸ãã¦ããã¾ãã
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box $ vagrant init lucid32 $ vagrant up
ãã ããã¯naoyaããã«ç¿ã£ã¦ä»¥ä¸ã®ããã«ãã¦ã¿ã¾ããã
â»64bitãã ããªå ´åãããã¨æãã®ã§é©å®32bitãé¸æãã¦ä¸ããã
vagrant box add centos http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.3-x86_64-v20130101.box vagrant init centos vagrant up
4. sshã試ã
æ¥ç¶ãã¦ã¿ã¾ãã
>vagrant ssh `vagrant ssh` isn't available on the Windows platform. You are still able to SSH into the virtual machine if you get a Windows SSH client (such as PuTTY). The authentication information is shown below: Host: 127.0.0.1 Port: 2222 Username: vagrant Private key: C:/Users/oreore/.vagrant.d/insecure_private_key
ãã£ã¨ããvagrant sshã¯winã ã¨ä½¿ããªããã¼ãã¨æããã¦ãã¾ãã¾ãããå¿ åéãã«Puttyã使ã£ã¦ã¿ã¾ãã
Hostã¨Portã¯ä¸ã«æ¸ãã¦ããéãã§ããã
æåãç§å¯éµãppkã«ãªããã¦ããã¬ãããªãã¨ãã°ã¤ã³ã§ããªããã¨æã£ãã®ã§ããããªãã¨PasswordãUsernameã¨åãã§ãã(^q^)
login as: vagrant Access denied [email protected]'s password:ããâãvagrantã¨ã¿ã¤ã Last login: Tue Feb 5 14:18:22 2013 from 10.0.2.2 Welcome to your Vagrant-built virtual machine. [vagrant@localhost ~]$ cat /etc/redhat-release CentOS release 6.3 (Final)
ã»ãã»ã(^q^)
ã¡ããã¨å ¥ã£ãããã§ãã
5. 次å以éã®èµ·å
vagrant up
ãã³ãã³ãã©ã¤ã³ã§å©ãã°å¤§ä¸å¤«ã®ããã§ãã
6. çµäº
vagrant halt
ã§ãï½ï¼
7.ç ´å£
ä¸åº¦ã¤ãã£ãä»®æ³ç°å¢ãå£ãããå ´åã¯ä»¥ä¸ã§ãã
vagrant destroy
ãã¹ããã¤ï¼
ã¾ã¨ã
ãªã«ããè¶ çµ¶ç°¡åãããã ï¼ï¼ï¼ï¼ï¼
追è¨ï¼2013/02/22ï¼
ãã®ã¾ã¾ã ã¨ãã¹ãOSããVagrantã§ç«ã¡ä¸ããCentOSã«ã¢ã¯ã»ã¹ã§ããªãããã ã£ãã®ã§Vagrantfileã«ä»¥ä¸ã®ããã«ãã¹ããªã³ãªã¼ãããã¯ã¼ã¯ãè¨å®ããã
C:\Users\{yourusername}\.vagrant.d\boxes\centos\Vagrantfile
Vagrant::Config.run do |config| config.vm.base_mac = "080027F7F048" config.vm.customize ["modifyvm", :id, "--memory", 1024] config.vm.network :hostonly, "192.168.50.2", :netmask => "255.255.255.0" end include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__) load include_vagrantfile if File.exist?(include_vagrantfile)
追è¨çµãã
追è¨ã®è¿½è¨ï¼2013/09/26ï¼
Vagrantã®ãã¼ã¸ã§ã³ã1.1ã«ãªã£ã¦ã¡ãã£ã¨å¤ãã£ãã¿ããã§ãã
# -*- mode: ruby -*- # vi: set ft=ruby : VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "centos_base" config.vm.network :private_network, ip: "192.168.33.10" config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--memory", "1024"] end end
hostonlyã«ãã¦ããã®ãprivate_networkã«ãªã£ãæãã§ã