OpenSecurity/install/initial_vm.bat
author dyle@opensecurity.d03.arc.local
Mon, 27 Jan 2014 15:12:33 +0000
changeset 52 1238895dc6b6
parent 51 9e8fffdb8f47
child 62 eab1e343a004
child 65 7877250bcf6f
permissions -rw-r--r--
working on installment and console-less
     1 @echo off
     2 
     3 rem ensure environment is ready
     4 
     5 rem This gets up VirtualBox VBoxSVC.exe COM Server right
     6 rem and thus helps us not to run in any timing problems
     7 rem due to a lazy VBox COM Server ... o.O
     8 VBoxManage list vms > %TEMP%\VMS.txt
     9 del %TEMP%\VMS.txt
    10 
    11 rem Now, VBox should feel good within the Windows OS space
    12 rem switch into the User's VBox setup folders
    13 C:
    14 cd "C:\Users\%USERNAME%
    15 mkdir "VirtualBox VMs"
    16 cd "VirtualBox VMs"
    17 
    18 rem get recent initial VM and create disk image
    19 echo "download initial OpenSecurity VM"
    20 rem wget http://service.x-net.at/opensecurity/OsecVM_initialized.ova
    21 
    22 rem I've already downloaded ... this is for convenience --> delete this line
    23 rem This is just for testing. Enbale the real "wget http://service...." line above
    24 rem to get the real VM image from X-Net
    25 copy C:\Users\dyle\Documents\OpenSecurity\setup\OsecVM_initialized.ova .
    26 
    27 rem import the VM
    28 VBoxManage.exe import OsecVM_initialized.ova --vsys 0 --vmname SecurityDVM --unit 12 --disk SecurityDVM\SecurityDVM.vmdk
    29 
    30 rem launch the SecurityVM the first time to let the user do initial updates
    31 VBoxManage.exe startvm SecurityDVM
    32 
    33 echo # Start VirtualBox and update the machine	
    34 echo #                                         
    35 echo # login with                              
    36 echo #   user: root                            
    37 echo #   pass: osecvm                          
    38 echo #                                         
    39 echo # issue these commands as root            
    40 echo #                                         
    41 echo #       # apt-get update                  
    42 echo #       # apt-get upgrade                 
    43 echo #       # apt-get dist-upgrade            
    44 echo #                                         
    45 echo # then shutdown the machine with          
    46 echo #                                         
    47 echo #       # shutdown -h now                 
    48 echo #                                         
    49 echo # press a key when done to proceed        
    50 pause
    51 
    52 rem Turn the VM disk image immutable and attach it
    53 echo sealing disk image ...
    54 VBoxManage.exe storageattach SecurityDVM --storagectl SATA --port 0 --medium none
    55 VBoxManage.exe modifyhd SecurityDVM\SecurityDVM.vmdk --type immutable
    56 VBoxManage.exe storageattach SecurityDVM --storagectl SATA --port 0 --device 0 --type hdd --mtype normal --medium SecurityDVM\SecurityDVM.vmdk
    57 echo done. OpenSecurity is ready to serve
    58