joefitzgerald / packer-windows

Windows Packer Templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows Server 2012 R2 -> build hands at "Waiting for SSH to become available..."

stunney opened this issue · comments

I am completely using the stock files with the exception of adding my own local ISO instead of the download AND entering my own license key.

validate passed with no errors.

PS E:\VMs\packerTest\packer-windows-1.25> packer build .\windows_2012_r2.json
virtualbox-iso output will be in this color.
vmware-iso output will be in this color.

Warnings for build 'virtualbox-iso':

* A checksum type of 'none' was specified. Since ISO files are so big,
a checksum is highly recommended.

==> 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:///E:/VMs/packerTest/packer-windows-1.25/iso/en_windows_server_2012_r2_with_update_x64_dvd_6052708.iso
==> virtualbox-iso: Creating floppy disk...
    virtualbox-iso: Copying: ./answer_files/2012_r2/Autounattend.xml
    virtualbox-iso: Copying: ./scripts/microsoft-updates.bat
    virtualbox-iso: Copying: ./scripts/win-updates.ps1
    virtualbox-iso: Copying: ./scripts/openssh.ps1
    virtualbox-iso: Copying: ./scripts/oracle-cert.cer
Build 'vmware-iso' errored: Failed creating VMware driver: Unable to initialize any driver for this platform. The errors
from each driver are shown below. Please fix at least one driver
to continue:
* VMware application not found:
* VMware application not found:
* VMware application not found:
* VMware application not found:

==> 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 3922)
==> virtualbox-iso: Executing custom VBoxManage commands...
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1465860116 --memory 2048
    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1465860116 --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: 127.0.0.1:5998
==> virtualbox-iso: Waiting 2m0s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for SSH to become available...

I hit CTRL+C here after waiting for a few minutes.  Couldn't "preview" the VM in the virtualbox UI.  Was getting error code E_FAIL 0x80004005

==> virtualbox-iso: Error shutting down VM: VBoxManage error: 0%...10%...20%...
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Error deleting virtual machine: VBoxManage error: VBoxManage.exe: error: Cannot unregister the machine 'packer-virtualbox-iso-1465860116' while it is locked
==> virtualbox-iso: VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee IUnknown
==> virtualbox-iso: VBoxManage.exe: error: Context: "Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(aMedia))" at line 155 of file VBoxManageMisc.cpp
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Build was cancelled.
Cleanly cancelled builds after being interrupted.
PS E:\VMs\packerTest\packer-windows-1.25>

Oh, and I'm running 1.25 release.

Just did a git clone of the latest and I seem to be hitting the same issue. I have no issues creating a VM manually with the same ISO file, and my host OS and virtualbox support x64 guest operating systems. Not sure what is going on here.

Ok, quick update. It appears as though I was just being impatient. It can take up to an HOUR for this to go through. Not sure why. But this issue is being closed.