Have an issue where I can't get to a VM with vmware-iso provisioning via ESXi.
It can never get to the VNC console; but I have the firewall rules in place etc. (even tried with firewall off).
It seems like the VM never actually starts to expose the VNC port.
From what I can see there is no actual time in the build chain where the VM is started.
Config: https://gist.github.com/lantrix/736d94082b0812685a1e
Debug output:
2015/08/25 17:40:08 ui: ==> vmware-iso: Uploading ISO to remote machine...
2015/08/25 17:40:08 packer-builder-vmware-iso.exe: 2015/08/25 17:40:08 Remote uploading: C:/Users/lantrix/vmware/iso/en_windows_server_2012_r2_vl_with_update_x64_dvd_6052766.iso
2015/08/25 17:40:08 packer-builder-vmware-iso.exe: 2015/08/25 17:40:08 opening new ssh session
2015/08/25 17:40:08 packer-builder-vmware-iso.exe: 2015/08/25 17:40:08 starting remote command: mkdir -p /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/packer_cache
2015/08/25 17:40:08 packer-builder-vmware-iso.exe: 2015/08/25 17:40:08 remote command exited with '0': mkdir -p /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/packer_cache
2015/08/25 17:40:08 packer-builder-vmware-iso.exe: 2015/08/25 17:40:08 Verifying checksum of /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/packer_cache/en_windows_server_2012_r2_vl_with_update_x64_dvd_6052766.iso
2015/08/25 17:40:08 packer-builder-vmware-iso.exe: 2015/08/25 17:40:08 opening new ssh session
2015/08/25 17:40:08 packer-builder-vmware-iso.exe: 2015/08/25 17:40:08 starting remote command: md5sum -c
2015/08/25 17:44:46 packer-builder-vmware-iso.exe: 2015/08/25 17:44:46 remote command exited with '0': md5sum -c
2015/08/25 17:44:46 packer-builder-vmware-iso.exe: 2015/08/25 17:44:46 Initial checksum matched, no upload needed.
2015/08/25 17:44:46 ui: ==> vmware-iso: Creating virtual machine disk
2015/08/25 17:44:46 packer-builder-vmware-iso.exe: 2015/08/25 17:44:46 opening new ssh session
2015/08/25 17:44:46 packer-builder-vmware-iso.exe: 2015/08/25 17:44:46 starting remote command: vmkfstools -c 71680M -d zeroedthick -a lsilogic /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/PackerImages/windows_server_2012_r2.vmdk
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 remote command exited with '0': vmkfstools -c 71680M -d zeroedthick -a lsilogic /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/PackerImages/windows_server_2012_r2.vmdk
2015/08/25 17:44:48 ui: ==> vmware-iso: Building and writing VMX file
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Writing VMX to: C:\Users\lantrix\AppData\Local\Temp\packer-vmx254405613\packer_windows_2012_r2.vmx
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Setting VMX: 'annotation' = 'DSC-Base-Windows-1440488388'
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Setting VMX: 'RemoteDisplay.vnc.enabled' = 'true'
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Setting VMX: 'RemoteDisplay.vnc.port' = '5921'
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Setting VMX: 'memsize' = '2048'
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Setting VMX: 'numvcpus' = '1'
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Setting VMX: 'scsi0.virtualDev' = 'lsisas1068'
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Floppy path present, setting in VMX
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Writing VMX to: C:\Users\lantrix\AppData\Local\Temp\packer-vmx254405613\packer_windows_2012_r2.vmx
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Suppressing messages in VMX
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 Looking for available port between 5900 and 5980
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 opening new ssh session
2015/08/25 17:44:48 packer-builder-vmware-iso.exe: 2015/08/25 17:44:48 starting remote command: esxcli --formatter csv network ip connection list
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 remote command exited with '0': esxcli --formatter csv network ip connection list
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address :::22, port 22 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address 0.0.0.0:22, port 22 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address ::1:12000, port 12000 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address ::1:12001, port 12001 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address :::5989, port 5989 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address ::1:8307, port 8307 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address ::1:8309, port 8309 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address 192.168.150.3:427, port 427 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address 192.168.20.8:427, port 427 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address 0.0.0.0:443, port 443 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address :::443, port 443 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address 0.0.0.0:80, port 80 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address :::80, port 80 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address :::8000, port 8000 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address ::1:8089, port 8089 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address :::902, port 902 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address 0.0.0.0:902, port 902 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 ESXi listening on address :::8100, port 8100 unavailable for VNC
2015/08/25 17:44:49 packer-builder-vmware-iso.exe: 2015/08/25 17:44:49 Trying address: aumel-vmh03.local:5900...
2015/08/25 17:44:50 packer-builder-vmware-iso.exe: 2015/08/25 17:44:50 Timeout connecting to: aumel-vmh03.local:5900 (check firewall rules)
2015/08/25 17:44:50 packer-builder-vmware-iso.exe: 2015/08/25 17:44:50 Trying address: aumel-vmh03.local:5901...
2015/08/25 17:44:51 packer-builder-vmware-iso.exe: 2015/08/25 17:44:51 Timeout connecting to: aumel-vmh03.local:5901 (check firewall rules)
2015/08/25 17:44:51 packer-builder-vmware-iso.exe: 2015/08/25 17:44:51 Trying address: aumel-vmh03.local:5902...
<snip>
2015/08/25 17:46:08 packer-builder-vmware-iso.exe: 2015/08/25 17:46:08 Trying address: aumel-vmh03.local:5979...
2015/08/25 17:46:09 packer-builder-vmware-iso.exe: 2015/08/25 17:46:09 Timeout connecting to: aumel-vmh03.local:5979 (check firewall rules)
2015/08/25 17:46:09 packer-builder-vmware-iso.exe: 2015/08/25 17:46:09 Trying address: aumel-vmh03.local:5980...
2015/08/25 17:46:10 packer-builder-vmware-iso.exe: 2015/08/25 17:46:10 Timeout connecting to: aumel-vmh03.local:5980 (check firewall rules)
2015/08/25 17:46:10 ui error: ==> vmware-iso: Unable to find available VNC port between 5900 and 5980
2015/08/25 17:46:10 packer-builder-vmware-iso.exe: 2015/08/25 17:46:10 Deleting floppy disk: C:\Users\lantrix\AppData\Local\Temp\packer145514179
2015/08/25 17:46:10 ui: ==> vmware-iso: Deleting output directory...
2015/08/25 17:46:10 packer-builder-vmware-iso.exe: 2015/08/25 17:46:10 opening new ssh session
2015/08/25 17:46:10 packer-builder-vmware-iso.exe: 2015/08/25 17:46:10 starting remote command: rm -rf /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/PackerImages
2015/08/25 17:46:11 packer-builder-vmware-iso.exe: 2015/08/25 17:46:11 remote command exited with '0': rm -rf /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/PackerImages
2015/08/25 17:46:11 ui error: Build 'vmware-iso' errored: Unable to find available VNC port between 5900 and 5980
2015/08/25 17:46:11 Builds completed. Waiting on interrupt barrier...
2015/08/25 17:46:11 machine readable: error-count []string{"1"}
2015/08/25 17:46:11 ui error:
==> Some builds didn't complete successfully and had errors:
2015/08/25 17:46:11 machine readable: vmware-iso,error []string{"Unable to find available VNC port between 5900 and 5980"}
2015/08/25 17:46:11 ui error: --> vmware-iso: Unable to find available VNC port between 5900 and 5980
2015/08/25 17:46:11 ui:
==> Builds finished but no artifacts were created.
2015/08/25 17:46:11 waiting for all plugin processes to complete...
2015/08/25 17:46:11 C:\Users\lantrix\packer\packer-builder-vmware-iso.exe: plugin process exited
Firewall is set to allow 5800-5999 for VNC also on the ESXi host

