0
votes

Packer version: Packer v1.3.3

Host Platform: MacOS Mojave 10.14.2 (18C54)

Hello, I'm trying to build a really simple vmware-iso (local not remote). The build starts, gets through the first couple of steps but then hangs on ==> vmware-iso: Waiting for SSH to become available... until the shh_wait timeout is reached (I've tried several different wait times). If running with headless set to false, the ubuntu provisioning vm shows a screen in which it's setting up the drives and is about to format them. Any ideas what would cause ssh availability to hang even though it looks as though it worked fine in a previous step?

{
  "variables": {},
  "builders": [
    {
      "type": "vmware-iso",
      "iso_url": "http://releases.ubuntu.com/bionic/ubuntu-18.04.1.0-live-server-amd64.iso",
      "iso_checksum": "188741f61c23d112a2564b0a864e25a3",
      "iso_checksum_type": "MD5",
      "guest_os_type": "ubuntu-64",
      "ssh_username": "dev",
      "ssh_password": "dev",
      "vm_name": "sqldb-vmware",
      "ssh_port": 22,
      "ssh_wait_timeout": "10m",
      "vmx_data": {
        "numvcpus": "2",
        "memsize": "2048"
      },
      "http_directory" : "http",
      "boot_command": [
        "<esc><wait>",
        "<esc><wait>",
        "<enter><wait>",
        "/install/vmlinuz<wait>",
        " auto<wait>",
        " console-setup/ask_detect=false<wait>",
        " console-setup/layoutcode=us<wait>",
        " console-setup/modelcode=pc105<wait>",
        " debconf/frontend=noninteractive<wait>",
        " debian-installer=en_US<wait>",
        " fb=false<wait>",
        " initrd=/install/initrd.gz<wait>",
        " kbd-chooser/method=us<wait>",
        " keyboard-configuration/layout=USA<wait>",
        " keyboard-configuration/variant=USA<wait>",
        " locale=en_US<wait>",
        " netcfg/get_domain=vm<wait>",
        " netcfg/get_hostname=ubuntubase<wait>",
        " grub-installer/bootdev=/dev/sda<wait>",        
        " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg<wait>",
        " -- <wait>",
        "<enter><wait>"
      ],
      "boot_wait": "20s",
      "shutdown_command": "echo 'packer' | sudo -S shutdown -P now"
    }
  ]
}

Packer Debug Log: https://gist.github.com/spstratis/73f4d662fd93917fb7e4a2278a5854f5

This is what is displayed on the builder VM while waiting for SSH to become available. Display on VM while waiting for SSH

1
What's the content of your preseed.cfg? And add a screenshot of the VM console when packer is waiting for SSH and the preseed install finished.Rickard von Essen
is the preseed.cfg a file that I create and need to put on the machine?Stavros_S
If this is the first time you use Packer I suggest that you start from an existing template, for example github.com/chef/bento. And if you don't know preseed, you need to read the preseed docs wiki.debian.org/DebianInstaller/Preseed. And yes need to create/have a preseed.cfg in the http directory.Rickard von Essen
I actually have used packer to build out windows instances in AWS. This is my fist time having to build out an Ubuntu linux iso for VMWare though. I guess I'm just not familiar with how to drop the preseed file onto the vm while it's building the iso. I'll do some reading.Stavros_S

1 Answers

1
votes

You need to have a preseed.cfg in the http directory with instructions for the installer howto install Ubuntu, see Preseed wiki for more info on Preseed.