Giter Club home page Giter Club logo

Comments (24)

mwrock avatar mwrock commented on September 6, 2024

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)).

from packer-templates.

jcii avatar jcii commented on September 6, 2024

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.

from packer-templates.

mwrock avatar mwrock commented on September 6, 2024

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.

from packer-templates.

bradwilliamson avatar bradwilliamson commented on September 6, 2024

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

from packer-templates.

mwrock avatar mwrock commented on September 6, 2024

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.

from packer-templates.

prashant645 avatar prashant645 commented on September 6, 2024

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.

from packer-templates.

mwrock avatar mwrock commented on September 6, 2024

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.

from packer-templates.

prashant645 avatar prashant645 commented on September 6, 2024

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?

from packer-templates.

mwrock avatar mwrock commented on September 6, 2024

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

from packer-templates.

prashant645 avatar prashant645 commented on September 6, 2024

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

from packer-templates.

mwrock avatar mwrock commented on September 6, 2024

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

from packer-templates.

prashant645 avatar prashant645 commented on September 6, 2024

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

from packer-templates.

prashant645 avatar prashant645 commented on September 6, 2024

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

from packer-templates.

mwrock avatar mwrock commented on September 6, 2024

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

from packer-templates.

prashant645 avatar prashant645 commented on September 6, 2024

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.

from packer-templates.

mwrock avatar mwrock commented on September 6, 2024

oh...I know that pain.

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

from packer-templates.

jcii avatar jcii commented on September 6, 2024

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.

from packer-templates.

mwrock avatar mwrock commented on September 6, 2024

yeah. a prompt would definitely be a bug.

from packer-templates.

haf avatar haf commented on September 6, 2024

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?

from packer-templates.

Zian avatar Zian commented on September 6, 2024

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

from packer-templates.

mwrock avatar mwrock commented on September 6, 2024

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.

from packer-templates.

nealbrown avatar nealbrown commented on September 6, 2024

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

from packer-templates.

cwlls avatar cwlls commented on September 6, 2024

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.

from packer-templates.

dbhaskaran1 avatar dbhaskaran1 commented on September 6, 2024

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

from packer-templates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.