WinRM response 401 (http response error: 401 - invalid content type) when build windows OS from iso

1,677 views
Skip to first unread message

Wataru Haniyama

unread,
Mar 29, 2018, 9:16:40 PM3/29/18
to Packer
I tried build using winrm but I get response 401.

  •  Host OS: Windows 10 Pro v1709
  •  VM OS: Windos 10 Pro and Windows 7 Pro
  • packer version: 1.2.2
  • VirtualBox version: 5.2.8

Log, packer.json, Autounattend.xml is here.

My command is

> packer build -force -only=virtualbox-iso -var iso_url=xxxx -var iso_checksum=xxxx .\windows_10_x64.json 

and packer started build but winrm response 401 content type 

2018/03/30 09:40:42 packer.exe: 2018/03/30 09:40:42 [INFO] Attempting WinRM connection...
2018/03/30 09:40:42 packer.exe: 2018/03/30 09:40:42 [DEBUG] connecting to remote shell using WinRM
2018/03/30 09:40:42 packer.exe: 2018/03/30 09:40:42 [ERROR] connection error: http response error: 401 - invalid content type
2018/03/30 09:40:42 packer.exe: 2018/03/30 09:40:42 [ERROR] WinRM connection err: http response error: 401 - invalid content type

I also check following

  • turn off windows firewall both Host and Client.
  • connect via winrs command to winrm port automatically forwarding andresponse OK.(ex "winrs.exe -r:http://localhost:4249-u:vagrant -p:vagrant echo OK")
  • increase winrm_timeout value 
What is wrong my settings?


 

Alvaro Miranda Aguilera

unread,
Mar 30, 2018, 6:04:41 AM3/30/18
to packe...@googlegroups.com
Hello

You created this from scratch? did work before?

Is always easier start from something that works, ie some github repo that builds what you require and do incremental changes.

So you can go back an fix what broke


can you check here:



--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/d4c56ae5-06ca-4df3-aa41-340e0582f004%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Message has been deleted

Wataru Haniyama

unread,
Mar 31, 2018, 5:37:48 AM3/31/18
to Packer
I just typo winrm_password.

Thank you

2018年3月30日金曜日 10時16分40秒 UTC+9 Wataru Haniyama:
Reply all
Reply to author
Forward
0 new messages