mwrock / packer-templates

Templates for creating vagrant boxes
Other
536 stars 250 forks source link

error when installing vbox-2016.json #100

Closed shurick81 closed 7 years ago

shurick81 commented 7 years ago

I've got a machine with VirtualBox 5.1, Chef Development Kit 2.3.4 and Packer 1.1. Trying to run packer build -force -only virtualbox-iso .\vbox-2016.json

After less than an hour I get this log:

D:\Alex\LocalDev\packer-templates-master>packer build -force -only virtualbox-iso .\vbox-2016.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: http://care.dlservice.microsoft.com/dl/download/1/6/F/16FA20E6-4662-482A-920B-1A45CF5AAE3C/14393.0.160715-1616.RS1_RELEASE_SERVER_EVAL_X64FRE_EN-US.ISO
==> virtualbox-iso: Deleting previous output directory...
==> virtualbox-iso: Creating floppy disk...
    virtualbox-iso: Copying files flatly from floppy_files
    virtualbox-iso: Copying file: answer_files/2016/Autounattend.xml
    virtualbox-iso: Copying file: scripts/winrm.ps1
    virtualbox-iso: Done copying files from floppy_files
    virtualbox-iso: Collecting paths from floppy_dirs
    virtualbox-iso: Resulting paths from floppy_dirs : []
    virtualbox-iso: Done copying paths from floppy_dirs
==> 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 3267)
==> virtualbox-iso: Executing custom VBoxManage commands...
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1507104731 --memory 2048
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1507104731 --vram 48
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1507104731 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
    virtualbox-iso: The VM will be run headless, without a GUI. If you want to
    virtualbox-iso: view the screen of the VM, connect via VRDP without a password to
    virtualbox-iso: rdp://127.0.0.1:5903
==> virtualbox-iso: Waiting 10s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for WinRM to become available...
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Build was cancelled.
Cleanly cancelled builds after being interrupted.

D:\Alex\LocalDev\packer-templates-master>packer build -force -only virtualbox-iso .\vbox-2016.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: http://care.dlservice.microsoft.com/dl/download/1/6/F/16FA20E6-4662-482A-920B-1A45CF5AAE3C/14393.0.160715-1616.RS1_RELEASE_SERVER_EVAL_X64FRE_EN-US.ISO
==> virtualbox-iso: Creating floppy disk...
    virtualbox-iso: Copying files flatly from floppy_files
    virtualbox-iso: Copying file: answer_files/2016/Autounattend.xml
    virtualbox-iso: Copying file: scripts/winrm.ps1
    virtualbox-iso: Done copying files from floppy_files
    virtualbox-iso: Collecting paths from floppy_dirs
    virtualbox-iso: Resulting paths from floppy_dirs : []
    virtualbox-iso: Done copying paths from floppy_dirs
==> 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 3746)
==> virtualbox-iso: Executing custom VBoxManage commands...
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1507104989 --memory 2048
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1507104989 --vram 48
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1507104989 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
    virtualbox-iso: The VM will be run headless, without a GUI. If you want to
    virtualbox-iso: view the screen of the VM, connect via VRDP without a password to
    virtualbox-iso: rdp://127.0.0.1:5900
==> virtualbox-iso: Waiting 10s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for WinRM to become available...
    virtualbox-iso: #< CLIXML
    virtualbox-iso: WinRM connected.
    virtualbox-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
==> virtualbox-iso: Connected to WinRM!
==> virtualbox-iso: Uploading VirtualBox version info (5.1.28)
==> virtualbox-iso: Provisioning with chef-solo
    virtualbox-iso: Installing Chef...
    virtualbox-iso:
    virtualbox-iso: ModuleType Version    Name                                ExportedCommands
    virtualbox-iso: ---------- -------    ----                                ----------------
    virtualbox-iso: Script     0.0        Omnitruck                           {Get-ProjectMetadata, Install-Project, install}
    virtualbox-iso: Installing chef from C:\Users\vagrant\AppData\Local\Temp\chef-client-13.5.3-1-x64.msi
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso: Creating directory: C:/Windows/Temp/packer-chef-solo
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso:     Directory: C:\Windows\Temp
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso: Mode                LastWriteTime         Length Name
    virtualbox-iso: ----                -------------         ------ ----
    virtualbox-iso: d-----        10/4/2017   8:37 AM                packer-chef-solo
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso: 'skipping chmod 0777 C:/Windows/Temp/packer-chef-solo'
    virtualbox-iso: Creating directory: C:/Windows/Temp/packer-chef-solo/cookbooks-0
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso:     Directory: C:\Windows\Temp\packer-chef-solo
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso: Mode                LastWriteTime         Length Name
    virtualbox-iso: ----                -------------         ------ ----
    virtualbox-iso: d-----        10/4/2017   8:37 AM                cookbooks-0
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso: 'skipping chmod 0777 C:/Windows/Temp/packer-chef-solo/cookbooks-0'

it stays still in this state for 4 to 6 hours: image

