-
Notifications
You must be signed in to change notification settings - Fork 2
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
'{$ProgressPreference' is not recognized as an internal or external command #1
Comments
I have the same issue and no clue right now what's wrong with this script. Maybe its size and a problem with the upload through WinRM. I'm using a scheduled task inside the install-docker.ps1 to work around a problem running Install-ContainerHost.ps1 without interactive desktop. Probably the progress bar causes the problem without a real terminal window. May BTW: With |
Or we should use the newer steps to install Docker, eg. from install-docker.ps1 |
That's a good thought on the size. It looks like that happens ~17284 characters in. I suppose if line endings and/or comments were stripped during remoting, that could be around a 16k boundary. I'm leaning towards install-docker.ps1 - that's much simpler. |
re: progress bar & downloads - Start-BitsTransfer is much faster. It works everywhere except Nano server.
|
I started down the path with the shorter scripts - see branch "shorterinstall." I'm too tired to finish testing it tonight |
Great work! |
It's not size related. It fails with the shorter script. This is the first PowerShell script in the provisioners section of windows_2016_docker.json. I need to dig into the Packer code to see if there's a bug in how it invokes PowerShell scripts over WinRM. windows_2016 and windows_2016_core.json succeed. Neither of them use PowerShell provisioner scripts. |
https://www.packer.io/docs/other/debugging.html may help, setting environment variable PACKER_LOG=1 |
Seems that the fork from @taliesins has this code https://github.com/taliesins/packer/blob/HyperV/provisioner/powershell/provisioner.go#L123 but not the upstream packer repo https://github.com/mitchellh/packer/blob/master/provisioner/powershell/provisioner.go |
I'll try another build with a modified json file, adding the {
"type": "powershell",
"execute_command": "powershell \"& { {{.Vars}}{{.Path}}; exit $LastExitCode}\"",
"scripts": [
"./scripts/docker/install-docker.ps1",
"./scripts/docker/patch-boot-time-for-containers.ps1",
"./scripts/docker/enable-docker-insecure.ps1",
"./scripts/docker/add-docker-group.ps1",
"./scripts/docker/remove-docker-key-json.ps1"
]
}, |
Yes this seems to work even with the old install-docker.ps1 script. But packer couldn't export the Hyper-V TP5 VM as my Win10 VM only has a 60 GByte disk. So I first have to create a bigger Win10 VM with Packer on my Mac... |
Thanks! that worked. |
In the meantime I tried a similar tp5 json template to build the TP5 with docker installed for Hyper-V. I wanted to make a breakthrough to check which problems occur on that way using Vagrant.
Searching for that error message I found this
I've patched my Vagrant 1.8.4 installation in Windows 10 with wget -uri https://raw.githubusercontent.com/codekaizen/vagrant/d3859a33aa37aa238fd4022a3ad4e7546f149570/plugins/providers/hyperv/scripts/get_vm_status.ps1 -outfile C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.4\plugins\providers\hyperv\scripts\get_vm_status.ps1 I think that will be fixed and available in Vagrant 1.8.5. Testing all these tools with Hyper-V helps making them better. Now booting the docker-windows-box works
But then another error occurs which I know from OSX as there is an issue with WinRM in Vagrant 1.8.4
The issue is filed at hashicorp/vagrant#7526 with a workaround to update winrm-fs ruby gem to 0.4.3 as described in hashicorp/vagrant#7476 (comment). I fixed it on Windows 10 with
So the breakthrough with a TP5 Vagrant box in Hyper-V is only possible with a developer version of packer + Vagrant 1.8.4 with some unsupported patches to make everything work. But this gives me hope that in a future version when all patches will be merged Windows users will have the same experience with packer + vagrant -> windows docker engine as others on Mac/Linux/Windows with VMware/VirtualBox |
This is the modification in the docker-windows-box Vagrantfile for the hyperv provider in Vagrant. |
Current status: Windows 10 build 10586 running Vagrant 1.8.4 with two patches (^^) to spin up a Hyper-V Vagrant box with Server 2016 TP5 and Docker with windowsservercore images. Would love to see a Vagrant 1.8.5 very soon with these fixes. /cc @sethvargo :-) |
Looking good. Well done :-) |
@taliesins Thanks! My first intensive usage of your packer hyperv fork. 👍 Still some work to do.
And some more details with $env:PACKER_LOG=1
Have you covered this issue in a newer version? |
Have you got a custom prompt? Why is "$host.version.Major" returning the path as well? May be an issue with how we execute powershell on this host when it has powershell 5? Seems like problem is at: // check PS is available and is of proper version
|
Excellent - I pulled your changes back into my branch for testing. Since your packerfiles seem to have all needed changes, I may just close this one. Also, I should mention that this isn't specific to Windows 10 Insider Preview builds. I'm running the same Vagrant & Packer builds on my Windows 10 - 1511 machine. Specific build info |
Thanks for your help starting this enhancement. |
Using https://dl.bintray.com/taliesins/Packer/Packer.1.0.0.104-HyperV.nupkg
packer build -var 'hyperv_switchname=Ethernet' -var 'iso_url=./server2016tp5.iso' .\windows _2016_docker.json
fails:
The text was updated successfully, but these errors were encountered: