diff --git a/CHANGELOG.md b/CHANGELOG.md index ad8430ed8..d2f387cd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,8 @@ BUG FIXES: * builder/virtualbox/all: Seed RNG to avoid same ports. [GH-1386] * builder/virtualbox/all: Better error if guest additions URL couldn't be detected. [GH-1439] + * builder/virtualbox/all: Detect errors even when `VBoxManage` exits + with a zero exit code. [GH-1119] * builder/virtualbox/iso: Append timestamp to default name for parallel builds. [GH-1365] * builder/vmware/all: `ssh_host` accepts templates. [GH-1396] diff --git a/builder/virtualbox/common/driver_4_2.go b/builder/virtualbox/common/driver_4_2.go index 901822174..beb6dac9d 100644 --- a/builder/virtualbox/common/driver_4_2.go +++ b/builder/virtualbox/common/driver_4_2.go @@ -157,6 +157,13 @@ func (d *VBox42Driver) VBoxManage(args ...string) error { err = fmt.Errorf("VBoxManage error: %s", stderrString) } + if err == nil { + m, _ := regexp.MatchString("VBoxManage([.a-z]+?): error:", stderrString) + if m { + err = fmt.Errorf("VBoxManage error: %s", stderrString) + } + } + log.Printf("stdout: %s", stdoutString) log.Printf("stderr: %s", stderrString)