builder/virtualbox: Look for virtualbox on the path

This commit is contained in:
Mitchell Hashimoto 2013-06-11 15:47:10 -07:00
parent d31d54366a
commit e14b00c818
1 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"log"
"os/exec"
)
const BuilderId = "mitchellh.virtualbox"
@ -73,7 +74,11 @@ func (b *Builder) Cancel() {
}
func (b *Builder) newDriver() (Driver, error) {
vboxmanagePath := "VBoxManage"
vboxmanagePath, err := exec.LookPath("VBoxManage")
if err != nil {
return nil, err
}
driver := &VBox42Driver{vboxmanagePath}
if err := driver.Verify(); err != nil {
return nil, err