Hi everybody. I start to work with packer on VMware Workstation Pro 16.2.2 (Windows). But I fail to get even the basics running.
Short:
What I get is:
Build 'vmware-iso.ubuntu-live-server' errored after 4 seconds 841 milliseconds: Could not determine network mappings from files in path: C:/Program Files (x86)/VMware/VMware Workstation
Tried these templates, both fail alike:
source "vmware-iso" "basic-example" {
iso_checksum = "sha256:28ccdb56450e643bad03bb7bcf7507ce3d8d90e8bf09e38f6bd9ac298a98eaad"
iso_urls = ["iso/ubuntu-20.04.4-live-server-amd64.iso", "https://releases.ubuntu.com/20.04/ubuntu-20.04.4-live-server-amd64.iso"]
ssh_username = "packer"
ssh_password = "packer"
shutdown_command = "shutdown -P now"
}
build {
sources = ["sources.vmware-iso.basic-example"]
}
(And yes this is the example from the docs.)
My own attempt is derived from some example on the Internet:
packer {
required_plugins {
vmware = {
version = ">= 1.0.3"
source = "github.com/hashicorp/vmware"
}
}
}
# source blocks are generated from your builders; a source can be referenced in
# build blocks. A build block runs provisioner and post-processors on a
# source. Read the documentation for source blocks here:
# https://www.packer.io/docs/templates/hcl_templates/blocks/source
source "vmware-iso" "ubuntu-live-server" {
boot_command = ["<enter><enter><f6><esc><wait> ", "autoinstall ds=nocloud-net;seedfrom=http://{{ .HTTPIP }}:{{ .HTTPPort }}/", "<enter><wait>"]
boot_wait = "5s"
guest_os_type = "ubuntu-64"
http_directory = "http"
# Vormals "subiquiti/http" , warum auch immer
iso_checksum = "sha256:28ccdb56450e643bad03bb7bcf7507ce3d8d90e8bf09e38f6bd9ac298a98eaad"
iso_urls = ["iso/ubuntu-20.04.4-live-server-amd64.iso", "https://releases.ubuntu.com/20.04/ubuntu-20.04.4-live-server-amd64.iso"]
memory = 1024
output_directory = "output/live-server"
shutdown_command = "shutdown -P now"
ssh_handshake_attempts = "20"
ssh_password = "ubuntu"
ssh_pty = true
ssh_timeout = "20m"
ssh_username = "ubuntu"
}
# a build block invokes sources and runs provisioning steps on them. The
# documentation for build blocks can be found here:
# https://www.packer.io/docs/templates/hcl_templates/blocks/build
build {
sources = ["source.vmware-iso.ubuntu-live-server"]
provisioner "shell" {
inline = ["ls /"]
}
}
I am absolutely aware that there may be tons of mistakes in the longer script. I was just starting to tailor this from an example on the Internet, turned json into hcl, fixed the previous naming of the source having an excess dot. Then the network mapping stopped my from further fixing. But the short example from the docs of Hashicorp fail alike, so what happened?
The log output is:
> packer build .\simple.pkr.hcl
vmware-iso.basic-example: output will be in this color.
==> vmware-iso.basic-example: Retrieving ISO
==> vmware-iso.basic-example: Trying iso/ubuntu-20.04.4-live-server-amd64.iso
==> vmware-iso.basic-example: Trying iso/ubuntu-20.04.4-live-server-amd64.iso?checksum=sha256%3A28ccdb56450e643bad03bb7bcf7507ce3d8d90e8bf09e38f6bd9ac298a98eaad
==> vmware-iso.basic-example: iso/ubuntu-20.04.4-live-server-amd64.iso?checksum=sha256%3A28ccdb56450e643bad03bb7bcf7507ce3d8d90e8bf09e38f6bd9ac298a98eaad => C:\Users\Adrian Wallaschek\Projects\Packer-Ubuntu\packer_cache\47de2d7266acde194681de2a24f5d76b43b452ca.iso
==> vmware-iso.basic-example: Configuring output and export directories...
==> vmware-iso.basic-example: Creating required virtual machine disks
==> vmware-iso.basic-example: Building and writing VMX file
==> vmware-iso.basic-example: Could not determine network mappings from files in path: C:/Program Files (x86)/VMware/VMware Workstation
==> vmware-iso.basic-example: Deleting output directory...
Build 'vmware-iso.basic-example' errored after 4 seconds 329 milliseconds: Could not determine network mappings from files in path: C:/Program Files (x86)/VMware/VMware Workstation
==> Wait completed after 4 seconds 329 milliseconds
==> Some builds didn't complete successfully and had errors:
--> vmware-iso.basic-example: Could not determine network mappings from files in path: C:/Program Files (x86)/VMware/VMware Workstation
==> Builds finished but no artifacts were created.
The other template gives alike response.
My current assumption is: something is wrong or missing with my setup. I hardly believe the simple example from the docs should fail like this.
Any clue?
About me: I am seasoned in IT (SysAdmin, DBA, Developer,…) … 2.5 decades IT-Consultant, I am pretty fit with Vagrant, but I have no whatever clue about Packer … yet.
Could anyone be so kind to give me a hint, what and where to read and investigate to get over this issue?
Thanks in advance!
PS: I work on Windows, installed using chocolatey, Packer is updated to 1.7.10, also failed alike on 1.7.8. After upgrading Packer I did an init --upgrade to be sure the plugin did not require an upgrade as well.