140 | | == Requirements of the VM == |
| 140 | == Creating jobs for VM apps == |
| 141 | |
| 142 | The input and output files of a VM app must |
| 143 | |
| 144 | * Have logical names starting with '''shared/'''. |
| 145 | * Have the '''copy_file''' attribute. |
| 146 | |
| 147 | This causes the BOINC client to copy them to and from the '''slot/x/shared/''' directory. |
| 148 | |
| 149 | == Premade vboxwrapper executables == |
| 150 | |
| 151 | Windows: |
| 152 | |
| 153 | x86: [http://boinc.berkeley.edu/dl/vboxwrapper_24259_windows_intelx86.zip vboxwrapper_24259_windows_intelx86.zip] |
| 154 | |
| 155 | x64: [http://boinc.berkeley.edu/dl/vboxwrapper_24259_windows_x86_64.zip vboxwrapper_24259_windows_x86_64.zip] |
| 156 | |
| 157 | Mac OS X: |
| 158 | |
| 159 | Linux: |
| 160 | |
| 161 | x86: [http://boinc.berkeley.edu/dl/vboxwrapper_24259_i686-pc-linux-gnu.zip vboxwrapper_24259_i686-pc-linux-gnu.zip] |
| 162 | |
| 163 | x64: [http://boinc.berkeley.edu/dl/vboxwrapper_24259_x86_64-pc-linux-gnu.zip vboxwrapper_24259_x86_64-pc-linux-gnu.zip] |
| 164 | |
| 165 | == Premade Linux VM Images == |
| 166 | |
| 167 | These VM images were built using the above instructions for creating VM images. |
| 168 | They contain Debian 4.0, without GCC or any build tools installed. |
| 169 | They contain the example startup script. |
| 170 | |
| 171 | x86: [http://boinc.berkeley.edu/dl/vmimage_debian40_x86.zip vmimage_debian40_x86.zip] |
| 172 | |
| 173 | x64: [http://boinc.berkeley.edu/dl/vmimage_debian40_x64.zip vmimage_debian40_x64.zip] |
| 174 | |
| 175 | In most cases, you can use these VM images with no modifications. |
| 176 | If your application uses libraries not on the VM images, |
| 177 | you can add them as follows: |
| 178 | |
| 179 | * Run !VirtualBox, and open the VM image |
| 180 | * Hit CTRL-C when see "BOINC VM starting" in the console window |
| 181 | * Install whatever you want (can use '''apt-get install''' to |
| 182 | install Debian packages). |
| 183 | * when you're done, type |
| 184 | {{{ |
| 185 | shutdown -hP 0 |
| 186 | }}} |
| 187 | |
| 188 | The VM image now has the additional libraries. |
| 189 | Rename it to avoid confusion with the original version. |
| 190 | |
| 191 | == Creating your own VM images == |
| 192 | === Requirements of the VM === |
170 | | == Creating jobs for VM apps == |
171 | | |
172 | | The input and output files of a VM app must |
173 | | |
174 | | * Have logical names starting with '''shared/'''. |
175 | | * Have the '''copy_file''' attribute. |
176 | | |
177 | | This causes the BOINC client to copy them to and from the '''slot/x/shared/''' directory. |
178 | | |
179 | | == How it works: example == |
| 222 | |
| 223 | |
| 224 | === Example startup script === |
| 225 | |
| 226 | The example startup script follows. |
| 227 | You can deploy it by appending to '''/root/.bashrc''' in the VM image. |
| 228 | {{{ |
| 229 | echo --- BOINC VM starting |
| 230 | sleep 5 |
| 231 | }}} |
| 232 | |
| 233 | The "sleep 5" gives you time to break into a console session via CTRL-C |
| 234 | if you need to make changes to the VM in the future. |
| 235 | |
| 236 | {{{ |
| 237 | echo --- Mounting shared directory |
| 238 | mount -t vboxsf shared /root/shared |
| 239 | if [ $? -ne 0 ]; then |
| 240 | echo --- Failed to mount shared directory |
| 241 | sleep 5 |
| 242 | shutdown -hP 0 |
| 243 | fi |
| 244 | |
| 245 | echo -- Launching boinc_app |
| 246 | if [ -f /root/shared/boinc_app ]; then |
| 247 | cd /root/shared |
| 248 | ./boinc_app |
| 249 | shutdown -hP 0 |
| 250 | else |
| 251 | echo --- Failed to launch script |
| 252 | sleep 5 |
| 253 | fi |
| 254 | shutdown -hP 0 |
| 255 | }}} |
| 256 | |
| 257 | === How it works === |
201 | | == Example startup script == |
202 | | |
203 | | The example startup script follows. |
204 | | You can deploy it by appending to '''/root/.bashrc''' in the VM image. |
205 | | {{{ |
206 | | echo --- BOINC VM starting |
207 | | sleep 5 |
208 | | }}} |
209 | | |
210 | | The "sleep 5" gives you time to break into a console session via CTRL-C |
211 | | if you need to make changes to the VM in the future. |
212 | | |
213 | | {{{ |
214 | | echo --- Mounting shared directory |
215 | | mount -t vboxsf shared /root/shared |
216 | | if [ $? -ne 0 ]; then |
217 | | echo --- Failed to mount shared directory |
218 | | sleep 5 |
219 | | shutdown -hP 0 |
220 | | fi |
221 | | |
222 | | echo -- Launching boinc_app |
223 | | if [ -f /root/shared/boinc_app ]; then |
224 | | cd /root/shared |
225 | | ./boinc_app |
226 | | shutdown -hP 0 |
227 | | else |
228 | | echo --- Failed to launch script |
229 | | sleep 5 |
230 | | fi |
231 | | shutdown -hP 0 |
232 | | }}} |
233 | | |
234 | | == Creating VM images == |
| 279 | === Creating base VM images === |
296 | | == Premade vboxwrapper executables == |
297 | | |
298 | | Windows: |
299 | | |
300 | | x86: [http://boinc.berkeley.edu/dl/vboxwrapper_24259_windows_intelx86.zip vboxwrapper_24259_windows_intelx86.zip] |
301 | | |
302 | | x64: [http://boinc.berkeley.edu/dl/vboxwrapper_24259_windows_x86_64.zip vboxwrapper_24259_windows_x86_64.zip] |
303 | | |
304 | | Mac OS X: |
305 | | |
306 | | Linux: |
307 | | |
308 | | x86: [http://boinc.berkeley.edu/dl/vboxwrapper_24259_i686-pc-linux-gnu.zip vboxwrapper_24259_i686-pc-linux-gnu.zip] |
309 | | |
310 | | x64: [http://boinc.berkeley.edu/dl/vboxwrapper_24259_x86_64-pc-linux-gnu.zip vboxwrapper_24259_x86_64-pc-linux-gnu.zip] |
311 | | |
312 | | == Premade Linux VM Images == |
313 | | |
314 | | These VM images were built using the above instructions for creating VM images. |
315 | | They contain Debian 4.0, without GCC or any build tools installed. |
316 | | They contain the example startup script. |
317 | | |
318 | | x86: [http://boinc.berkeley.edu/dl/vmimage_debian40_x86.zip vmimage_debian40_x86.zip] |
319 | | |
320 | | x64: [http://boinc.berkeley.edu/dl/vmimage_debian40_x64.zip vmimage_debian40_x64.zip] |
321 | | |
322 | | In most cases, you can use these VM images with no modifications. |
323 | | If your application uses libraries not on the VM images, |
324 | | you can add them as follows: |
325 | | |
326 | | * Run !VirtualBox, and open the VM image |
327 | | * Hit CTRL-C when see "BOINC VM starting" in the console window |
328 | | * Install whatever you want (can use '''apt-get install''' to |
329 | | install Debian packages). |
330 | | * when you're done, type |
331 | | {{{ |
332 | | shutdown -hP 0 |
333 | | }}} |
334 | | |
335 | | The VM image now has the additional libraries. |
336 | | Rename it to avoid confusion with the original version. |