diff --git a/build-vm/boot.sh b/build-vm/boot.sh old mode 100644 new mode 100755 diff --git a/build-vm/build.sh b/build-vm/build.sh index f413880..813df9c 100755 --- a/build-vm/build.sh +++ b/build-vm/build.sh @@ -1,11 +1,14 @@ #!/bin/bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + echo "Building Virtual Machine for Avans Security Workshop..." +echo "(Requires vmbuilder, install with: 'sudo apt-get install python-vm-builder')" sudo vmbuilder vmw6 ubuntu --flavour virtual --arch i386 -o \ - --firstboot boot.sh \ + --firstboot $DIR/firstboot.sh \ --user security --pass security --name "Security Workshop" \ - --addpkg apache2 --addpkg apache2-mpm-prefork --addpkg phpmyadmin \ + --addpkg apache2 --addpkg apache2-mpm-prefork \ --addpkg git-core \ --addpkg php5-cli --addpkg php5-mysql --addpkg libapache2-mod-php5 \ --addpkg mysql-server --addpkg mysql-client diff --git a/build-vm/firstboot.sh b/build-vm/firstboot.sh new file mode 100755 index 0000000..c0d242e --- /dev/null +++ b/build-vm/firstboot.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# This script is run the first time the VM boots up. +# It configures the VM for the security workshop +DIR=/home/security/workshop +echo "Initializing this VM for the Security Workshop..." + +# Get the workshop files +git clone https://github.com/Avans/Security-Workshop.git $DIR + +# Add boot.sh to the boot sequence +echo "$DIR/build-vm/boot.sh" >> /etc/rc.local + +# Resume normal boot sequence +$DIR/build-vm/boot.sh