3

This is my 1st question. I attempted to follow all of the guidelines.

I am attempting to use Packer to create a Vagrant image of Debian 8. If I run a packer build with only the "builders" template it will execute successfully and a Virtualbox image will be produced. When I attempted to add the "provisioners" and/or "post-processers" templates, I started to error. The error occurs within about 10 seconds. It won't run the builder. The error message is:

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.

I have been working on this for a few days now. I have:

  • search Google for the error text
  • read through some of the Packer source (thought I am not familiar with Go)
  • reinstalled Packer with a fresh download from Packer.io
  • ensured the files are unblocked
  • executed as my default user and administrator
  • used Git Bash instead of cmd.exe
  • executed from Powershell
  • Used the atlas-packer-vagrant-tutorial as provided by Atlas. It will build on Atlas, but not locally.

My Packer template file:

{
    "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"]
}

I don't have enough reputation to add additional links. The TCP View output:

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

System Info:

  • Windows 7 Pro SP1 (64-bit)
  • Packer 0.8.6

My full code is on Github repo

My full error log in in this Gist

Thanks for any help you can provide.

  • 1
    What are your firewall settings? Can you try temporarily disabling Windows Firewall? I'm looking at line 62 of the error log `2015/12/27 19:36:24 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.` – Greg Nisbet Dec 28 '15 at 01:15
  • @GregoryNisbet Thanks for the reply. My company uses McAfee Host Intrusion Prevention and overrides Windows Firewall. I attempted to run again while monitoring the McAfee logs. There was no blocked traffic. I also used TCP View to monitor network activity. I'll add the details to the post. It looks like packer-builder-virtualbox-iso.exe can establish a connection on port 10000, but packer-provisioner-shell.exe cannot. – Matthew L Shields Dec 28 '15 at 22:20
  • I updated the template to include the data for Atlas. If I push the template to Atlas it will build correctly. It is only on my local machine where I can't do a build. – Matthew L Shields Dec 29 '15 at 22:01

2 Answers2

0

I have a little similary problem with packer on windows host but me I can build correctly (provisionning error in vagrant all the same).

But you can use or compare an another project packer which run correctly for me with your project. Perhaps find a way to resolve or understand other concept can help you : packer ubuntu project

miltone
  • 4,416
  • 11
  • 42
  • 76
0

As Gregory Nisbet pointed out, this is a firewall issue. I stopped all McAfee services and I was able to proceed.