Commit 7a5dce0d authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/vmware: proper port range for VNC

parent 05962667
......@@ -46,7 +46,7 @@ func (stepConfigureVNC) Run(state map[string]interface{}) multistep.StepAction {
var vncPort uint
portRange := int(config.VNCPortMax - config.VNCPortMin)
for {
vncPort = uint(rand.Intn(portRange) + portRange)
vncPort = uint(rand.Intn(portRange)) + config.VNCPortMin
log.Printf("Trying port: %d", vncPort)
l, err := net.Listen("tcp", fmt.Sprintf(":%d", vncPort))
if err == nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment