| | 1 | = Running apps in VirtualBox virtual machines = |
| | 2 | |
| | 3 | BOINC's '''vboxwrapper''' program lets you run applications in virtual machines. |
| | 4 | This eliminates the need to build app versions for different architectures, |
| | 5 | and provides a stronger security sandbox than is otherwise available. |
| | 6 | |
| | 7 | To do this, create an application version of plan class "vbox" containing the following files: |
| | 8 | |
| | 9 | * The VM image (VirtualBox format). |
| | 10 | Must have the '''copy_file''' attribute. |
| | 11 | * An XML job description file (see below) |
| | 12 | * '''vboxwrapper''', compiled for the platform |
| | 13 | |
| | 14 | == Job description file == |
| | 15 | |
| | 16 | '''vboxwrapper''' takes an input file '''vbox_job.xml''' with the following structure: |
| | 17 | |
| | 18 | {{{ |
| | 19 | <vbox_job_desc> |
| | 20 | <os_name>name</os_name> |
| | 21 | <memory_size>N</memory_size> |
| | 22 | <image_filename>name</image_filename> |
| | 23 | [ <enable_network_access/> ] |
| | 24 | [ <enable_shared_directory/> ] |
| | 25 | </vbox_job_desc> |
| | 26 | }}} |
| | 27 | |
| | 28 | The elements are: |
| | 29 | |
| | 30 | '''os_name''':: the name of the guest OS, e.g. "Ubuntu" or "Linux 2.6". |
| | 31 | Rom: please check what the choices are, and whether this matters. |
| | 32 | |
| | 33 | '''memory_size''':: the amount of physical memory allocated to the VM. |
| | 34 | |
| | 35 | '''image_filename''':: the physical name of the VM image file. |
| | 36 | |
| | 37 | '''enable_network_access''':: if present, allow application in the VM to do network access |
| | 38 | |
| | 39 | '''enabled_shared_directory''':: if present, use a directory that is shared between the host OS and the guest OS. Must be set if your application has input or output files. |
| | 40 | |
| | 41 | == Input and output files == |
| | 42 | |
| | 43 | All input and output files |
| | 44 | |
| | 45 | * Must have logical names of the form '''shared/filename'''. |
| | 46 | * Must have the '''copy_file''' attribute. |
| | 47 | |
| | 48 | == Requirements of the VM == |
| | 49 | |
| | 50 | The VM image, when booted, must run the application. |
| | 51 | This is typically done using a script in /etc. |
| | 52 | |
| | 53 | When the application is finished, it must shut down the VM |
| | 54 | (e.g., by running '''shutdown''' on Linux). |
| | 55 | |
| | 56 | If the applications has input or output files, |
| | 57 | the VM must contain the VirtualBox "guest additions", |
| | 58 | and it must map the shared directory using |
| | 59 | |
| | 60 | {{{ |
| | 61 | vboxmap shared path |
| | 62 | }}} |
| | 63 | where "path" is the path where the shared directory is to be mounted. |
| | 64 | Typically it will then cd into that directory |
| | 65 | to run the application. |