Sie sind auf Seite 1von 3

Using vagrant to setup multiple virtual

machine
Published: 28 |uh 2012
Please cohsider to read previous post about setup vagraht for ohe vM
My cohfig to setup 2 virtual machihe ih a pro|ect
# -*- mode. ruby -*-
# v1. sel il=ruby .
varanl..Coni1.run do ]coni1]
SERvER_PATR = "1volumes10ATA1W0RK1SKuNKW0RKS1SERvER"
0EvEL0PMENT_PATR = "1volumes10ATA10EvEL0PMENT"
coni1.vm.dei1ne .Web do ]Web_coni1]
Web_coni1.vm.box = "deb1an"
Web_coni1.vm.share_iolder "SERvER", "1SERvER", SERvER_PATR
Web_coni1.vm.share_iolder "0ATA", "10EvEL0PMENT", 0EvEL0PMENT_PATR
Web_coni1.vm.iorWard_porl 22, 2222
Web_coni1.vm.iorWard_porl 80, 4567
Web_coni1.vm.nelWork .hoslonly, "192.168.0.100"
Web_coni1.vm.cuslom1ze |"mod1iyvm", .1d, "--memory", 512]
end
coni1.vm.dei1ne .senlry do ]senlry_coni1]
senlry_coni1.vm.box = "deb1an"
senlry_coni1.vm.share_iolder "SERvER", "1SERvER", SERvER_PATR
senlry_coni1.vm.share_iolder "0ATA", "10EvEL0PMENT", 0EvEL0PMENT_PATR
senlry_coni1.vm.iorWard_porl 22, 2223
senlry_coni1.vm.nelWork .hoslonly, "192.168.0.101"
senlry_coni1.vm.cuslom1ze |"mod1iyvm", .1d, "--memory", 512]
end
end
This setup will create 2 virtual Machihe, ohe is "web" have ipaddress "192.168.0.100" ahd
kiennt.com archive about resume rss
Using vagrant to setup multiple virtual machine http://kiennt.com/blog/2012/06/28/using-vagrant-to-setup...
1 of 3 11/14/2013 01:49 PM
ahother is "sehtry" with ipaddress is "192.168.0.101".
8ut how, if you usihg varanl up, this will start import deb1an box to create two fresh
hew virtual Machihes. This is really problems if you already setup some virtual machihes,
ahd |ust waht to associate that machihe with varanl.
To do this, look at your .varanl file ih same folder of varanli1le. The format of file
is
{"acl1ve".{"deiaull"."mach1ne uu1d"))
Chahge it to format
{"acl1ve".{"Web"."<uu1d1>", "senlry"."<uu1d2>"))
To get uuid of virtual machihe, usihg vBoxManae commahd
$> vBoxManae l1sl vms
# us1n vBoxManae, you also can conlrol v1rlual mach1ne
$> vBoxManae conlrolvm <vm_uu1d> slarl]poWeroii]resel
# ior more useiul command, lry lo lesl vBoxManae
# lry and ia1led 1s besl Way lo learn .-}
Cther Articles
18 Jun 2012 Ihstall virtual machihe for developmeht with vagraht
09 Jul 2012 Use `grep` commahd to fihd cohteht ih Lihux
25 Jun 2012 Chahge LINUX timezohe ahd datetime
25 Jun 2012 Cohfig virtual host with NCINX ih DE8IAN
19 Jun 2012 Make process 'keep-alive' with daemoh tools
Using vagrant to setup multiple virtual machine http://kiennt.com/blog/2012/06/28/using-vagrant-to-setup...
2 of 3 11/14/2013 01:49 PM

Das könnte Ihnen auch gefallen