Then after that it finishes with this:

   virtualbox-iso: Creating directory: C:/Windows/Temp/packer-chef-solo/cookbooks-1
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso:     Directory: C:\Windows\Temp\packer-chef-solo
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso: Mode                LastWriteTime         Length Name
    virtualbox-iso: ----                -------------         ------ ----
    virtualbox-iso: d-----        10/4/2017  12:46 PM                cookbooks-1
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso: 'skipping chmod 0777 C:/Windows/Temp/packer-chef-solo/cookbooks-1'
    virtualbox-iso: Creating configuration file 'solo.rb'
    virtualbox-iso: Creating JSON attribute file
    virtualbox-iso: Executing Chef: c:/opscode/chef/bin/chef-solo.bat --no-color -c C:/Windows/Temp/packer-chef-solo/solo.rb -j C:/Windows/Temp/packer-chef-solo/node.json
    virtualbox-iso: Starting Chef Client, version 13.5.3
    virtualbox-iso: resolving cookbooks for run list: ["wsus-client::configure", "packer-templates::install_ps_modules", "packer-templates::vbox_guest_additions", "packer-templates::uninstall_powershell_ise", "packer-templates::delete_pagefile"]
    virtualbox-iso: [2017-10-04T12:50:59+00:00] WARN: Child with name 'packer-templates' found in multiple directories: C:/Windows/Temp/packer-chef-solo/cookbooks-0/packer-templates and C:/Windows/Temp/packer-chef-solo/cookbooks-1/packer-templates
    virtualbox-iso: [2017-10-04T12:51:01+00:00] WARN: Child with name 'packer-templates' found in multiple directories: C:/Windows/Temp/packer-chef-solo/cookbooks-0/packer-templates and C:/Windows/Temp/packer-chef-solo/cookbooks-1/packer-templates
    virtualbox-iso: [2017-10-04T12:51:02+00:00] WARN: Child with name 'packer-templates' found in multiple directories: C:/Windows/Temp/packer-chef-solo/cookbooks-0/packer-templates and C:/Windows/Temp/packer-chef-solo/cookbooks-1/packer-templates
    virtualbox-iso: Synchronizing Cookbooks:
    virtualbox-iso:   - wsus-client (1.2.1)
    virtualbox-iso:   - packer-templates (0.1.0)
    virtualbox-iso:   - windows (1.44.1)
    virtualbox-iso:   - chef_handler (1.4.0)
    virtualbox-iso: Installing Cookbook Gems:
    virtualbox-iso: Compiling Cookbooks...
    virtualbox-iso: c:/windows/temp/packer-chef-solo/local-mode-cache/cache/cookbooks/windows/resources/printer_port.rb:33: warning: constant ::Fixnum is deprecated
    virtualbox-iso:
    virtualbox-iso: ================================================================================
    virtualbox-iso: Recipe Compile Error in c:/windows/temp/packer-chef-solo/local-mode-cache/cache/cookbooks/packer-templates/recipes/uninstall_powershell_ise.rb
    virtualbox-iso: ================================================================================
    virtualbox-iso:
    virtualbox-iso: Chef::Exceptions::NoSuchResourceType
    virtualbox-iso: ------------------------------------
    virtualbox-iso: Cannot find a resource for windows_feature_dism on windows version 10.0.14393
    virtualbox-iso:
    virtualbox-iso: System Info:
    virtualbox-iso: ------------
    virtualbox-iso: chef_version=13.5.3
    virtualbox-iso: platform=windows
    virtualbox-iso: platform_version=10.0.14393
    virtualbox-iso: ruby=ruby 2.4.2p198 (2017-09-14 revision 59899) [x64-mingw32]
    virtualbox-iso: program_name=c:/opscode/chef/bin/chef-solo
    virtualbox-iso: executable=c:/opscode/chef/bin/chef-solo
    virtualbox-iso:
    virtualbox-iso:
    virtualbox-iso: Running handlers:
    virtualbox-iso: [2017-10-04T12:51:09+00:00] ERROR: Running exception handlers
    virtualbox-iso: Running handlers complete
    virtualbox-iso: [2017-10-04T12:51:09+00:00] ERROR: Exception handlers complete
    virtualbox-iso: Chef Client failed. 0 resources updated in 21 seconds
    virtualbox-iso: [2017-10-04T12:51:09+00:00] FATAL: Stacktrace dumped to c:/windows/temp/packer-chef-solo/local-mode-cache/cache/chef-stacktrace.out
    virtualbox-iso: [2017-10-04T12:51:09+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
    virtualbox-iso: [2017-10-04T12:51:09+00:00] FATAL: Chef::Exceptions::NoSuchResourceType: Cannot find a resource for windows_feature_dism on windows version 10.0.14393
    virtualbox-iso: c:/windows/temp/packer-chef-solo/local-mode-cache/cache/cookbooks/windows/resources/printer_port.rb:38: warning: constant ::Fixnum is deprecated
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error executing Chef: Non-zero exit status: 1

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error executing Chef: Non-zero exit status: 1

==> Builds finished but no artifacts were created.

Could you suggest a way to troubleshoot?

shurick81 commented 7 years ago

This one is the same as https://github.com/mwrock/packer-templates/issues/90. I've applied the same workaround.