You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build Windows 2022 with Packer using qemu. The issue is that even after the image boots up, Packer cannot connect to WinRM at all. I've verified through VNC that a listener exists at port 5985(using non-SSL). I also made sure that I add a port opening at 5985 in the batch file to set up WinRM, and I manually verified through VNC that the port opening exists. I've tried both enabling and disabling port forwarding&nat mapping. With skip_nat_mapping set to true, telnetting to 5985 doesn't get a connection refused, which makes me think that the connection refused error that Packer is showing me has to do with WinRM's authentication itself. With skip_nat_mapping set to false, telnetting to the forwarded port again does not get a connection refused.
This error is shown repeatedly, even after I verify through VNC that everything with WinRM should be as it is.
2022/07/19 13:03:06 packer-builder-qemu plugin: Using host value: 127.0.0.1
2022/07/19 13:03:06 packer-builder-qemu plugin: [INFO] Attempting WinRM connection...
2022/07/19 13:03:06 packer-builder-qemu plugin: [DEBUG] connecting to remote shell using WinRM
2022/07/19 13:04:22 packer-builder-qemu plugin: [ERROR] connection error: unknown error Post "http://127.0.0.1:4239/wsman": read tcp 127.0.0.1:35268->127.0.0.1:4239: read: connection reset by peer
2022/07/19 13:04:22 packer-builder-qemu plugin: [ERROR] WinRM connection err: unknown error Post "http://127.0.0.1:4239/wsman": read tcp 127.0.0.1:35268->127.0.0.1:4239: read: connection reset by peer
2022/07/19 13:04:27 packer-builder-qemu plugin: Using host value: 127.0.0.1
2022/07/19 13:04:27 packer-builder-qemu plugin: [INFO] Attempting WinRM connection...
2022/07/19 13:04:27 packer-builder-qemu plugin: [DEBUG] connecting to remote shell using WinRM
2022/07/19 13:05:44 packer-builder-qemu plugin: [ERROR] connection error: unknown error Post "http://127.0.0.1:4239/wsman": read tcp 127.0.0.1:35364->127.0.0.1:4239: read: connection reset by peer
2022/07/19 13:05:44 packer-builder-qemu plugin: [ERROR] WinRM connection err: unknown error Post "http://127.0.0.1:4239/wsman": read tcp 127.0.0.1:35364->127.0.0.1:4239: read: connection reset by peer
My batch file that runs under the in my autounattend.xml:
rem basic config for winrm
cmd.exe /c winrm quickconfig -q
rem allow unencrypted traffic, and configure auth to use basic username/password auth
cmd.exe /c winrm set winrm/config/service @{AllowUnencrypted="true"}
cmd.exe /c winrm set winrm/config/service/auth @{Basic="true"}
rem update firewall rules to open the right port and to allow remote administration
cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
cmd.exe /c netsh firewall add portopening TCP 5985 "Port 5985"
powershell -command "Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse"
powershell -command "New-Item -Path WSMan:\LocalHost\Listener -Transport HTTP -Address * -HostName '127.0.0.1' -Force"
rem restart winrm
cmd.exe /c net stop winrm
cmd.exe /c net start winrm
The text was updated successfully, but these errors were encountered:
Hello,
I'm trying to build Windows 2022 with Packer using qemu. The issue is that even after the image boots up, Packer cannot connect to WinRM at all. I've verified through VNC that a listener exists at port 5985(using non-SSL). I also made sure that I add a port opening at 5985 in the batch file to set up WinRM, and I manually verified through VNC that the port opening exists. I've tried both enabling and disabling port forwarding&nat mapping. With skip_nat_mapping set to true, telnetting to 5985 doesn't get a connection refused, which makes me think that the connection refused error that Packer is showing me has to do with WinRM's authentication itself. With skip_nat_mapping set to false, telnetting to the forwarded port again does not get a connection refused.
This error is shown repeatedly, even after I verify through VNC that everything with WinRM should be as it is.
My Packer configuration file:
My batch file that runs under the in my autounattend.xml:
The text was updated successfully, but these errors were encountered: