From 31c480b435ce18a4736520229cd67a635308c68a Mon Sep 17 00:00:00 2001 From: James Barnett Date: Tue, 6 Dec 2016 11:59:09 -0600 Subject: [PATCH] Update build scripts for newly released versions of VirtualBox and Vagrant --- build_win2008.ps1 | 8 ++++---- build_win2008.sh | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/build_win2008.ps1 b/build_win2008.ps1 index d29d6d0..b3d3004 100644 --- a/build_win2008.ps1 +++ b/build_win2008.ps1 @@ -1,8 +1,8 @@ $ErrorActionPreference = "Stop" -$virtualBoxMinVersion = "5.1.6" +$virtualBoxMinVersion = "5.1.10" $packerMinVersion = "0.10.0" -$vagrantMinVersion = "1.8.6" +$vagrantMinVersion = "1.9.0" $vagrantreloadMinVersion = "0.0.1" function CompareVersions ($actualVersion, $expectedVersion, $exactMatch = $False) { @@ -34,10 +34,10 @@ If ($(Test-Path "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe") -eq $True) $vboxVersion = $vboxVersion.split("r")[0] } -If (CompareVersions -actualVersion $vboxVersion -expectedVersion $virtualBoxMinVersion --exactMatch $True) { +If (CompareVersions -actualVersion $vboxVersion -expectedVersion $virtualBoxMinVersion --exactMatch $False) { Write-Host "Compatible version of VirtualBox found." } else { - Write-Host "Could not find a compatible version of VirtualBox at C:\Program Files\Oracle\VirtualBox\. Currently only 5.1.6 is supported. Please download and install it from https://www.virtualbox.org/wiki/Download_Old_Builds_5_1." + Write-Host "Could not find a compatible version of VirtualBox at C:\Program Files\Oracle\VirtualBox\. Please download and install it from https://www.virtualbox.org/" exit } diff --git a/build_win2008.sh b/build_win2008.sh index 987a38f..8925909 100755 --- a/build_win2008.sh +++ b/build_win2008.sh @@ -1,10 +1,10 @@ #!/bin/bash -min_vbox_ver="5.1.6" -min_vagrant_ver="1.8.6" +min_vbox_ver="5.1.10" +min_vagrant_ver="1.9.0" min_packer_ver="0.10.0" min_vagrantreload_ver="0.0.1" -packer_bin="packer-io" +packer_bin="packer" function compare_versions { actual_version=$1 @@ -35,17 +35,22 @@ function compare_versions { return 0 } +# Conditional for platform specific version checks. Some of these might seem redundant since +# there might not be anything actively broken in the dependent software. Keeping it around as +# version upgrades could break things on specific platforms. if [ $(uname) = "Darwin" ]; then - packer_bin="packer" - vagrant_exact_match=true # Boxes fail to add in Vagrant 1.8.7 on OSX - https://github.com/mitchellh/vagrant/issues/8002 + vagrant_exact_match=false elif [ $(uname) = "Linux" ]; then vagrant_exact_match=false + if cat /etc/*-release | grep -q 'DISTRIB_ID=Arch'; then + packer_bin="packer-io" + fi fi -if compare_versions $(VBoxManage -v | sed -e 's/r.*//g' -e 's/_.*//g') $min_vbox_ver true; then +if compare_versions $(VBoxManage -v | sed -e 's/r.*//g' -e 's/_.*//g') $min_vbox_ver false; then echo "Compatible version of VirtualBox found." else - echo "A compatible version of VirtualBox was not found. Currently only $min_vbox_ver is supported. Please download and install it from https://www.virtualbox.org/wiki/Download_Old_Builds_5_1." + echo "A compatible version of VirtualBox was not found. Please download and install it from https://www.virtualbox.org/" exit 1 fi @@ -109,5 +114,6 @@ else fi fi +echo "---------------------------------------------------------------------" echo "SUCCESS: Run 'vagrant up' to provision and start metasploitable3." echo "NOTE: The VM will need Internet access to provision properly."