I've solved this. When I changed the user:
"remote_username": "DOMAIN\\user",
"remote_password": "userpass",
to
"remote_username": "root",
"remote_password": "rootpass",
it worked.
2015/08/26 09:41:28 packer-builder-vmware-iso.exe: 2015/08/26 09:41:28 Trying address: aumel-vmh03.local:5946...
2015/08/26 09:41:29 packer-builder-vmware-iso.exe: 2015/08/26 09:41:29 Timeout connecting to: aumel-vmh03.local:5946 (check firewall rules)
2015/08/26 09:41:29 packer-builder-vmware-iso.exe: 2015/08/26 09:41:29 Trying address: aumel-vmh03.local:5947...
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 Found available VNC port: 5947
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 Writing VMX to: C:\Users\lantrix\AppData\Local\Temp\packer-vmx522133469\packer_windows_2012_r2.vmx
2015/08/26 09:41:30 ui: ==> vmware-iso: Registering remote VM...
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 opening new ssh session
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 Starting remote scp process: scp -vt /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/PackerImages
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 Started SCP session, beginning transfers...
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 Copying input data into temporary file so we can read the length
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 [DEBUG] Uploading packer_windows_2012_r2.vmx: perms=C0644 size=2581
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 SCP session complete, closing stdin pipe.
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 Waiting for SSH session to complete.
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 scp stderr (length 44): Sink: C0644 2581 packer_windows_2012_r2.vmx
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 opening new ssh session
2015/08/26 09:41:30 packer-builder-vmware-iso.exe: 2015/08/26 09:41:30 starting remote command: vim-cmd solo/registervm /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/PackerImages/packer_windows_2012_r2.vmx
2015/08/26 09:41:31 packer-builder-vmware-iso.exe: 2015/08/26 09:41:31 remote command exited with '0': vim-cmd solo/registervm /vmfs/volumes/AUMEL_FAS02b_FC_sata_DEV_Datastore11/PackerImages/packer_windows_2012_r2.vmx
2015/08/26 09:41:31 ui: ==> vmware-iso: Starting virtual machine...
2015/08/26 09:41:31 ui: vmware-iso: The VM will be run headless, without a GUI. If you want to
vmware-iso: view the screen of the VM, connect via VNC without a password to
vmware-iso: aumel-vmh03.local:5947
2015/08/26 09:41:31 packer-builder-vmware-iso.exe: 2015/08/26 09:41:31 opening new ssh session
2015/08/26 09:41:32 packer-builder-vmware-iso.exe: 2015/08/26 09:41:32 starting remote command: vim-cmd vmsvc/power.on 91
2015/08/26 09:41:34 packer-builder-vmware-iso.exe: 2015/08/26 09:41:34 remote command exited with '0': vim-cmd vmsvc/power.on 91
2015/08/26 09:41:34 packer-builder-vmware-iso.exe: 2015/08/26 09:41:34 opening new ssh session
2015/08/26 09:41:34 packer-builder-vmware-iso.exe: 2015/08/26 09:41:34 starting remote command: vim-cmd vmsvc/power.getstate 91
2015/08/26 09:41:35 packer-builder-vmware-iso.exe: 2015/08/26 09:41:35 remote command exited with '0': vim-cmd vmsvc/power.getstate 91
2015/08/26 09:41:35 ui: ==> vmware-iso: Waiting 2m0s for boot...
The user was an Active Directory user added on the ESXi host to the admin group. Seems this is not enough:
cd "C:\Program Files (x86)\VMware\VMware vSphere CLI\bin"
vicfg-user.pl --server aumel-vmh03.local --username root --password password -e user -o modify -l DOMAIN\user -r admin
:+1: Thanks for following up!
Actually this is not solved.
I intermittently had it work on Windows.
It works everytime on the Mac Packer:
Packer v0.8.7.dev (3f14b9d984a9b2e94829cbf8b24d6de0bd73fcca+CHANGES)
==> vmware-iso: Downloading or copying ISO
vmware-iso: Downloading or copying: file:///Users/lantrix/Documents/en_windows_server_2012_r2_vl_with_update_x64_dvd_6052766.iso
==> vmware-iso: Creating floppy disk...
vmware-iso: Copying: autounattend/perfb/Autounattend.xml
vmware-iso: Copying: scripts/perfb/vmware-userdata.ps1
vmware-iso: Copying: scripts/vmware-guest-tools.ps1
==> vmware-iso: Uploading Floppy to remote machine...
==> vmware-iso: Uploading ISO to remote machine...
==> vmware-iso: Creating virtual machine disk
==> vmware-iso: Building and writing VMX file
==> vmware-iso: Registering remote VM...
==> vmware-iso: Starting virtual machine...
vmware-iso: The VM will be run headless, without a GUI. If you want to
vmware-iso: view the screen of the VM, connect via VNC without a password to
vmware-iso: esxiserver.int:5800
==> vmware-iso: Waiting 8m0s for boot...
Exact same build config on windows _fails_ _100% of the time now_:
Packer v0.8.6
==> vmware-iso: Downloading or copying ISO
vmware-iso: Downloading or copying: file:///C:/Users/lantrix/Source/Repos/powershelldsc/Packer/iso/en_windows_server_2012_r2_vl_with_update_x64_dvd_6052766.iso
==> vmware-iso: Creating floppy disk...
vmware-iso: Copying: autounattend/perfb/Autounattend.xml
vmware-iso: Copying: scripts/perfb/vmware-userdata.ps1
vmware-iso: Copying: scripts/vmware-guest-tools.ps1
==> vmware-iso: Uploading Floppy to remote machine...
==> vmware-iso: Uploading ISO to remote machine...
==> vmware-iso: Creating virtual machine disk
==> vmware-iso: Building and writing VMX file
==> vmware-iso: Unable to find available VNC port between 5800 and 5825
==> vmware-iso: Deleting output directory...
Build 'vmware-iso' errored: Unable to find available VNC port between 5800 and 5825
==> Some builds didn't complete successfully and had errors:
--> vmware-iso: Unable to find available VNC port between 5800 and 5825
==> Builds finished but no artifacts were created.
I can NOT get it working in Windows. Works perfect in Mac every time.
Config is https://gist.github.com/lantrix/5a5ab3aef057d99e1e84
I'll build Packer v0.8.7.dev for windows with gox and see if it then works on windows too.
Still doesn't work on Windows on latest Dev build; but does on Mac.
PS C:\Users\lantrix\Source\Repos\powershelldsc\Packer> .\bin\packer.exe build -var-file=".\config\Config-VMWare-PERFB.json" .\PackerBaseWin2012R2-VMWare.json
vmware-iso output will be in this color.
==> vmware-iso: Downloading or copying ISO
vmware-iso: Downloading or copying: file:///C:/Users/lantrix/Source/Repos/powershelldsc/Packer/iso/en_windows_server_2012_r2_vl_with_update_x64_dvd_6052766.iso
==> vmware-iso: Creating floppy disk...
vmware-iso: Copying: autounattend/perfb/Autounattend.xml
vmware-iso: Copying: scripts/perfb/vmware-userdata.ps1
vmware-iso: Copying: scripts/vmware-guest-tools.ps1
==> vmware-iso: Uploading Floppy to remote machine...
==> vmware-iso: Uploading ISO to remote machine...
==> vmware-iso: Creating virtual machine disk
==> vmware-iso: Building and writing VMX file
==> vmware-iso: Unable to find available VNC port between 5800 and 5825
==> vmware-iso: Deleting output directory...
Build 'vmware-iso' errored: Unable to find available VNC port between 5800 and 5825
==> Some builds didn't complete successfully and had errors:
--> vmware-iso: Unable to find available VNC port between 5800 and 5825
==> Builds finished but no artifacts were created.
PS C:\Users\lantrix\Source\Repos\powershelldsc\Packer> .\bin\packer.exe version
Packer v0.8.7.dev
I've managed to get this working (thanks @mefellows for the golang help). Just commented out and changed the net.DialTimeOut call when used on Windows. We commented out the e.Timeout() error check; and it worked, which means there is no actual infrastructure issues in place.
Instead maybe there is some underlying non-portable code there with that check in Windows v OS X.
PS C:\Users\lantrix\Source\Repos\powershelldsc> .\Packer\Build-VMWare.ps1 -configFile Config-VMWare-PERFB.json
vmware-iso output will be in this color.
==> vmware-iso: Downloading or copying ISO
vmware-iso: Downloading or copying: file:///C:/Users/lantrix/Source/Repos/powershelldsc/Packer/iso/en_windows_server_2012_r2_vl_with_update_x64_dvd_6052766.iso
==> vmware-iso: Creating floppy disk...
vmware-iso: Copying: autounattend/perfb/Autounattend.xml
vmware-iso: Copying: scripts/perfb/vmware-userdata.ps1
vmware-iso: Copying: scripts/vmware-guest-tools.ps1
==> vmware-iso: Uploading Floppy to remote machine...
==> vmware-iso: Uploading ISO to remote machine...
==> vmware-iso: Creating virtual machine disk
==> vmware-iso: Building and writing VMX file
==> vmware-iso: Registering remote VM...
==> vmware-iso: Starting virtual machine...
vmware-iso: The VM will be run headless, without a GUI. If you want to
vmware-iso: view the screen of the VM, connect via VNC without a password to
vmware-iso: server.local:5800
==> vmware-iso: Waiting 8m0s for boot...
==> vmware-iso: Waiting 8m0s for boot...
==> vmware-iso: Connecting to VM via VNC
==> vmware-iso: Typing the boot command over VNC...
==> vmware-iso: Waiting for WinRM to become available...
==> vmware-iso: Connected to WinRM!
==> vmware-iso: Provisioning with Powershell...
==> vmware-iso: Provisioning with shell script: C:\Users\lantrix\AppData\Local\Temp\packer-powershell-provisioner707704999
It might be better to leave this functionality in for OS that correctly detect timeouts.
if e, ok := err.(*net.OpError); ok {
if runtime.GOOS != "windows" && e.Timeout() {
log.Printf("Timeout connecting to: %s (check firewall rules)", address)
} else {
vncPort = port
break
}
}
+1
+1
+1
Is this still an issue?
I'm afraid the above patch wouldn't work because it doesn't actually check if the port is available, and I'm not sure if listenPorts is authoritative.
I wonder if someone who's getting this error could apply this patch and show me the PACKER_LOG=1 output:
diff --git a/builder/vmware/iso/driver_esx5.go b/builder/vmware/iso/driver_esx5.go
index 4bac820..1a060ba 100644
--- a/builder/vmware/iso/driver_esx5.go
+++ b/builder/vmware/iso/driver_esx5.go
@@ -211,6 +211,8 @@ func (d *ESX5Driver) VNCAddress(_ string, portMin, portMax uint) (string, uint,
if e, ok := err.(*net.OpError); ok {
if e.Timeout() {
log.Printf("Timeout connecting to: %s (check firewall rules)", address)
+ log.Println(e.Error())
+ log.Printf("error is temporary: %t", e.Temporary())
} else {
vncPort = port
break
I've not run this recently so not sure it's still an issue. I'll see if I can run that and let you know the output.
@lantrix thanks!
I also met this problem with error Unable to find available VNC port between 5900 and 6000 but the firewall works well. The final workaround I found is similar to https://github.com/mitchellh/packer/pull/4480 :
I increased the value from 5s to 10s, and rebuild packer from source.
diff --git a/builder/vmware/iso/driver_esx5.go b/builder/vmware/iso/driver_esx5.go
index 90b7e11..651503e 100644
--- a/builder/vmware/iso/driver_esx5.go
+++ b/builder/vmware/iso/driver_esx5.go
@@ -205,7 +205,7 @@ func (d *ESX5Driver) VNCAddress(_ string, portMin, portMax uint) (string, uint,
}
address := fmt.Sprintf("%s:%d", d.Host, port)
log.Printf("Trying address: %s...", address)
- l, err := net.DialTimeout("tcp", address, 5*time.Second)
+ l, err := net.DialTimeout("tcp", address, 10*time.Second)
if err != nil {
if e, ok := err.(*net.OpError); ok {
I tried to setup a TCP echo server on esxi (ESXi-6.0.0-20170202001-standard (VMware, Inc.)
). For every tcp connection (including the ssh connection) from my laptop to the echo server, the connection will be delay for about 5s (For security concern?). This might be the reason why it's hard to reproduce.
The problem is similar to #1372 #1480 #1541 .
@mwhooker sorry never got back to you but see that you've merged in a fix in the form of a longer timeout. Thanks!
Most helpful comment
I also met this problem with error
Unable to find available VNC port between 5900 and 6000but the firewall works well. The final workaround I found is similar to https://github.com/mitchellh/packer/pull/4480 :I increased the value from 5s to 10s, and rebuild packer from source.
I tried to setup a TCP echo server on esxi (
ESXi-6.0.0-20170202001-standard (VMware, Inc.)). For every tcp connection (including the ssh connection) from my laptop to the echo server, the connection will be delay for about 5s (For security concern?). This might be the reason why it's hard to reproduce.The problem is similar to #1372 #1480 #1541 .