1 | | = Deploying VM Guests within BOINC = |
| 1 | = Deploying VM Applications = |
| 2 | |
| 3 | == Introduction == |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | == Appendix == |
| 10 | |
| 11 | === Premade BOINC Wrapper === |
| 12 | |
| 13 | Configuration Options for vboxwrapper can be found [VboxApps here]. |
| 14 | |
| 15 | ==== Windows ==== |
| 16 | |
| 17 | ==== Linux ==== |
| 18 | |
| 19 | |
| 20 | === Premade Linux Images === |
| 21 | |
| 22 | x86: [http://boinc.berkeley.edu/dl/vmimagex86.vdi.gz vmimagex86.vdi.gz] |
| 23 | |
| 24 | x64: [http://boinc.berkeley.edu/dl/vmimagex64.vdi.gz vmimagex64.vdi.gz] |
| 25 | |
| 26 | === Hand-build VM Image === |
| 27 | |
| 28 | The easiest way to begin putting together a Linux VM is to install the network install of Debian within the VM. You can find the netinst images [http://www.debian.org/distrib/netinst here]. |
| 29 | |
| 30 | Main advantages: |
| 31 | * Small install size |
| 32 | * Virtualbox guest additions installed by default |
| 33 | |
| 34 | The Virtualbox guest extensions are required in order to use the shared directory feature to communicate between the guest and host operating systems. |
| 35 | |
| 36 | ==== Role Selection ==== |
| 37 | |
| 38 | During install you'll be asked what role should this linux machine be configured for, make sure all roles are unselected before continuing. |
| 39 | |
| 40 | ==== Updating Grub ==== |
| 41 | |
| 42 | If you want to speed up the boot process you should change the default timeout for grub by modifing /etc/default/grub: |
| 43 | {{{ |
| 44 | GRUB_TIMEOUT = 0 |
| 45 | }}} |
| 46 | |
| 47 | After saving the update run: |
| 48 | {{{ |
| 49 | root@boinc-vm-image:/etc/default# update-grub |
| 50 | }}} |
| 51 | |
| 52 | ==== Updating Inittab ==== |
| 53 | |
| 54 | To configure Linux for automaic login you'll need to install a different terminal handler, mingetty seems to work pretty well for our purposes. |
| 55 | |
| 56 | You'll need to install mingetty: |
| 57 | {{{ |
| 58 | root@boinc-vm-image:/etc/default# apt-get install mingetty |
| 59 | }}} |
| 60 | |
| 61 | Next you'll need to change the terminal handler assigned to the first virtual terminal, change line: |
| 62 | {{{ |
| 63 | 1:2345:respawn:/sbin/getty 38400 tty1 |
| 64 | }}} |
| 65 | |
| 66 | To: |
| 67 | {{{ |
| 68 | 1:2345:respawn:/sbin/mingetty --autologin root --noclear tty1 |
| 69 | }}} |
| 70 | |
| 71 | ==== Updating .bashrc ==== |
| 72 | |
| 73 | Adding the following to the end of the .bashrc file for root: |
| 74 | {{{ |
| 75 | # BOINC VM Initialization |
| 76 | echo BOINC VM Initialization [Sleeping 10 seconds] |
| 77 | sleep 5 |
| 78 | }}} |
| 79 | |
| 80 | The basic gist here is to give yourself time to break into a console session via CTRL-C to be able to make changes to the VM in the future. After executing any job you want the VM to accomplish you'll need to shutdown the VM. If you encounter an error shutdown the VM. |
| 81 | |
| 82 | ==== Shared Directory Usage ==== |
| 83 | |
| 84 | Adding the following to the end of the .bashrc file for root: |
| 85 | {{{ |
| 86 | echo -- Mounting shared directory |
| 87 | mount -t vboxsf shared /root/shared |
| 88 | if [ $? -ne 0 ]; then |
| 89 | echo ---- Failed to mount shared directory |
| 90 | sleep 5 |
| 91 | shutdown -hP 0 |
| 92 | fi |
| 93 | |
| 94 | echo -- Launching boinc_start.sh script |
| 95 | if [ -f ~/shared/boinc_start.sh ]; then |
| 96 | cd ~/shared |
| 97 | bash ./boinc_start.sh |
| 98 | else |
| 99 | echo ---- Failed to launch script |
| 100 | sleep 5 |
| 101 | shutdown -hP 0 |
| 102 | fi |
| 103 | }}} |
| 104 | |
| 105 | Be sure to create a directory called 'shared' in root's home directory. |
| 106 | |
| 107 | The 'boinc_start.sh' script should contain whatever is needed to execute your job from within the VM. |
| 108 | |