From a0664c7ec8b2d1587a4674f22dd592f1cc83b733 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 7 Jun 2013 21:54:08 -0700 Subject: [PATCH] builder/vmware: Ability to set the guest OS type --- builder/vmware/builder.go | 5 +++++ builder/vmware/step_create_vmx.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/builder/vmware/builder.go b/builder/vmware/builder.go index 2f18e3b18..d71426785 100644 --- a/builder/vmware/builder.go +++ b/builder/vmware/builder.go @@ -23,6 +23,7 @@ type Builder struct { type config struct { DiskName string `mapstructure:"vmdk_name"` + GuestOSType string `mapstructure:"guest_os_type"` ISOUrl string `mapstructure:"iso_url"` VMName string `mapstructure:"vm_name"` OutputDir string `mapstructure:"output_directory"` @@ -55,6 +56,10 @@ func (b *Builder) Prepare(raw interface{}) (err error) { b.config.DiskName = "disk" } + if b.config.GuestOSType == "" { + b.config.GuestOSType = "other" + } + if b.config.VMName == "" { b.config.VMName = "packer" } diff --git a/builder/vmware/step_create_vmx.go b/builder/vmware/step_create_vmx.go index a0971ac1f..313111126 100644 --- a/builder/vmware/step_create_vmx.go +++ b/builder/vmware/step_create_vmx.go @@ -35,7 +35,7 @@ func (stepCreateVMX) Run(state map[string]interface{}) multistep.StepAction { tplData := &vmxTemplateData{ config.VMName, - "ubuntu-64", + config.GuestOSType, config.DiskName, config.ISOUrl, }