Comments (15)
Hi @MansM!
What is the output of
packer version
VBoxManage -version
The packer build is running with GUI, what do you see before the timeout occurs?
Does packer still wait for WinRM connection?
from packer-windows.
Just tried it with VirtualBox 5.1.8. After about half an hour it starts provisioning as the Windows Update script has finished.
$ packer build --only=virtualbox-iso windows_2016_docker.json
virtualbox-iso output will be in this color.
==> 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: ./floppy/WindowsPowershell.lnk
virtualbox-iso: Copying file: ./floppy/PinTo10.exe
virtualbox-iso: Copying file: ./scripts/disable-screensaver.ps1
virtualbox-iso: Copying file: ./scripts/disable-winrm.ps1
virtualbox-iso: Copying file: ./scripts/docker/enable-winrm.ps1
virtualbox-iso: Copying file: ./scripts/microsoft-updates.bat
virtualbox-iso: Copying file: ./scripts/win-updates.ps1
virtualbox-iso: Copying file: ./scripts/oracle-cert.cer
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 3235)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm WindowsServer2016Docker --memory 2048
virtualbox-iso: Executing: modifyvm WindowsServer2016Docker --cpus 2
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 2m0s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for WinRM to become available...
==> virtualbox-iso: Connected to WinRM!
==> virtualbox-iso: Uploading VirtualBox version info (5.1.8)
==> virtualbox-iso: Provisioning with windows-shell...
==> virtualbox-iso: Provisioning with shell script: ./scripts/vm-guest-tools.bat
...
from packer-windows.
packer --version
0.12.1
VBoxManage -version
5.1.10r112026
my packer output has been lost, will recreate this somewhere this week, but I remember it was waiting for WinRM to become available
from packer-windows.
some more weird stuff:
while still at:
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 4163)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1482232447 --memory 2048
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1482232447 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 2m0s for boot...
==> virtualbox-iso: Typing the boot command...
==> virtualbox-iso: Waiting for WinRM to become available...
telnet 127.0.0.1 4163
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^CConnection closed by foreign host.
from packer-windows.
$ packer build --only=virtualbox-iso windows_2016.json
virtualbox-iso output will be in this color.
==> 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: ./floppy/WindowsPowershell.lnk
virtualbox-iso: Copying file: ./floppy/PinTo10.exe
virtualbox-iso: Copying file: ./scripts/disable-screensaver.ps1
virtualbox-iso: Copying file: ./scripts/disable-winrm.ps1
virtualbox-iso: Copying file: ./scripts/enable-winrm.ps1
virtualbox-iso: Copying file: ./scripts/microsoft-updates.bat
virtualbox-iso: Copying file: ./scripts/win-updates.ps1
virtualbox-iso: Copying file: ./scripts/oracle-cert.cer
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 4163)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1482232447 --memory 2048
virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1482232447 --cpus 2
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Waiting 2m0s 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.
==> Builds finished but no artifacts were created.
from packer-windows.
OK, so you have to look into your VM desktop what's happening there before the timeout occurs. You can attach eg. a screenshot
from packer-windows.
moved to vb 5.1.12, rebooting now after installing updates
any log files I can take a look at as well?
from packer-windows.
can you check if if your setup still works on vb 5.1.12?
from packer-windows.
Yes, have a look into this script https://github.com/StefanScherer/packer-windows/blob/my/scripts/win-updates.ps1#L6
It writes a log for all updates.
from packer-windows.
I can reproduce the problem. Updates are finished, the logfile in C:\Windows\temp\win-updates.log
looks good. The VM has rebooted and Windows Remote management firewall exception is allowed.
I'm testing this with VirtualBox 5.1.12, and the port forwarding is configured in VirtualBox:
And with a winrm
cli I can connect from my host to the VM. Strange. Don't know why packer still waits until WinRM port is open.
from packer-windows.
Next thing. Run with debug output.
PACKER_LOG=debug packer build --only=virtualbox-iso windows_2016_docker.json
from packer-windows.
Oh, seems like packe 0.12.1 uses the wrong port.
It first tries port 3304 and add the port mapping. But after that it still tries to use port 5985 to connect to WinRM :-(
016/12/21 21:12:54 packer: 2016/12/21 21:12:54 Looking for available communicator (SSH, WinRM, etc) port between 2222 and 4444
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 Trying port: 3304
2016/12/21 21:12:54 ui: ==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 3304)
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 Executing VBoxManage: []string{"modifyvm", "WindowsServer2016Docker", "--natpf1", "packercomm,tcp,127.0.0.1,3304,,5985"}
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 3304)
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 stdout:
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 stderr:
2016/12/21 21:12:54 ui: ==> virtualbox-iso: Executing custom VBoxManage commands...
==> virtualbox-iso: Executing custom VBoxManage commands...
2016/12/21 21:12:54 ui: virtualbox-iso: Executing: modifyvm WindowsServer2016Docker --memory 2048
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 Executing VBoxManage: []string{"modifyvm", "WindowsServer2016Docker", "--memory", "2048"}
virtualbox-iso: Executing: modifyvm WindowsServer2016Docker --memory 2048
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 stdout:
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 stderr:
2016/12/21 21:12:54 ui: virtualbox-iso: Executing: modifyvm WindowsServer2016Docker --cpus 2
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 Executing VBoxManage: []string{"modifyvm", "WindowsServer2016Docker", "--cpus", "2"}
virtualbox-iso: Executing: modifyvm WindowsServer2016Docker --cpus 2
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 stdout:
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 stderr:
2016/12/21 21:12:54 ui: ==> virtualbox-iso: Starting the virtual machine...
2016/12/21 21:12:54 packer: 2016/12/21 21:12:54 Executing VBoxManage: []string{"startvm", "WindowsServer2016Docker", "--type", "gui"}
==> virtualbox-iso: Starting the virtual machine...
2016/12/21 21:12:55 packer: 2016/12/21 21:12:55 stdout: Waiting for VM "WindowsServer2016Docker" to power on...
2016/12/21 21:12:55 packer: VM "WindowsServer2016Docker" has been successfully started.
2016/12/21 21:12:55 packer: 2016/12/21 21:12:55 stderr:
2016/12/21 21:12:55 ui: ==> virtualbox-iso: Waiting 2m0s for boot...
==> virtualbox-iso: Waiting 2m0s for boot...
==> virtualbox-iso: Typing the boot command...
2016/12/21 21:14:55 ui: ==> virtualbox-iso: Typing the boot command...
2016/12/21 21:14:55 packer: 2016/12/21 21:14:55 Waiting for WinRM, up to timeout: 6h0m0s
2016/12/21 21:14:55 ui: ==> virtualbox-iso: Waiting for WinRM to become available...
==> virtualbox-iso: Waiting for WinRM to become available...
2016/12/21 21:15:00 packer: 2016/12/21 21:15:00 [INFO] Attempting WinRM connection...
2016/12/21 21:15:00 packer: 2016/12/21 21:15:00 [DEBUG] connecting to remote shell using WinRM
2016/12/21 21:15:30 packer: 2016/12/21 21:15:30 [ERROR] connection error: unknown error Post http://127.0.0.1:5985/wsman: EOF
2016/12/21 21:15:30 packer: 2016/12/21 21:15:30 [ERROR] WinRM connection err: unknown error Post http://127.0.0.1:5985/wsman: EOF
2016/12/21 21:15:35 packer: 2016/12/21 21:15:35 [INFO] Attempting WinRM connection...
2016/12/21 21:15:35 packer: 2016/12/21 21:15:35 [DEBUG] connecting to remote shell using WinRM
2016/12/21 21:16:05 packer: 2016/12/21 21:16:05 [ERROR] connection error: unknown error Post http://127.0.0.1:5985/wsman: EOF
2016/12/21 21:16:05 packer: 2016/12/21 21:16:05 [ERROR] WinRM connection err: unknown error Post http://127.0.0.1:5985/wsman: EOF
2016/12/21 21:16:10 packer: 2016/12/21 21:16:10 [INFO] Attempting WinRM connection...
2016/12/21 21:16:10 packer: 2016/12/21 21:16:10 [DEBUG] connecting to remote shell using WinRM
2016/12/21 21:16:40 packer: 2016/12/21 21:16:40 [ERROR] connection error: unknown error Post http://127.0.0.1:5985/wsman: EOF
2016/12/21 21:16:40 packer: 2016/12/21 21:16:40 [ERROR] WinRM connection err: unknown error Post http://127.0.0.1:5985/wsman: EOF
2016/12/21 21:16:45 packer: 2016/12/21 21:16:45 [INFO] Attempting WinRM connection...
2016/12/21 21:16:45 packer: 2016/12/21 21:16:45 [DEBUG] connecting to remote shell using WinRM
2016/12/21 21:17:15 packer: 2016/12/21 21:17:15 [ERROR] connection error: unknown error Post http://127.0.0.1:5985/wsman: EOF
2016/12/21 21:17:15 packer: 2016/12/21 21:17:15 [ERROR] WinRM connection err: unknown error Post http://127.0.0.1:5985/wsman: EOF
2016/12/21 21:17:20 packer: 2016/12/21 21:17:20 [INFO] Attempting WinRM connection...
2016/12/21 21:17:20 packer: 2016/12/21 21:17:20 [DEBUG] connecting to remote shell using WinRM
2016/12/21 21:17:50 packer: 2016/12/21 21:17:50 [ERROR] connection error: unknown error Post http://127.0.0.1:5985/wsman: EOF
2016/12/21 21:17:50 packer: 2016/12/21 21:17:50 [ERROR] WinRM connection err: unknown error Post http://127.0.0.1:5985/wsman: EOF
from packer-windows.
Opened an issue hashicorp/packer#4310 as I don't know the code base well enough.
You could try to use an older version of Packer, eg. 0.10.2 which I used in September (https://github.com/StefanScherer/logbook/blob/master/Install-MacBookPro.md#2016-09-25) where I probably built the Win2016Docker VirtualBox VM with it.
from packer-windows.
I'll close this one as the bugfix is not using packer 0.12.1, but any other version.
from packer-windows.
Is this issue still persistent in the newest versions? packer 1.2.4
?
Seems to be doing it for me as well.
==> virtualbox-iso: Waiting for WinRM to become available...
==> virtualbox-iso: Timeout waiting for WinRM.
==> virtualbox-iso: Deregistering and deleting VM...
==> 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-windows.
Related Issues (20)
- Building QEMU images fail with recent Packer version HOT 3
- virtio drivers? HOT 2
- The windows_10 (virtualbox, 2020.11.18) license will expire soon HOT 15
- Win10 build asks for Language during install/first boot; an Update was unsuccessful HOT 5
- The VagrantCloud Hyper-V box version 2020.04.15 isn't being discovered by Vagrant HOT 3
- Confusing information in the README.md HOT 2
- Question - change disk size dynamically for vagrant machine HOT 2
- VagrantCloud W10 virtualbox missing HOT 10
- Improving project reusability HOT 1
- Windows-11 `qemu` builder is missing HOT 3
- Windows could not apply the unattended answer file's <DiskConfiguration> setting HOT 1
- With-windows-updates doesnt start WinRM service HOT 7
- Error when building VirtualBox image on Linux with AMD processor HOT 1
- windows image build with kvm stuck at winrm(booting from floppy) HOT 1
- Building windows_2019_docker with Parallels
- Windows 10 December 2022 updates break the enable-winrm.ps1 script HOT 6
- Windows Server 2022 iso_url out of date? HOT 1
- Building Windows 2019 with Qemu locks up HOT 2
- Waiting for WinRM to become available (again) HOT 2
- "This PC can't run Windows 11" (VirtualBox, Windows 11 iso) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from packer-windows.