Changes between Version 21 and Version 22 of VboxApps


Ignore:
Timestamp:
Oct 4, 2011, 2:10:54 PM (13 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • VboxApps

    v21 v22  
    33= Running apps in VirtualBox virtual machines =
    44
    5 BOINC's '''vboxwrapper''' program lets you run applications in VirtualBox virtual machines.
    6 This eliminates the need to build app versions for different architectures,
    7 and provides a stronger security sandbox than is otherwise available.
    8 
    9 NOTE: Do not use software which uses a license that has a pay-per-use clause.
     5== Introduction ==
     6
     7BOINC supports applications that run in !VirtualBox virtual machines.
     8This provides two benefits:
     9 * You don't need to build app versions for different architectures.
     10   You develop your app in your environment of choice (say, Scientific Linux),
     11   and then bundle the resulting executable together with
     12   a virtual machine image containing the appropriate runtime environment.
     13   The application can then be run on all platforms
     14   (Windows, Mac OS X, all versions of Linux)
     15   with no additional work on your part.
     16 * Virtual machines provide the strongest available security sandbox;
     17   a program running in a virtual machine cannot access or modify
     18   the host system.
     19   This makes it feasible to deploy untrusted applications.
     20
     21BOINC's support for VM apps is based on a program called
     22'''vboxwrapper''' that interfaces between
     23the BOINC client and the !VirtualBox system.
     24
     25=== Licensing issues ===
     26
     27Commercial operating systems like Windows and Mac OS X
     28have a license with a pay-per-use clause,
     29so in general you can't use them in the VM image.
     30Similarly, you can't include pay-per-use software such as Matlab
     31in the VM image.
     32
     33=== 32/64 bit issues ===
     34
     35A VM image is called 32- or 64-bit depending on the operating system it contains.
     36The BOINC host population includes 32-bit and 64-bit hosts.
     3764-bit hosts can run 32-bit VMs, but not conversely.
     38You can choose to provide 32- or 64-bit VM images, or both.
     39
     40Possible reasons for using 64-bit VM images:
     41 * The 64-bit version of your app runs significantly faster than the 32-bit version.
     42 * Your app uses more than 3 GB of virtual address space.
     43
     44If you provide only 32-bit VM images,
     45you must still create separate 32- and 64-bit app versions,
     46using the same VM image but different '''vboxwrapper''' executables.
     47('''vboxwrapper''' is a C++ program and has different executables
     48for each platform, include 32- and 64-bit; these are available below.
     49The 32-bit vboxwrapper will generally not work on a 64-bit machine).
     50
     51=== Non-Intel and GPU applications ===
     52
     53!VirtualBox runs only on Intel-compatible processors.
     54If you want to support other processors,
     55you'll need to use non-VM-based app versions.
     56
     57Currently you can't run GPU applications in !VirtualBox VMs.
     58This may change in the future.
    1059
    1160== Creating app versions ==
    1261
    1362You must create app versions for each platform you want to support;
    14 the app versions differ only in one file.
     63the app versions differ in which '''vboxwrapper''' executable they use.
     64If you use both 32- and 64-bit VMs,
     65the versions will also differ in the VM image and the application executable.
    1566
    1667The application versions for a given platform are of plan class "vbox32"
     
    1869and include the following files:
    1970
    20  * The VM image, in VirtualBox format.
     71 * The VM image, in !VirtualBox format.
    2172  * Must have the '''copy_file''' attribute.
    2273  * Must have logical name "vm_image.vdi".
    2374 * The application executable to be run in the VM image.
    24   The logical name must be '''shared/boinc_app'''.
     75  * This may be a shell script or a binary program.
     76  * The logical name must be '''shared/boinc_app'''.
    2577 * Other files needed by the application, all with logical names starting with '''shared/'''.
    26  * An XML job description file with logical name '''vbox_job.xml''' (see below)
    27  * '''vboxwrapper''', compiled for the platform.
     78 * An XML '''job description file''' with logical name '''vbox_job.xml''' (see below)
     79 * '''vboxwrapper''', compiled for the platform (executables are available below).
    2880 * All scripts and executables must have the execute permission set.
    29   These executables can be downloaded from the BOINC site (see below).
    30 
    31 Include '''<dont_throttle/>''' in the version.xml file; VirtualBox does its own CPU throttling.
     81
     82Include '''<dont_throttle/>''' in the version.xml file; !VirtualBox does its own CPU throttling.
    3283
    3384Typically you can use the same VM image for multiple applications.
    3485This reduces network traffic and client disk usage.
    35 
    36 The bitness of the vboxwrapper and VM image must match the plan class.
    37 A 32-bit wrapper cannot use VirtualBox on a 64-bit machine.
    3886
    3987=== The job description file ===
     
    53101The elements are:
    54102
    55  '''os_name''':: the name of the guest OS as defined by VirtualBox, e.g. "Linux26", "Linux26_64", "Linux24", etc.[[BR]]
    56    To see a list of available os_names, type "vboxmanage list ostypes" at a shell prompt
     103 '''os_name''':: the name of the guest OS as defined by !VirtualBox,
     104   e.g. "Linux26", "Linux26_64", "Linux24", etc.
     105   To see a list of all available OS names, install !VirtualBox on a Linux system,
     106   and type "vboxmanage list ostypes".
    57107
    58108 '''memory_size_mb''':: the amount of physical memory allocated to the VM, in megabytes.
     
    74124}}}
    75125 where "/root/shared" is the path where the shared directory is to be mounted.
    76  In this case the VM must contain the VirtualBox "guest additions". Guest additions
    77  are required for shared folders to work or any special features of the virtualized
    78  hardware.
     126 In this case the VM must contain the !VirtualBox "guest additions".
     127 Guest additions are required for shared folders to work.
    79128
    80129 * Run the application.
     
    91140Using this script,
    92141your application executable must have logical name '''share/boinc_app'''.
    93 It may be a compiled program or a script that runs other programs.
    94142
    95143Doing things this way, the VM image is independent of the application.
     
    101149
    102150 * Have logical names starting with '''shared/'''.
    103  * Have the '''copy_file''' attribute
     151 * Have the '''copy_file''' attribute.
    104152
    105153This causes the BOINC client to copy them to and from the '''slot/x/shared/''' directory.
     
    130178
    131179The example startup script follows.
    132 You can deploy it by appending to '''/root/.bashrc'''.
     180You can deploy it by appending to '''/root/.bashrc''' in the VM image.
    133181{{{
    134182echo --- BOINC VM starting
     
    162210== Creating VM images ==
    163211
    164 The easiest way to make a Linux VM is to install the network install of Debian within the VM.
     212The VM image that you distribute need contain only the
     213runtime environment for your applications.
     214In particular, it need not contain:
     215
     216 * Development tools such as gcc
     217 * GUI software such as X11, gtk etc.
     218
     219Reducing the VM image size reduces the network load
     220on your server and on volunteer hosts, and the disk usage on volunteer hosts.
     221
     222The easiest way to make a "small" Linux VM is to install the network install of Debian within the VM.
    165223You can find the netinst images [http://www.debian.org/distrib/netinst here].
    166 
    167 Advantages:
    168  * Small install size
    169  * !VirtualBox guest additions installed by default
     224Such VMs have !VirtualBox and guest additions installed by default.
     225
     226'''NOTE: 32- and 64-bit VM images created in this way,
     227and containing all the changes described below,
     228are available (see links below).
     229If you use these VM images, you can skip the rest of this section.'''
    170230
    171231=== Role Selection ===
     
    209269}}}
    210270
    211 == Precompiled vboxwrapper ==
    212 === Windows ===
     271== Premade vboxwrapper executables ==
     272
     273Windows:
    213274x86: [http://boinc.berkeley.edu/dl/vboxwrapper_6.20_windows_intelx86.exe.gz vboxwrapper_6.20_windows_intelx86.exe.gz]
    214275
    215276x64: [http://boinc.berkeley.edu/dl/vboxwrapper_6.20_windows_x86_64.exe.gz vboxwrapper_6.20_windows_x86_64.exe.gz]
    216277
    217 === Mac ===
    218 TBD
    219 === Linux ===
    220 TBD
     278Mac OS X:
     279
     280Linux:
    221281
    222282== Premade Linux VM Images ==
    223283
    224 These VM images were built using the instructions for creating vm images and the example startup script.
    225 
    226 Baseline image: Debian 4.0, without GCC or any build tools installed.
     284These VM images were built using the above instructions for creating VM images.
     285They contain Debian 4.0, without GCC or any build tools installed.
     286They contain the example startup script.
     287
     288In most cases, you can use these VM images with no modifications.
    227289
    228290x86: [http://boinc.berkeley.edu/dl/vmimage_x86.zip vmimage_x86.zip]