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

Build 'virtualbox-iso' errored: Timeout waiting for WinRM #35

Open
jcii opened this issue Feb 20, 2016 · 24 comments
Open

Build 'virtualbox-iso' errored: Timeout waiting for WinRM #35

jcii opened this issue Feb 20, 2016 · 24 comments

Comments

@jcii
Copy link

jcii commented Feb 20, 2016

Hi Matt,

Thanks for the awesome work on packer and boxstarter! I am running the packer-template for 2012r2 to get a current 90 day license. I left it running last night, but it errored out waiting on all the windows patching.

I'm in Seattle on Comcast 100mbps...is it possible to cache any of those window patches? Do I have any other options to get this to complete? I'm re-running now...

-Jimmy

@mwrock
Copy link
Owner

mwrock commented Feb 20, 2016

Yeah its a pretty terrible experience. Are you running with a gui? If it times out waiting for WinRM, it could be there was an error in the underlying box that you might be able t osee with the gui. However if you are like me, you may have gone to sleep only to wake up with that error message and a deleted VM. I believe there is a separate packer issue around preserving the VM when things go wrong.

Another potential issue is that it just was not finished by the end of the timeout. The timeout is 8 hours which is usually adequate but may need to be extended if your host is extremely under resourced. I suspect its not bandwidth thats the issue but would be more likely RAM/Disk. The machine I run this on is my daughters old laptop with a busted monitor but works fine if I RDP to it. Its not that beefy (I5/6GB/HDD (not SSD)).

@jcii
Copy link
Author

jcii commented Feb 20, 2016

currently im on an Ubuntu 14.04 host, which is an i7-something w/ 32GB of ram...I believe the VM is configured with 2 procs and 2GB of ram. SSD disk.

I edited the packer json to extend the timeout to 16 hours. The error from last night did go away with packer's cleanup. The linux terminal said something about Timeour waiting for WinRM so I assume it took longer than 8 hours. I'll update later when it completes or errors out.

If it completes, I'll upload it to Azure. My ultimate plan is to apply a chef cookbook that installs vs2015 community and include a Vagrantfile in my OS project.

@mwrock
Copy link
Owner

mwrock commented Feb 20, 2016

Well thats certainly beefy enough :) I'd bet it didn't just timeout but there was an error in the setup but after 8 hours, packer timed out and it all went away. Extending the timeout is good since it should give you more time to see the real issue in the vbox gui.

@bradwilliamson
Copy link

I am seeing the Timeout waiting for WinRM from my powershell session on my host.

==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: file:///C:/Program%20Files/Oracle/VirtualBox/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: http://care.dlservice.microsoft.com/dl/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO
==> virtualbox-iso: Creating floppy disk...
virtualbox-iso: Copying: answer_files/2012_r2/Autounattend.xml
virtualbox-iso: Copying: scripts/oracle.cer
virtualbox-iso: Copying: scripts/postunattend.xml
virtualbox-iso: Copying: scripts/boxstarter.ps1
virtualbox-iso: Copying: scripts/PackerShutdown.bat
virtualbox-iso: Copying: scripts/package.ps1
virtualbox-iso: Copying: scripts/SetupComplete-2012.cmd
virtualbox-iso: Copying: scripts/Test-Command.ps1
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Attaching floppy disk...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 3364)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1458938405 --natpf1 guest_winrm,tcp,,55985,,5985
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1458938405 --memory 2048
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1458938405 --vram 48
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1458938405 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 10s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for WinRM to become available...
Timeout waiting for WinRM

If I get on the virtualbox guest created with the vbox-2012r2.json file & type in

winrm set winrm/config/service '@{AllowUnencrypted="True"}' it connects over winrm & progresses further. Is there anyway to inject this in somewhere along the packer build or in a config file somewhere that loads before needing WinRM

@mwrock
Copy link
Owner

mwrock commented Mar 26, 2016

The package script intentionally sets that property at the very end of the boxstarter run. If its done too early, packer will reboot the vm and then hands off the rest of the provisioning to the provisioner.

When you see the above timeout, that usually means that either something went wrong in the boxstarter run or windows updates took too long. If you have a Virtualbox GUI up, you may be able to tell what is wrong by an error in the console or looking in the boxstarter log at $env:localappdata\boxstarter\boxstarter.log.

@prashant645
Copy link

Hi Matt Sorry . Iam facing the same issue of winrm getting timed out .Please suggest any solution in regards with this since I have been lingering on the step for nearly 2 days. I have also set the winrm timeout to 8 hrs but also the winrm is timing out.
Below is the output which I have attached please check it and let me know a solution

PS C:\Users\panugpr1\Desktop\chef-repo\packer-templates-master> .\packer.exe build -force -only virtualbox-iso vbox-2012r2.json
virtualbox-iso output will be in this color.

