builder/vmware: output VNC info if headless
/cc @smerrill
This commit is contained in:
parent
2b010269a3
commit
874b4acf1c
|
@ -27,12 +27,20 @@ func (s *stepRun) Run(state map[string]interface{}) multistep.StepAction {
|
||||||
driver := state["driver"].(Driver)
|
driver := state["driver"].(Driver)
|
||||||
ui := state["ui"].(packer.Ui)
|
ui := state["ui"].(packer.Ui)
|
||||||
vmxPath := state["vmx_path"].(string)
|
vmxPath := state["vmx_path"].(string)
|
||||||
|
vncPort := state["vnc_port"].(uint)
|
||||||
|
|
||||||
// Set the VMX path so that we know we started the machine
|
// Set the VMX path so that we know we started the machine
|
||||||
s.bootTime = time.Now()
|
s.bootTime = time.Now()
|
||||||
s.vmxPath = vmxPath
|
s.vmxPath = vmxPath
|
||||||
|
|
||||||
ui.Say("Starting virtual machine...")
|
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 {
|
if err := driver.Start(vmxPath, config.Headless); err != nil {
|
||||||
err := fmt.Errorf("Error starting VM: %s", err)
|
err := fmt.Errorf("Error starting VM: %s", err)
|
||||||
state["error"] = err
|
state["error"] = err
|
||||||
|
|
Loading…
Reference in New Issue