diff --git a/builder/virtualbox/common/hw_config.go b/builder/virtualbox/common/hw_config.go index 6da48bf7d..9e7079237 100644 --- a/builder/virtualbox/common/hw_config.go +++ b/builder/virtualbox/common/hw_config.go @@ -23,7 +23,6 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error { // Hardware and cpu options if c.CpuCount < 0 { errs = append(errs, fmt.Errorf("An invalid number of cpus was specified (cpus < 0): %d", c.CpuCount)) - c.CpuCount = 0 } if c.CpuCount == 0 { c.CpuCount = 1 @@ -31,7 +30,6 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error { if c.MemorySize < 0 { errs = append(errs, fmt.Errorf("An invalid memory size was specified (memory < 0): %d", c.MemorySize)) - c.MemorySize = 0 } if c.MemorySize == 0 { c.MemorySize = 512 @@ -42,5 +40,5 @@ func (c *HWConfig) Prepare(ctx *interpolate.Context) []error { c.Sound = "none" } - return nil + return errs }