With @dancarley and @patrickebois just discussing the origin of the name of Veewee I figured I still had that piece of documentation I wrote up for myselve flying around ...
So with no other reason than having my docs mirrored on the internet .
shows you what templates we have around ..
$veewee init natty ubuntu-11.04-server-amd64
Init a new box natty, starting from template ubuntu-11.04-server-amd64
The basebox 'natty' has been successfully created from the template ''ubuntu-11.04-server-amd64'
You can now edit the definition files stored in definitions/natty
or build the box with:
vagrant basebox build 'natty'
As noted this will generate the definition for your natty box,
It will create a definition.rb file which describes your box.
A preseed (or kickstart or similar file) and a postinstall file
The next step is then to use vagrant to build this basebox
$ vagrant basebox build natty
Verifying the isofile ubuntu-11.04-server-amd64.iso is ok.
Creating vm natty : 384M - 1 CPU - Ubuntu_64
Creating new harddrive of size 10140
VBoxManage createhd --filename '/home/sdog/VirtualBox VMs/natty/natty.vdi' --size '10140' --format vdi > /dev/null
Attaching disk: /home/sdog/VirtualBox VMs/natty/natty.vdi
Mounting cdrom: /home/sdog/iso/ubuntu-11.04-server-amd64.iso
Waiting for the machine to boot
Typing:[1]: <Esc><Esc><Enter>
Typing:[2]: /install/vmlinuz noapic preseed/url=http://192.168.10.101:7122/preseed.cfg
Typing:[3]: debian-installer=en_US auto locale=en_US kbd-chooser/method=us
Typing:[4]: hostname=natty
Typing:[5]: fb=false debconf/frontend=noninteractive
Typing:[6]: keyboard-configuration/layout=USA keyboard-configuration/variant=USA console-setup/ask_detect=false
Typing:[7]: initrd=/install/initrd.gz -- <Enter>
Done typing.
Starting a webserver on port 7122
Serving file /home/sdog/definitions/natty/preseed.cfg
Waiting for ssh login with user vagrant to sshd on port => 7222 to work
.....................................................................................................................................................Transferring /tmp/vbox.version20110822-6766-1xcca1e-0 to .vbox_version
..
Step [0] was successfully - saving state
Waiting for ssh login with user vagrant to sshd on port => 7222 to work
.Transferring /home/sdog/definitions/natty/postinstall.sh to postinstall.sh
Plenty more output here !
Be very patient .. you will see VirtualBox launch a VM and start installing it ..
The next steps are clear .. vagrant tells you what you can do next
Now you can:
- verify your box by running : vagrant basebox validate natty
- export your vm to a .box file by running : vagrant basebox export natty
So after validating it , you can now export the basebox and share it with other people.
The next step is to actually use that box in your own Vagrant setup, for that you need to import the box into your box collection
$ vagrant box add 'natty' 'natty.box'
[vagrant] Downloading with Vagrant::Downloaders::File...
[vagrant] Copying box to temporary location...
[vagrant] Extracting box...
[vagrant] Verifying box...
[vagrant] Cleaning up downloaded box...
To verify just run
$ vagrant box list
Centos6
MyCentOS2
debian
natty
your freslhy imported box should be in the list .
You can now use
to refer to the fresly imported box in your Vagrant file, a file that can be created by running vagrant init, or copying around another Vagrant template ..
After that .. regular vagrant fun starts, up, provision, provision, provision, destroy, and so forth ..