Skip to content

Commit

Permalink
Update build scripts and README to indicate VirtualBox 5.1.6 is requi…
Browse files Browse the repository at this point in the history
…red and 5.1.8 does not work due to rapid7#41
  • Loading branch information
usmcfiredog committed Nov 10, 2016
1 parent 5e028c8 commit 5286026
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ Requirements:
* [Packer](https://www.packer.io/intro/getting-started/setup.html)
* [Vagrant](https://www.vagrantup.com/docs/installation/)
* [Vagrant Reload Plugin](https://github.com/aidanns/vagrant-reload#installation)
* [VirtualBox](https://www.virtualbox.org/wiki/Downloads)
* [VirtualBox 5.1.6](https://www.virtualbox.org/wiki/Downloads)
* Internet connection

NOTE: A bug was recently discovered in VirtualBox 5.1.8 that is breaking provisioning. More information [here](https://github.com/rapid7/metasploitable3/issues/41).

To build automatically:

1. Run the build_win2008.sh script if using bash, or build_win2008.ps1 if using Windows.
Expand Down
6 changes: 3 additions & 3 deletions build_win2008.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ErrorActionPreference = "Stop"

$virtualBoxMinVersion = "5.1.0"
$virtualBoxMinVersion = "5.1.6"
$packerMinVersion = "0.10.0"
$vagrantMinVersion = "1.8.6"
$vagrantreloadMinVersion = "0.0.1"
Expand Down Expand Up @@ -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) {
If (CompareVersions -actualVersion $vboxVersion -expectedVersion $virtualBoxMinVersion --exactMatch $True) {
Write-Host "Compatible version of VirtualBox found."
} else {
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/wiki/Downloads."
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."
exit
}

Expand Down
6 changes: 3 additions & 3 deletions build_win2008.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

min_virtualbox_ver="5.1.0"
min_virtualbox_ver="5.1.6"
min_vagrant_ver="1.8.6"
min_packer_ver="0.10.0"
min_vagrantreload_ver="0.0.1"
Expand Down Expand Up @@ -34,10 +34,10 @@ function compare_versions {
return 0
}

if compare_versions $(VBoxManage -v | cut -d'r' -f1) $min_virtualbox_ver false; then
if compare_versions $(VBoxManage -v | cut -d'r' -f1) $min_virtualbox_ver true; then
echo "Compatible version of VirtualBox found."
else
echo "A compatible version of VirtualBox was not found. Please download and install it from here: https://www.virtualbox.org/wiki/Downloads"
echo "A compatible version of VirtualBox was not found. Currently only 5.1.6 is supported. Please download and install it from https://www.virtualbox.org/wiki/Download_Old_Builds_5_1."
exit 1
fi

Expand Down

0 comments on commit 5286026

Please sign in to comment.