Skip to content
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

HyperV for 2012R2 stuck waiting for WINRM to become available #91

Open
guillemsola opened this issue Jul 19, 2017 · 3 comments
Open

HyperV for 2012R2 stuck waiting for WINRM to become available #91

guillemsola opened this issue Jul 19, 2017 · 3 comments

Comments

@guillemsola
Copy link

guillemsola commented Jul 19, 2017

Hi,

I just tried to build the hyperv for 2012R2 but gets stuck waiting for WinRM to become available

image

I tried to log to the image IP with Enter-PSSession -ComputerName 169.254.27.232 -UseSSL -Credential $credentials without success. Then I log in the machine and run the winrm quickconfig which said that it was not enabled for remote access. I enable it but still couldn't connect.

As ipconfig in machine showed a IP 169.254.27.232 I installed the Web-Server role and I could connect to it with it but not with the IP from the packer log.

I followed suggestions from this related repo to test some things.

@guillemsola
Copy link
Author

Tested it with 2016 hyper v and it can connect with WinRM

image

@guillemsola
Copy link
Author

I been investigating a bit more on this issue and it turns out that de default network switch that packer creates in hyper-v is an internal network.

From my understanding then no internet is available thus is not possible to download the provisioning script and install all the required windows updates.

As a workaround I changed it manually to external and now the process is able to move forward.

The nice thing would be to use the NAT feature only available through powershell and create an internal network with internet access.

@rconde-bt
Copy link

I encountered the same issue today while trying to build for Hyper-V. I had to create an external switch:

image

Then I commented out the switch_name line from hyperv-2012r2.json:

λ git diff
diff --git a/hyperv-2012r2.json b/hyperv-2012r2.json
index aaff5a2..8a1847f 100644
--- a/hyperv-2012r2.json
+++ b/hyperv-2012r2.json
@@ -13,7 +13,6 @@
       "winrm_timeout": "12h",
       "shutdown_command": "a:/PackerShutdown.bat",
       "shutdown_timeout": "15m",
-      "switch_name": "internal_switch",
       "floppy_files": [
         "answer_files/2012_r2{{user `core`}}/Autounattend.xml",
         "scripts/postunattend.xml",

Is there a better way? I'd like it to create an external network switch on its own without me having to do it in the GUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants