-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
endless "Waiting for WinRM to become available" #101
Comments
However, when I run vbox-2016.json, it works as expected and I get image prepared: The sequence for this one is almost the same as for Win 2012 R2:
|
@shurick81, I've had similar experiences creating a Windows 10 box on Hyper-V. One of the things I found is that it is not able to run the a:\winrm.ps1 file as the ExecutionPolicy is not set so that it can be run. Even after setting the ExecutionPolicy to unrestriced for the machine however, it still runs with errors. If I run the commands manually in a powershell window, it completes correctly and the packer build continues. Hope this helps. |
@eeevans did you ever find a solution for this? |
@ilovemysillybanana yes, I renamed it to winrm.bat and removed the single quotes from the set commands and changed the entry in the floppy_files section. I'm just now creating the box again as my 90 days are about up and ran into this again and luckily found this post again or else I would have tried a couple of more days before discovering the solution again. |
I am facing similar issues, with Windows 2012R2 and Windows 2016 VM on Hyper-V with host OS as windows 10. The same scripts worked some 1 week back and today none is working. Started to feel that Packer is unreliable and if it is worth spending time on fixing issues which could have been abstracted...Need to evaluate other tools now.. |
I was facing the same win Win server 2019. I followed the exact windows guide here: Solved it by skipping setting the password:
Now the packer will actually wait for the real password to become available which take about 5-10min and automatically use that for the winrm connection! Maybe not the best solution, but it works. |
My case, increased WinRM connection time out ("winrm_timeout": "30m") to 30m from 2m. it didn't took 30 mins. and successful. |
in my case it was firewall issue. port "5986" is blocked on firewall. I updated bootstrap script to use port 443 and set "winrm_port" to 443 in the json file |
If others are still struggling, here's what I ended up using. works fine on server 2019:
|
I have the same problem with Windows 10 and i have no more idea. Did you find an other solution to create a VM ? or did you find a new way to connect winrm? thank for your help |
@Qflament recently I was also struggling with deployment of Windows 10 which was always hanging on infinite "Waiting for WinRM" no matter what I did. Meanwhile Win Server 2022 with same Communicator settings did not have such problem and WinRM got detected almost instantly. Interesting fact was that actually on Windows 10 WinRM was accessible from outside and I was able to perform any actions, but still packer was waiting fro WinRM anyway. After several attempts of investigation I found that problem was in Network type which was Public (I already had Firewall disabled for all types of network) and winrm configuration was not properly applied. I added this line in bootstrap script BEFORE "winrm quickconfig -quiet" # Switch any existing Public connections to Private
Get-NetConnectionProfile -NetworkCategory Public | Set-NetConnectionProfile -NetworkCategory Private and it totally solved the problem - WinRM gets detected instantly
|
My name is Dezidery, i have been trying to install windows 11 to vmware workstation using packer hashicorp. The process goes smoothly up the end, but it ends by not installing all artifact throwing an error of "vmware-iso.windows11: Waiting for WinRM to become available..." when it reach at the end it deletes all files from vm-output. if there is any assistance will be much appriciated. |
here is my xml file en-US 0409:00000409 en-US en-US en-US en-US B:\ 250 1 Primary 2 true Primary 1 1 NTFS Boot true 2 2 NTFS System 0 true /IMAGE/INDEX 1 0 2 OnError false true 1 BypassTPMCheck cmd /c reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d 1 2 BypassSecureBootCheck cmd /c reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d 1 3 BypassRAMCheck cmd /c reg add "HKLM\SYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d 1 false Central Standard Time false true Remote Desktop all 2 1 true true en-US en-US en-US en-US packer1234 <PlainText>true</PlainText> 2 administrator true %SystemRoot%\System32\reg.exe ADD HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ /v HideFileExt /t REG_DWORD /d 0 /f 1 Show file extensions in Explorer %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateFileSizePercent /t REG_DWORD /d 0 /f 2 Zero Hibernation File %SystemRoot%\System32\reg.exe ADD HKLM\SYSTEM\CurrentControlSet\Control\Power\ /v HibernateEnabled /t REG_DWORD /d 0 /f 3 Disable Hibernation Mode cmd.exe /c wmic useraccount where "name='administrator'" set PasswordExpires=FALSE 4 Disable password expiration for packer user 5 powershell -ExecutionPolicy Bypass -File c:\appx.ps1 Remove AppxPackages true 6 powershell -ExecutionPolicy Bypass -File c:\winrm-update.bat Enable ;OLLLL service true false true true true true true Home 1 packer1234 <PlainText>true</PlainText> packer1234 <PlainText>true</PlainText> administrators administrator administrator packer User |
This is my hcl file packer { variable "autounattend_file" { variable "cpu_num" { variable "disk_size" { variable "mem_size" { variable "os_iso_checksum" { variable "os_iso_url" { variable "winrm_password" { variable "winrm_username" { source "vmware-iso" "windows11" { disk_size = var.disk_size communicator = "winrm" floppy_files = [var.autounattend_file, "setup/winrm-update.bat"] vmx_data = { build { provisioner "powershell" { provisioner "powershell" { provisioner "powershell" { provisioner "windows-shell" { |
here is my winrmfile.bat "$ErrorActionPreference = "SilentlyContinue" Switch network connection to private modeRequired for WinRM firewall rulesSwitch any existing Public connections to PrivateGet-NetConnectionProfile -NetworkCategory Public | Set-NetConnectionProfile -NetworkCategory Private Switch any existing Public connections to PrivateGet-NetConnectionProfile -NetworkCategory Public | Set-NetConnectionProfile -NetworkCategory Private Disable Network discoveryreg ADD HKLM\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff /f $profile = Get-NetConnectionProfileWhile ($profile.Name -eq "Identifying..."){Start-Sleep -Seconds 10$profile = Get-NetConnectionProfile}Set-NetConnectionProfile -Name $profile.Name -NetworkCategory Private Enable Windows Remote Management in the Windows Firewall.Write-Output "Enabling Windows Remote Management in the Windows Firewall..." Set the Windows Remote Management configuration.Write-Output "Setting the Windows Remote Management configuration..." Allow Windows Remote Management in the Windows Firewall.Write-Output "Allowing Windows Remote Management in the Windows Firewall..." Restart Windows Remote Management service.Write-Output "Restarting Windows Remote Management service..." am new to packer hcl, if some one can help me how to overcome the problem will be much appreciated thank you for your cooperation. |
I have got a fresh Windows 10 x64 on my host machine.
First, I install dependencies in PowerShell.
Packer:
VirtualBox:
Chef SDK:
Git:
Then I open a new cmd window to clone and run the project:
As a result, it endeavors on following stage:
So it opens the virtual machine but never continues provisioning.
The text was updated successfully, but these errors were encountered: