3 # ensure environment is ready
4 echo 'checking environment'
5 cd '/cygdrive/c/Documents and Settings/'
7 mkdir 'VirtualBox VMs' &> /dev/null
9 if [ "$?" != "0" ]; then
10 echo "failed to setup user's \"VirtualBox VMs\" folder"
15 # get recent initial VM and create disk image
16 echo 'download initial OpenSecurity VM'
17 cd "/cygdrive/c/Documents\ and\ Settings/${USER}/VirtualBox\ VMs/"
18 #wget http://service.x-net.at/opensecurity/OsecVM_initialized.ova
19 VBoxManage.exe import OsecVM_initialized.ova --vsys 0 --vmname SecurityDVM --unit 12 --disk SecurityDVM.vmdk
21 # launch the SecurityVM the first time to let the user do initial updates
22 VBoxManage.exe startvm SecurityDVM
25 # Start VirtualBox and update the machine
31 # issue these commands as root
35 # # apt-get dist-upgrade
37 # then shutdown the machine with
41 # press a key when done to proceed
45 # Turn the VM disk image immutable and attach it
46 VBoxManage.exe storageattach SecurityDVM --storagectl SATA --port 0 --medium none
47 VBoxManage.exe modifyhd SecurityDVM.vmdk settype immutable
48 VBoxManage.exe storageattach SecurityDVM --storagectl SATA --port 0 --device 0 --type hdd --mtype normal --medium SecurityDVM.vmdk