Skip to content
Newer
Older
100644 224 lines (143 sloc) 7.35 KB
e64bd15 @pjotrp Documentation edits
pjotrp authored
1 # CloudBioLinux, VirtualBox and Vagrant
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
2
3 This document gives some additional information on using Vagrant with BioLinux.
4 [Vagrant][v1] is a convenient command line manager for VirtualBox. In conjunction
5 with the BioLinux fabric environment, any VirtualBox VM can be bootstrapped.
6
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
7 Note the current version of vagrant needs at least VirtualBox version 4.1.x.
8
9 ## VirtualBox with vagrant
10
11 Add a base image to vagrant, and boot it up; community Vagrant boxes are available from
0655c5a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
12 [http://vagrantbox.es][v3] and [BioLinux flavors][v4]:
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
13
14 vagrant box add box_name http://path_to_the_image.box
15 mkdir tmp/biolinux
16 cd tmp/biolinux
17 vagrant init box_name
18 vagrant up
19
20 Run the fabfile, building CloudBioLinux:
21
22 fab -H vagrant -f /path/to/cloudbiolinux/fabfile.py install_biolinux
23
24 Then build the box, renaming package.box to `cloudbiolinux_date` and
25 move it to a public webserver, such as Amazon S3:
26
27 vagrant package
28 mv package.box biolinux_20110122.box
29 s3cmd put --acl-public --guess-mime-type biolinux_20110122.box
30 s3://chapmanb/biolinux_20110122.box
31
32 [v3]: http://vagrantbox.es/
0655c5a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
33 [v4]: http://biobeat.org/bionode
3b6a693 @pjotrp Comments and notes
pjotrp authored
34
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
35 # Rolling your own
36
37 ## Start from a BioLinux box
38
39 See the main README file for firing up a pre-installed BioLinux box.
40
41 ## Start from scratch
42
703d015 @pjotrp doc texts
pjotrp authored
43 Despite the extra work, starting from scratch may have advantages. For
44 one you have more control of the base install. Say for a different
45 version of Linux, a BSD kernel, or for install less software (do you
b6c3dcc @pjotrp Starting on a testing frame work at Pre-BOSC hackaton
pjotrp authored
46 really need X/KDE/Gnome?), so you do not end up with an 8 GB VM, or for more
47 software and/or data pre-intstalled on a VM.
48
9567d32 @pjotrp Ripping out edition support - migrating that to Flavors
pjotrp authored
49 The BioLinux setup is designed to be modular, to support multiple
b6c3dcc @pjotrp Starting on a testing frame work at Pre-BOSC hackaton
pjotrp authored
50 flavors (see the main README for an explanation of terms).
a9224b8 @pjotrp Minimal edition of BioLinux works
pjotrp authored
51
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
52 Start with a standard downloadable prepared Vagrant box. For example a Debian
53 32-bits box prepared for Vagrant, or create one from scratch as is explained on
54 the [Vagrant web site][v1].
55
703d015 @pjotrp doc texts
pjotrp authored
56 Next add the virtualbox to vagrant using a URL, or box file:
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
57
a728685 @pjotrp Vagrant
pjotrp authored
58 vagrant box add debian_squeeze_32 debian_squeeze_32.box
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
59
e4f3349 @pjotrp Flavors available for download
pjotrp authored
60 (boxes are available form [http://vagrantbox.es][v3] and
61 [http://biobeat.org/bionode][BioLinux flavors]) and create your own version
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
62
703d015 @pjotrp doc texts
pjotrp authored
63 mkdir myflavor
64 cd myflavor
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
65
66 Creates a ./Vagrantfile describing the VM.
67
a728685 @pjotrp Vagrant
pjotrp authored
68 vagrant init debian_squeeze_32
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
69
72175c4 @pjotrp %s/install_bare/install_biolinux/g
pjotrp authored
70 Have a look inside the Vagrantfile. The default should be fine now.
71
a728685 @pjotrp Vagrant
pjotrp authored
72 Start the VM (which gets copied the first time, which may take a while):
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
73
a728685 @pjotrp Vagrant
pjotrp authored
74 vagrant up
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
75
76 and login
77
72175c4 @pjotrp %s/install_bare/install_biolinux/g
pjotrp authored
78 vagrant ssh # no password needed
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
79
72175c4 @pjotrp %s/install_bare/install_biolinux/g
pjotrp authored
80 make sure you have enough disk space (twice the box size) for the dir
81 ~/VirtualBox\ VMs and ~/.vagrant, as this is where VMs are copied from the
82 original box file.
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
83
72175c4 @pjotrp %s/install_bare/install_biolinux/g
pjotrp authored
84 At this point a bare VM is running that will accept BioLinux installations. The
85 next step is to pull the BioLinux tree on your local system, and to run fab using the
86 vagrant host, using a minimal install target. E.g.
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
87
a728685 @pjotrp Vagrant
pjotrp authored
88 export source=/path/to/cloudbiolinux
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
89
a9224b8 @pjotrp Minimal edition of BioLinux works
pjotrp authored
90 and
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
91
75ea72d @pjotrp Documentation
pjotrp authored
92 fab -f $source/fabfile.py -H vagrant -c $source/contrib/flavor/minimal/fabricrc_debian.txt install_biolinux:packagelist=$source/contrib/flavor/minimal/main.yaml
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
93
a728685 @pjotrp Vagrant
pjotrp authored
94 which uses the information from the local ./Vagrantfile.
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
95
a728685 @pjotrp Vagrant
pjotrp authored
96 The first time the minimal fabfile is run it updates the /etc/apt/sources (on
97 Debian-based systems), and a number of basic packages, including sudo, python,
98 chef. It may be the Linux kernel and support libraries get upgraded, if they
99 are in the dependency tree. Starting from a minimalistic Debian Vagrant box, the
100 BioLinux minimal install has an unpacked size under 1Gb. E.g.
4e34898 @pjotrp Adding documentation oustide README.md
pjotrp authored
101
a728685 @pjotrp Vagrant
pjotrp authored
102 vagrant@vagrant-debian-squeeze:~$ df -h
103 Filesystem Size Used Avail Use% Mounted on
104 /dev/sda1 39G 804M 36G 3% /
105 tmpfs 188M 0 188M 0% /lib/init/rw
106 udev 184M 116K 184M 1% /dev
107 tmpfs 188M 0 188M 0% /dev/shm
108 v-root 51G 24G 27G 47% /vagrant
109
110 Despite the fact that running fabfile.py is destructive, i.e. it overwrites the
111 current install, it is reasonably safe as it mostly uses the underlying package
112 management system and dependency resolution. Rerunning a BioLinux fabfile can
9567d32 @pjotrp Ripping out edition support - migrating that to Flavors
pjotrp authored
113 be fast. Minimal runs the second time in under 20 seconds on a
6d7463b @pjotrp Documentation on creating and packaging a Vagrant Virtualbox VM
pjotrp authored
114 basic laptop, as we do with a 'Minimal' install:
115
116 ./test/test_vagrant --continue
a728685 @pjotrp Vagrant
pjotrp authored
117
118 For completeness, after a minimal install you can still install a full BioLinux
119 execute
120
d348c25 @pjotrp Adding a full post_install example to a Flavor + documentation
pjotrp authored
121 fab -H vagrant -f $source/fabfile.py install_biolinux
a728685 @pjotrp Vagrant
pjotrp authored
122
6d7463b @pjotrp Documentation on creating and packaging a Vagrant Virtualbox VM
pjotrp authored
123 Once you have a working Virtual Box VM with vagrant, you can package it with
124
125 vagrant package
126
127 and make the resulting .box file available for others to use.
128
a728685 @pjotrp Vagrant
pjotrp authored
129 Read the README for further information.
a9224b8 @pjotrp Minimal edition of BioLinux works
pjotrp authored
130
131 [v1]: http://vagrantup.com/docs/base_boxes.html
a0df489 @pjotrp Vagrant error message
pjotrp authored
132
133 ## Trouble shooting
134
135 ### Guest additions
136
137 You may see an error
138
139 [default] The guest additions on this VM do not match the install version of
140 VirtualBox! This may cause things such as forwarded ports, shared
141 folders, and more to not work properly. If any of those things fail on
142 this machine, please update the guest additions and repackage the
143 box.
144
145 Guest Additions Version: 4.0.4
146 VirtualBox Version: 4.1.0
147
148 this error may actually be caused by the Vbox Linux kernel drivers not having
149 been loaded! Fix
150
151 modprobe vboxdrv
152
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
153 # Converting Vagrant images to VirtualBox and Eucalyptus images
154
155 (protocol steps tested in Ubuntu Natty)
156
157 ## software pre-requisite
158
159 sudo gem install vagrant
160 sudo apt-get install cloud-utils
161
162 ## Importing cloud biolinux VM to your system
163
164 vagrant box add base
165 https://s3.amazonaws.com/cloudbiolinux/cbl_ubuntu_11_4_32_20110628.box
166 vagrant init base
167 vagrant up
168
169 ## adding some missing components to the vagrant VMs
170
171 vagrant ssh
172 sudo apt-get install gdm cloud-utils openssh
173 sudo useradd -d /home/ubuntu -m ubuntusudo passwd ubuntu
174 sudo shutdown -r now
175
176 in the graphical login after reboot get in with user:ubuntu / pass:ubuntu
177 go to System--->Administration--->Login Window to enable autologin
178
e64bd15 @pjotrp Documentation edits
pjotrp authored
179 ## VirtualBox Appliance
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
180
347d586 @pjotrp Doc: Virtual appliance edit
pjotrp authored
181 Virtual Appliances are pre-assemblied VM images configured for various purposes.
182
183 Open the Virtualbox GUI, you should see the VM added by vagrant - you can
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
184 rename it to "Cloud BioLinux 32"
347d586 @pjotrp Doc: Virtual appliance edit
pjotrp authored
185
186 File->Export Appliance
187
188 and distribute the .ova.
189
190 Anyone in any OS running Virtualbox can import the .ova with File->Import
191 Appliance.
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
192
e64bd15 @pjotrp Documentation edits
pjotrp authored
193 # Making a Eucalyptus image from VirtualBox
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
194
e64bd15 @pjotrp Documentation edits
pjotrp authored
195 Start with the Cloud BioLinux Virtualbox .vmdk (its location is in the VM
196 properties from the Virtualbox GUI). Resize the vmdk, since the size may be
197 40G, and the Eucalyptus image will have that size.
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
198
e64bd15 @pjotrp Documentation edits
pjotrp authored
199 Accordint to http://mtnbike.org/blog/?p=29 and the same here:
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
200 http://www.my-guides.net/en/content/view/122/26/
201
e64bd15 @pjotrp Documentation edits
pjotrp authored
202 convert to raw .img
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
203
204 qemu-img convert -O raw CloudBioLinux-32bit-disk1.vmdk
205 CloudBioLinux-32bit-disk1.img
206
e64bd15 @pjotrp Documentation edits
pjotrp authored
207 deploy to Eucalyptus via
3536d8a @chapmanb Reorganize virtualbox documentation; add details from Ntino on Virtua…
authored
208
209 uec-publish-img CloudBioLinux-32bit-disk1.img
a0df489 @pjotrp Vagrant error message
pjotrp authored
210
e64bd15 @pjotrp Documentation edits
pjotrp authored
211 # VirtualBox, KVM or XEN?
212
213 There are more ways than one to virtualize machines on Linux.
214
215 Despite the attractions of vagrant and Virtualbox, as displayed here, we note
216 that Linux KVM may be a better choice for virtualization and testing of
217 CloudBioLinux, as Linux distributions support KVM out of the box, and KVM has
218 more Unix-like control. See also the information for using KVM in
219 ./doc/linux_kvm.md.
220
221 For production environments check out XEN virtualization (XEN runs Amazon EC2).
222
223
Something went wrong with that request. Please try again.