Waiting for WinRM to become available"

174 views
Skip to first unread message

Brian Walker

unread,
Jul 4, 2019, 2:40:42 PM7/4/19
to Packer
I have seen a lot of people with the same issue when trying to build a windows image with Packer. I have yet to find an answer on how to resolve. I have tried several things which have not resolved the issue. 

Does anyone have ideas on how to resolve this issue? The VM gets created in vCenter fine.  I can do a web console after the VM comes up and show that WinRM is installed and available. My assumption is that it has to do with Authentication. I even tried upping the timeout to 30 minutes but that does not help.


Tried these WinRM settings as well...HELP!

# Required for WinRM firewall rules
$profile = Get-NetConnectionProfile
Set-NetConnectionProfile -Name $profile.Name -NetworkCategory Private
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False


# Enable WinRM service
winrm quickconfig -quiet
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/client '@{TrustedHosts="192.168.1.100,192.168.1.123"}'

Sharing my files (Attached)

==> vsphere-iso: Mount ISO images...
==> vsphere-iso: Creating floppy disk...
    vsphere-iso: Copying files flatly from floppy_files
    vsphere-iso: Copying file: setup/autounattend.xml
    vsphere-iso: Copying file: setup/setup.ps1
    vsphere-iso: Copying file: setup/vmtools.cmd
    vsphere-iso: Done copying files from floppy_files
    vsphere-iso: Collecting paths from floppy_dirs
    vsphere-iso: Resulting paths from floppy_dirs : []
    vsphere-iso: Done copying paths from floppy_dirs
==> vsphere-iso: Uploading created floppy image
==> vsphere-iso: Adding generated Floppy...
==> vsphere-iso: Set boot order temporary...
==> vsphere-iso: Power on VM...
==> vsphere-iso: Waiting for IP...
==> vsphere-iso: IP address: 172.16.100.104
==> vsphere-iso: Using winrm communicator to connect: 172.16.100.104
==> vsphere-iso: Waiting for WinRM to become available...
==> vsphere-iso: Timeout waiting for WinRM.
==> vsphere-iso: Clear boot order...
==> vsphere-iso: Power off VM...
==> vsphere-iso: Deleting Floppy image ...
==> vsphere-iso: Destroying VM...
Build 'vsphere-iso' errored: Timeout waiting for WinRM.
setup.ps1
vars.json
autounattend.xml
windows-server-2016.json

Brian Walker

unread,
Jul 4, 2019, 3:54:40 PM7/4/19
to Packer
Attached is a debug log file. I see errors but not sure how to fix
packerlog.txt

Angel Rengifo Cancino

unread,
Jul 4, 2019, 9:52:36 PM7/4/19
to packe...@googlegroups.com
Hello:

On Thu, Jul 4, 2019 at 1:40 PM 'Brian Walker' via Packer <packe...@googlegroups.com> wrote:
I have seen a lot of people with the same issue when trying to build a windows image with Packer. I have yet to find an answer on how to resolve. I have tried several things which have not resolved the issue. 

Does anyone have ideas on how to resolve this issue? The VM gets created in vCenter fine.  I can do a web console after the VM comes up and show that WinRM is installed and available. My assumption is that it has to do with Authentication. I even tried upping the timeout to 30 minutes but that does not help.


Tried these WinRM settings as well...HELP!

# Required for WinRM firewall rules
$profile = Get-NetConnectionProfile
Set-NetConnectionProfile -Name $profile.Name -NetworkCategory Private
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False


# Enable WinRM service
winrm quickconfig -quiet
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/client '@{TrustedHosts="192.168.1.100,192.168.1.123"}'

I don't see you're enabling WinRM SSL. Have you already enabled it? If you didn't, then you should not use WinRM SSL in your packer config file.

While waiting for WinRM to connect, try connectivity to port 5986 (SSL) or 5985 (no SSL). See which of those ports work.


Brian Walker

unread,
Jul 4, 2019, 10:03:29 PM7/4/19
to packe...@googlegroups.com
Hi
thanks for the response. I was able to get past the issue by using these parameters
"winrm_insecure": "true",
      "winrm_use_ssl": "false",

It connects on HTTP and works now...BUT now trying to figure the next step out.

The VM Template gets created fine now but I need to change the vsphere_scsi_controller_type from lsilogic to pvscsi because of another tool I am using to sping up the VM's. 

I am using the steps in this github repo for the packer steps


And it seems to use packer plugins from this github.


Trying to figure out how I can change packer to build the VM template using pvscsi scsci type instead of lsilogic. 

That prob really confused you 

Brian Walker

SA Practice Manager  - East / Federal / Canada

Brian.Walker@docker.com

Cell: 919-338-4127

signature_1960088225



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to packer-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CAA3McK_64GrMjXC19uJ1MXjhSjDW-KEThdOV_0n5NV_v7k%3DO%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Angel Rengifo Cancino

unread,
Jul 5, 2019, 12:12:23 AM7/5/19
to packe...@googlegroups.com
Why can't you just modify the disk_controller_type value to the desired value? Just copy and/or extract the contents of packer config file that is useful to you.

Maybe I'm not understanding your problem.

Reply all
Reply to author
Forward
0 new messages