Hashicorp Packer将不会在Windows主机上执行packer-provisioner-shell

这是我的第一个问题。 我试图遵循所有的指导方针。

我试图用Packer来创build一个Debian 8的Vagrant镜像。如果我运行一个只有“builders”模板的打包工具,它将会成功执行并生成一个Virtualbox镜像。 当我试图添加“提供者”和/或“后处理器”模板时,我开始犯错。 约10秒内发生错误。 它不会运行的build设者。 错误消息是:

ui error: Failed to initialize build 'virtualbox-iso': error initializing provisioner 'shell': dial tcp 127.0.0.1:10000: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. 

我已经在这几天工作了。 我有:

  • searchGoogle的错误文本
  • 通读一些Packer的源码(以为我不熟悉Go)
  • 从Packer.io中重新安装Packer
  • 确保文件畅通无阻
  • 作为我的默认用户和pipe理员执行
  • 使用Git Bash而不是cmd.exe
  • 从Powershell执行
  • 使用Atlas提供的atlas-packer-vagrant-tutorial。 它将build立在阿特拉斯,但不是在本地。

我的包装模板文件:

 { "provisioners": [{ "type": "shell", "scripts": [ "scripts/vagrant.sh" ], "override": { "virtualbox-iso": { "execute_command": "echo 'vagrant' | sudo -S bash '{{.Path}}'" } } }], "builders": [{ "type": "virtualbox-iso", "guest_os_type": "Debian_64", "iso_url": "http://cdimage.debian.org/debian-cd/8.2.0/amd64/iso-cd/debian-8.2.0-amd64-CD-1.iso", "iso_checksum": "234bd43d85974299d501f370ac3e7592b98832d98f82be3aff190ff3af831f8cd7574a75f4c9b36c347f138e82ccb40ff3746a4c94e7d59e4ee711e0c96dbf1d", "iso_checksum_type": "sha512", "ssh_username": "vagrant", "ssh_password": "vagrant", "ssh_wait_timeout": "120m", "shutdown_command": "echo 'vagrant' | sudo -S shutdown -h now", "disk_size": "20480", "http_directory": "http", "boot_command": [ "<esc><wait>", "auto url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", "<enter>" ], "vboxmanage": [ ["modifyvm", "{{.Name}}", "--memory", "4096"], ["modifyvm", "{{.Name}}", "--cpus", "2"] ] }], "post-processors": ["vagrant"] } 

我没有足够的信誉来添加其他链接。 TCP视图输出:

 packer-provisioner-shell.exe 3940 TCP 127.0.0.1 10000 0.0.0.0 0 LISTENING packer-builder-virtualbox-iso.exe 11284 TCP 127.0.0.1 10000 127.0.0.1 49568 ESTABLISHED packer.exe 12180 TCP 127.0.0.1 49568 127.0.0.1 10000 ESTABLISHED packer.exe 12180 TCP 127.0.0.1 49571 127.0.0.1 10000 SYN_SENT 

系统信息:

  • Windows 7 Pro SP1(64位)
  • 打包机0.8.6

我的完整代码是在Github 回购

我的完整错误login在这个Gist

感谢您的任何帮助,您可以提供。

我有一个与Windows上的包装器相似的问题,但我可以正确地建立(在vagrant规定的错误都是一样的)。

但是,您可以使用或比较另一个项目打包器,这个项目打包器在您的项目中正确运行。 也许找到一个解决或理解其他概念的方法可以帮助你: 打包者Ubuntu项目

正如Gregory Nisbet指出的那样,这是一个防火墙问题。 我停止了所有的McAfee服务,并且能够继续。