WinRM connection refused with VirtualBox OVA.

42 views
Skip to first unread message

SurferL

unread,
May 16, 2018, 12:17:40 PM5/16/18
to Packer
Was unsure where to post this, so posting here instead of GitHub issue list.

- Packer version: `1.1.3`
- Host platform: `macOS Sierra 10.12.6`
- Debug log output and example template in: https://gist.github.com/SurferL/2fe7c71ec519d1dc292e184a47cb1396

I've tested this with longer winrm_timeouts of up to 15 minutes but I've had no luck.

What's weird is that I can run a ansible_playbook to do a ping test on this machine (with it's IP), when it's up and it works fine, and I can verify that winrm is working using `nc -z -w1 <hostip> 5985;echo $?` from my host machine.

Does anyone have any ideas?

Thanks in advance! :)

Rickard von Essen

unread,
May 16, 2018, 12:49:59 PM5/16/18
to packe...@googlegroups.com
I have no idea, but I think you should update to the latest release before troubleshooting further. 

--
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/503daeeb-ea1b-447d-b934-0fb297c4fb7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

SurferL

unread,
May 17, 2018, 4:13:01 AM5/17/18
to Packer
Thanks for the suggestion - I updated to the latest packer (1.2.3), however I still have the same issue sadly.

Jordan Borean

unread,
May 17, 2018, 6:36:01 AM5/17/18
to Packer
Packer connects over the forwarded port which according to your logs is port 3050, would be interesting to see if Ansible is able to connect over that same port. You can try setting the below to use the same network that Packer will try

ansible_host=127.0.0.1
ansible_port
=3050

Obviously that port is dynamic so check the Packer output to see what port it forwards.

Thanks

Jordan

SurferL

unread,
May 17, 2018, 8:04:30 AM5/17/18
to Packer
So I thought it had something to do with the Network adapter setting on the VirtualBox image being set to "Attached to: NAT". I've also tried changing that to a "Bridged Adapter" to no luck. 

Is there one which I should be using with Packer -> VirtualBox OVF?

SurferL

unread,
May 17, 2018, 8:12:30 AM5/17/18
to Packer
Interesting - so testing with the same port which Packer uses (with Ansible) fails:

fatal: [win_one]: UNREACHABLE! => {"changed": false, "msg": "ssl: HTTPSConnectionPool(host='127.0.0.1', port=2792): Max retries exceeded with url: /wsman (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10858fc50>: Failed to establish a new connection: [Errno 61] Connection refused',))", "unreachable": true}

Jordan Borean

unread,
May 17, 2018, 7:14:01 PM5/17/18
to Packer
Sounds like something on your Mac is blocking that port, I use MacOS myself and it works for me. The NAT network type is fine.

Thanks

Jordan

SurferL

unread,
May 18, 2018, 8:54:16 AM5/18/18
to Packer
Hmm, I don't see anything that could be blocking that port as the Firewall is turned off.

I can deploy a ubuntu image (with basically the same template), and using SSH just fine. It's just WinRM which I'm still having a problem with :( 
Reply all
Reply to author
Forward
0 new messages