Skip to content
Newer
Older
100644 199 lines (145 sloc) 8.05 KB
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
1 **VeeWee:** the tool to easily build vagrant base boxes
c25fe77 @jedi4ever Updated the README
authored
2 Vagrant is a great tool to test new things or changes in a virtual machine(Virtualbox) using either chef or puppet.
3 The first step is to download an existing 'base box'. I believe this scares a lot of people as they don't know who or how this box was build. Therefore lots of people end up first building their own base box to use with vagrant.
b18ac61 @jedi4ever first commit: recovered some code, not working though
authored
4
c25fe77 @jedi4ever Updated the README
authored
5 Veewee tries to automate this and to share the knowledge and sources you need to create a basebox. Instead of creating custom ISO's from your favorite distribution, it leverages the 'keyboardputscancode' command of Virtualbox so send the actual 'boot prompt' keysequence to boot an existing iso.
b18ac61 @jedi4ever first commit: recovered some code, not working though
authored
6
c25fe77 @jedi4ever Updated the README
authored
7 Before we can actually build the boxes, we need to take care of the minimal things to install:
3ac0ba4 @jedi4ever Added -user option to the validate command.
authored
8
a03ec83 @jedi4ever added highline gem
authored
9 - Have Virtualbox 4.x installed -> download it from http://download.virtualbox.org/virtualbox/
c25fe77 @jedi4ever Updated the README
authored
10
a03ec83 @jedi4ever added highline gem
authored
11
06e9625 @jedi4ever Update some documentation , basically removed the alpha state indication
authored
12 People have reported good experiences, why don't you give it a try?
a03ec83 @jedi4ever added highline gem
authored
13
5e9c1dd @benjaminws Clean up README a tad (more accurate output from shell commands)
benjaminws authored
14 ## Installation:
4901199 @jedi4ever - Added download instructions for the solaris express template
authored
15 __as a gem__
644ad07 @benjaminws More readme fixes :P
benjaminws authored
16
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
17 $ gem install veewee
08fceaf @jedi4ever reformatted documentation
authored
18
4901199 @jedi4ever - Added download instructions for the solaris express template
authored
19 __from source__
644ad07 @benjaminws More readme fixes :P
benjaminws authored
20
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
21 $ git clone https://github.com/jedi4ever/veewee.git
22 $ cd veewee
23 $ gem install bundler
24 $ bundle install
4901199 @jedi4ever - Added download instructions for the solaris express template
authored
25
09b249a @jedi4ever Some basic instructions on how to create a template for a new os
authored
26 If you don't use rvm, be sure to execute vagrant through bundle exec
644ad07 @benjaminws More readme fixes :P
benjaminws authored
27
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
28 $ alias vagrant="bundle exec vagrant"
4901199 @jedi4ever - Added download instructions for the solaris express template
authored
29
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
30
31 ## List all templates
644ad07 @benjaminws More readme fixes :P
benjaminws authored
32
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
33 $ vagrant basebox templates
34 The following templates are available:
d27979d @jedi4ever Again, a massive chunk of restructuring current behavior
authored
35 vagrant basebox define '<box_name>' 'ubuntu-10.10-server-i386-netboot'
36 vagrant basebox define '<box_name>' 'ubuntu-10.10-server-amd64-netboot'
37 vagrant basebox define '<box_name>' 'solaris-11-express-i386'
38 vagrant basebox define '<box_name>' 'freebsd-8.2-pcbsd-i386-netboot'
39 vagrant basebox define '<box_name>' 'Fedora-14-amd64-netboot'
40 vagrant basebox define '<box_name>' 'ubuntu-11.04-server-amd64'
41 vagrant basebox define '<box_name>' 'freebsd-8.2-experimental'
42 vagrant basebox define '<box_name>' 'archlinux-i686'
43 vagrant basebox define '<box_name>' 'CentOS-5.6-i386-netboot'
44 vagrant basebox define '<box_name>' 'openindiana-148-ai-x86'
45 vagrant basebox define '<box_name>' 'ubuntu-10.10-server-i386'
46 vagrant basebox define '<box_name>' 'ubuntu-10.04.2-server-i386'
47 vagrant basebox define '<box_name>' 'ubuntu-10.04.2-amd64-netboot'
48 vagrant basebox define '<box_name>' 'Sysrescuecd-2.0.0-experimental'
49 vagrant basebox define '<box_name>' 'Debian-6.0.1a-amd64-netboot'
50 vagrant basebox define '<box_name>' 'freebsd-8.2-pcbsd-i386'
51 vagrant basebox define '<box_name>' 'Fedora-14-i386'
52 vagrant basebox define '<box_name>' 'Fedora-14-amd64'
53 vagrant basebox define '<box_name>' 'ubuntu-10.04.2-server-i386-netboot'
54 vagrant basebox define '<box_name>' 'opensuse-11.4-i386-experimental'
55 vagrant basebox define '<box_name>' 'CentOS-4.8-i386'
56 vagrant basebox define '<box_name>' 'ubuntu-10.04.2-server-amd64'
57 vagrant basebox define '<box_name>' 'ubuntu-8.04.4-server-amd64'
58 vagrant basebox define '<box_name>' 'gentoo-latest-i386-experimental'
59 vagrant basebox define '<box_name>' 'ubuntu-8.04.4-server-i386'
60 vagrant basebox define '<box_name>' 'windows-2008R2-amd64'
61 vagrant basebox define '<box_name>' 'Fedora-14-i386-netboot'
62 vagrant basebox define '<box_name>' 'archlinux-64-experimental'
63 vagrant basebox define '<box_name>' 'Debian-6.0.1a-i386-netboot'
64 vagrant basebox define '<box_name>' 'ubuntu-10.10-server-amd64'
65 vagrant basebox define '<box_name>' 'archlinux-64-aif-experimental'
66 vagrant basebox define '<box_name>' 'ubuntu-11.04-server-i386'
67 vagrant basebox define '<box_name>' 'CentOS-5.6-i386'
5e9c1dd @benjaminws Clean up README a tad (more accurate output from shell commands)
benjaminws authored
68
69
70 ## Define a new box
e6f1e39 @jedi4ever reformatted documentation
authored
71 Let's define a Ubuntu 10.10 server i386 basebox called myunbuntubox
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
72 this is essentially making a copy based on the templates provided above.
5e9c1dd @benjaminws Clean up README a tad (more accurate output from shell commands)
benjaminws authored
73
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
74 $ vagrant basebox define 'myubuntubox' 'ubuntu-10.10-server-i386'
75 The basebox 'myubuntubox' has been succesfully created from the template ''ubuntu-10.10-server-i386'
76 You can now edit the definition files stored in definitions/myubuntubox
77 or build the box with:
78 vagrant basebox build 'myubuntubox'
c25fe77 @jedi4ever Updated the README
authored
79
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
80 -> This copies over the templates/ubuntu-10.10-server-i386 to definition/myubuntubox
c319d5c @jedi4ever updating documentation for vagrant plugin usage
authored
81
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
82 $ ls definitions/myubuntubox
83 definition.rb postinstall.sh postinstall2.sh preseed.cfg
c25fe77 @jedi4ever Updated the README
authored
84
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
85 ## Optionally modify the definition.rb , postinstall.sh or preseed.cfg
c319d5c @jedi4ever updating documentation for vagrant plugin usage
authored
86
d27979d @jedi4ever Again, a massive chunk of restructuring current behavior
authored
87 Veewee::Definition.declare( {
5e9c1dd @benjaminws Clean up README a tad (more accurate output from shell commands)
benjaminws authored
88 :cpu_count => '1', :memory_size=> '256',
89 :disk_size => '10140', :disk_format => 'VDI',
90 :os_type_id => 'Ubuntu',
91 :iso_file => "ubuntu-10.10-server-i386.iso",
92 :iso_src => "http://releases.ubuntu.com/maverick/ubuntu-10.10-server-i386.iso",
93 :iso_md5 => "ce1cee108de737d7492e37069eed538e",
94 :iso_download_timeout => "1000",
95 :boot_wait => "10",
96 :boot_cmd_sequence => [
97 '<Esc><Esc><Enter>',
98 '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
99 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
100 'hostname=%NAME% ',
101 'fb=false debconf/frontend=noninteractive ',
102 'console-setup/ask_detect=false console-setup/modelcode=pc105 console-setup/layoutcode=us ',
103 'initrd=/install/initrd.gz -- <Enter>'
104 ],
105 :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
106 :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
107 :ssh_host_port => "2222", :ssh_guest_port => "22",
108 :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
109 :shutdown_cmd => "shutdown -H",
110 :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
111 }
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
112 )
c25fe77 @jedi4ever Updated the README
authored
113
11bbcdf @mrchrisadams Added to the read me - this filled in blanks when I was following on …
mrchrisadams authored
114 If you need to change values in the templates, be sure to run the rake undefine, the rake define again to copy the changes across.
115
351c72f @jedi4ever updated documentation
authored
116 ## Getting the cdrom file in place
117 Put your isofile inside the 'currentdir'/iso directory or if you don't run
644ad07 @benjaminws More readme fixes :P
benjaminws authored
118
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
119 $ vagrant basebox build 'myubuntubox'
c25fe77 @jedi4ever Updated the README
authored
120
08fceaf @jedi4ever reformatted documentation
authored
121 - the build assumes your iso files are in 'currentdir'/iso
122 - if it can not find it will suggest to download the iso for you
06e9625 @jedi4ever Update some documentation , basically removed the alpha state indication
authored
123 - use '--force' to overwrite an existing install
c25fe77 @jedi4ever Updated the README
authored
124
ccfcbff @jedi4ever updating documentation for vagrant plugin usage
authored
125 ## Build the new box:
644ad07 @benjaminws More readme fixes :P
benjaminws authored
126
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
127 $ vagrant basebox build 'myubuntubox'
c25fe77 @jedi4ever Updated the README
authored
128
c319d5c @jedi4ever updating documentation for vagrant plugin usage
authored
129 - This will create a machine + disk according to the definition.rb
130 - Note: :os_type_id = The internal Name Virtualbox uses for that Distribution
131 - Mount the ISO File :iso_file
132 - Boot up the machine and wait for :boot_time
133 - Send the keystrokes in :boot_cmd_sequence
134 - Startup a webserver on :kickstart_port to wait for a request for the :kickstart_file
135 - Wait for ssh login to work with :ssh_user , :ssh_password
136 - Sudo execute the :postinstall_files
c25fe77 @jedi4ever Updated the README
authored
137
06e9625 @jedi4ever Update some documentation , basically removed the alpha state indication
authored
138 ## Validate the vm
644ad07 @benjaminws More readme fixes :P
benjaminws authored
139
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
140 $ vagrant basebox validate 'myubuntubox'
06e9625 @jedi4ever Update some documentation , basically removed the alpha state indication
authored
141
142 this will run some cucumber test against the box to see if it has the necessary bits and pieces for vagrant to work
143
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
144 ## Export the vm to a .box file
644ad07 @benjaminws More readme fixes :P
benjaminws authored
145
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
146 $ vagrant basebox export 'myubuntubox'
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
147
148 this is actually calling - vagrant package --base 'myubuntubox' --output 'boxes/myubuntubox.box'
c25fe77 @jedi4ever Updated the README
authored
149
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
150 this will result in a myubuntubox.box
c25fe77 @jedi4ever Updated the README
authored
151
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
152 ## Add the box as one of your boxes
08fceaf @jedi4ever reformatted documentation
authored
153 To import it into vagrant type:
c25fe77 @jedi4ever Updated the README
authored
154
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
155 $ vagrant box add 'myubuntubox' 'myubuntubox.box'
644ad07 @benjaminws More readme fixes :P
benjaminws authored
156
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
157 ## Use it in vagrant
c25fe77 @jedi4ever Updated the README
authored
158
159 To use it:
644ad07 @benjaminws More readme fixes :P
benjaminws authored
160
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
161 $ vagrant init 'myubuntubox'
162 $ vagrant up
163 $ vagrant ssh
09b249a @jedi4ever Some basic instructions on how to create a template for a new os
authored
164
165 ## How to add a new OS/installation (needs some love)
166
b56bb3b @benjaminws My markdownfu sucks.
benjaminws authored
167 I suggest the easiest way is to get an account on github and fork of the veewee repository
644ad07 @benjaminws More readme fixes :P
benjaminws authored
168
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
169 $ git clone https://github.com/*your account*/veewee.git
170 $ cd veewee
171 $ gem install bundler
172 $ bundle install
09b249a @jedi4ever Some basic instructions on how to create a template for a new os
authored
173
174 If you don't use rvm, be sure to execute vagrant through bundle exec
644ad07 @benjaminws More readme fixes :P
benjaminws authored
175
176 $ alias vagrant="bundle exec vagrant"
09b249a @jedi4ever Some basic instructions on how to create a template for a new os
authored
177
178 Start of an existing one
644ad07 @benjaminws More readme fixes :P
benjaminws authored
179
3023407 @benjaminws Whoops, 4 spaces instead of 2 for code blocks. Just like Guido intended.
benjaminws authored
180 $ vagrant basebox define 'mynewos' 'ubuntu...'
09b249a @jedi4ever Some basic instructions on how to create a template for a new os
authored
181
182 - Do changes in the currentdir/definitions/mynewos
183 - When it builds ok, move the definition/mynewos to a sensible directory under templates
184 - commit the changes (git commit -a)
185 - push the changes to github (git push)
186 - go to the github gui and issue a pull request for it
187
61d5bb6 @jedi4ever cleaned up the output during the execution + major changes to make it…
authored
188 ## If you have a setup working, share your 'definition' with me. That would be fun!
b18ac61 @jedi4ever first commit: recovered some code, not working though
authored
189
c25fe77 @jedi4ever Updated the README
authored
190 IDEAS:
c319d5c @jedi4ever updating documentation for vagrant plugin usage
authored
191
c25fe77 @jedi4ever Updated the README
authored
192 - Now you integrate this with your CI build to create a daily basebox
c1e5d8b @jedi4ever added support for local execution of command via pty command
authored
193
c25fe77 @jedi4ever Updated the README
authored
194 FUTURE IDEAS:
c319d5c @jedi4ever updating documentation for vagrant plugin usage
authored
195
c25fe77 @jedi4ever Updated the README
authored
196 - export to AMI too
197 - provide for more failsafe execution, testing parameters
5552984 @jedi4ever Added idea to do the same for vmware fusion
authored
198 - Do the same for Vmware Fusion
Something went wrong with that request. Please try again.