From 875951a8177420ebac608a498047427ec38b447a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 5 Jun 2013 13:17:56 -0700 Subject: [PATCH] builder/vmware: Enable VNC --- builder/vmware/step_create_vmx.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/builder/vmware/step_create_vmx.go b/builder/vmware/step_create_vmx.go index 02b95d11b..f4cb07ce0 100644 --- a/builder/vmware/step_create_vmx.go +++ b/builder/vmware/step_create_vmx.go @@ -14,6 +14,7 @@ type vmxTemplateData struct { GuestOS string DiskName string ISOPath string + VNCPort uint } type stepCreateVMX struct{} @@ -29,16 +30,21 @@ func (stepCreateVMX) Run(state map[string]interface{}) multistep.StepAction { return multistep.ActionHalt } + var vncPort uint = 5900 + tplData := &vmxTemplateData{ config.VMName, "ubuntu-64", config.DiskName, config.ISOUrl, + vncPort, } t := template.Must(template.New("vmx").Parse(DefaultVMXTemplate)) t.Execute(f, tplData) + state["vnc_port"] = vncPort + return multistep.ActionContinue } @@ -104,6 +110,8 @@ powerType.suspend = "soft" proxyApps.publishToHost = "FALSE" replay.filename = "" replay.supported = "FALSE" +RemoteDisplay.vnc.enabled = "TRUE" +RemoteDisplay.vnc.port = "{{ .VNCPort }}" scsi0.pciSlotNumber = "16" scsi0.present = "TRUE" scsi0.virtualDev = "lsilogic"