==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: file:///C:/Program%20Files/Oracle/VirtualBox/VBoxGuestAdditions.iso
==> virtualbox-iso: Downloading or copying ISO
virtualbox-iso: Downloading or copying: file:///C:/Users/panugpr1/Desktop/chef-repo/packer-templates-master/iso/9600.17050.WIN
BLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO
==> virtualbox-iso: Creating floppy disk...
virtualbox-iso: Copying: answer_files/2012_r2/Autounattend.xml
virtualbox-iso: Copying: scripts/oracle.cer
virtualbox-iso: Copying: scripts/postunattend.xml
virtualbox-iso: Copying: scripts/boxstarter.ps1
virtualbox-iso: Copying: scripts/PackerShutdown.bat
virtualbox-iso: Copying: scripts/package.ps1
virtualbox-iso: Copying: scripts/SetupComplete-2012.cmd
virtualbox-iso: Copying: scripts/Test-Command.ps1
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Attaching floppy disk...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 2781)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1459396712 --natpf1 guest_winrm,tcp,,55985,,5985
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1459396712 --memory 2048
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1459396712 --vram 48
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1459396712 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 10s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for WinRM to become available...

==> virtualbox-iso: Timeout waiting for WinRM.
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Timeout waiting for WinRM.

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Timeout waiting for WinRM.

@mwrock
Copy link
Owner

mwrock commented Mar 31, 2016

see my comment just above yours. If the run has been going over 8 hours and you have decent hardware, something went wrong and you need to check the boxstarter log or the vbox gui for errors.

@prashant645
Copy link

vbox gui doesnt show up any errors .I also cannot find the box starter.log file, is it present in the VM or my local worstation?

@mwrock
Copy link
Owner

mwrock commented Mar 31, 2016

its in the vm at $env:LocalAppData\boxstarter\boxstarter.log

@prashant645
Copy link

Hi Matt Below I am not able to see the log file.Below I am attaching my screenshot of the folder system check it once and guide me please
boxstarter

@mwrock
Copy link
Owner

mwrock commented Mar 31, 2016

you want c:\users\vagrant\appdata\local\boxstarter

@prashant645
Copy link

Hi Matt This is the screen shot of the last 20 line of the log.Can you please let me know the problem by looking at the log file. Because I am unable to diagnose the root cause or error
boxstarter

@prashant645
Copy link

Hi matt please reply to the above thread.Please let me know the problem

@mwrock
Copy link
Owner

mwrock commented Mar 31, 2016

looks like something went wrong further up. you could include a link to a gist of the whole thing.

@prashant645
Copy link

oh gosh My entire vm got deleted now. and I wont be able to trace out the boxstarter.log.Could you suggest me any other method for building a windowsr2012 box for setting up a test kitchen instance.

@mwrock
Copy link
Owner

mwrock commented Mar 31, 2016

oh...I know that pain.

You can always use mwrock/Windows2012R2 which is built from this template and I keep it pretty current.

@jcii
Copy link
Author

jcii commented Apr 1, 2016

fwiw, I set the timeout to 16 hours, ran the script on my laptop, and worked on other things, watching it. I got it to work, but i remember having to hit enter at a prompt for something.

@mwrock
Copy link
Owner

mwrock commented Apr 1, 2016

yeah. a prompt would definitely be a bug.

@haf
Copy link

haf commented May 25, 2016

Same here, 8h later it just killed everything off. I have the latest MacBook Pro machine with 16 cores and 16 GiB memory and the top-of-the-line SSD that I think can write 600 MiB/s. It's not about being underspecced. The my internet connection is 1000/1000 to the internet (and 300 mbps WiFi that caps out at 296 mbps in real life, because who wants cables to a MacBook Pro?).

To the contrary, I think it's a lot about network latency to MSFT servers and how it chooses to install its security updates (staged download-install-then-download-again). Is it possible to use one of the batch security update ISOs, you think?

@Zian
Copy link

Zian commented Jul 2, 2016

Is there any way to get the boxstarter log when the VM is stuck at the following window?

virtualbox_packer-virtualbox-iso-1467494898_02_07_2016_15_45_19

@mwrock
Copy link
Owner

mwrock commented Jul 5, 2016

The log can be found in %LOCALAPPDATA%\boxstarter

Its likely not going to have anything helpful. The call to windows update and check updates, especially on a clean win 7 VM can take a very long time.

@nealbrown
Copy link

Just a data point I am still getting this bug hashicorp/packer#3652 so hopefully next release of packer will address this

@cwlls
Copy link

cwlls commented May 26, 2017

This looks very similar to an error I just had with the WinRM port. In commit 832eaeb it was set to 55985 instead of the default port of 5985. @mwrock just approved my pull request to change it in the vbox-2012r2.json. This might also be the problem in issue #76.

@dbhaskaran1
Copy link

This is what I'm seeing when I open up the GUI. Its going through a ton of updates. I'll increase the timeout and see if its done then.

image

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

9 participants