builder/vmware: proper port range for VNC

This commit is contained in:
Mitchell Hashimoto 2013-06-07 14:58:49 -07:00
parent 0596266776
commit 7a5dce0dc9
1 changed files with 1 additions and 1 deletions

View File

@ -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 {