builder/vmware: output VNC info if headless

/cc @smerrill
This commit is contained in:
Mitchell Hashimoto 2013-07-02 12:23:19 -07:00
parent 925734d06b
commit b4b9469d3c
1 changed files with 8 additions and 0 deletions

View File

@ -27,12 +27,20 @@ func (s *stepRun) Run(state map[string]interface{}) multistep.StepAction {
driver := state["driver"].(Driver)
ui := state["ui"].(packer.Ui)
vmxPath := state["vmx_path"].(string)
vncPort := state["vnc_port"].(uint)
// Set the VMX path so that we know we started the machine
s.bootTime = time.Now()
s.vmxPath = vmxPath
ui.Say("Starting virtual machine...")
if config.Headless {
ui.Message(fmt.Sprintf(
"The VM will be run headless, without a GUI. If you want to\n"+
"view the screen of the VM, connect via VNC without a password to\n"+
"127.0.0.1:%d", vncPort))
}
if err := driver.Start(vmxPath, config.Headless); err != nil {
err := fmt.Errorf("Error starting VM: %s", err)
state["error"] = err