Skip to content

floppy_content not working on vmware builders #77

@fjcuadrado

Description

@fjcuadrado

Hi, recently I've discovered that the floppy_content statement doesn't work at all when used in conjunction with any of the vmware builders (vmware-iso or vmware-vmx) provided by this plugin.

Overview of the Issue

As the packer vmware plugin documentation states, there are some statements to configure a floppy disk in the virtual machine that's built by packer. This floppy disk is really useful for unattended Windows installs.

However, when the floppy_content statement is used no floppy disk is created by packer neither attached to the virtual machine. Any of the other statements (floppy_files or floppy_dirs) work as expected.

Reproduction Steps

Create a packer template with floppy_content, packer will ignore that option and build the template without creating the corresponding floppy disk.

Plugin and Packer version

packer 1.8.1
packer-plugin-vmware 1.0.7

Simplified Packer Buildfile

The following packer template can be used to reproduce the issue:

packer {
  required_version = "~> 1.8.1"

  required_plugins {
    vmware = {
      source = "github.com/hashicorp/vmware"
      version = ">= 1.0.0"
    }
  }
}

locals {
  alpine_base_url = "http://dl-cdn.alpinelinux.org/alpine/v3.16"
  alpine_iso_url  = "${local.alpine_base_url}/releases/x86_64/alpine-virt-3.16.0-x86_64.iso"
  alpine_iso_checksum_url = "${local.alpine_iso_url}.sha256"
  alpine_repository_url = "http://dl-cdn.alpinelinux.org/alpine/v3.16/main"
}

source "vmware-iso" "alpine" {
  iso_checksum = "file:${local.alpine_iso_checksum_url}"
  iso_url      = local.alpine_iso_url

  communicator = "none"
  headless     = false

  floppy_content = {
    "hello.txt" = "Hello world!"
  }

  boot_command = [
    "<wait5>",
    "root<enter>",
    "<wait>",
    "mount -t vfat /dev/fd0 /media/floppy<enter>",
    "<wait>",
    "cat /media/floppy/hello.txt<enter>",
    "<wait10>",
  ]
  boot_wait = "10s"
}

build {
  sources = ["vmware-iso.alpine"]
}

As you can see, this template is pretty simple. An alpine ISO is downloaded and a floppy must be created with a hello.txt file, at boot time the floppy disk is mounted and the hello.txt file is printed to stdout.

Operating system and Environment details

Debian 11.3
VMWare WS 16.2.3

Log Fragments and crash.log files

==> vmware-iso.alpine: Trying http://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86_64/alpine-virt-3.16.0-x86_64.iso?checksum=sha256%3Aba8007f74f9b54fbae3b2520da577831b4834778a498d732f091260c61aa7ca1
2022/06/17 06:56:48 packer-plugin-vmware_v1.0.7_x5.0_linux_amd64 plugin: 2022/06/17 06:56:48 Leaving retrieve loop for ISO
2022/06/17 06:56:48 packer-plugin-vmware_v1.0.7_x5.0_linux_amd64 plugin: 2022/06/17 06:56:48 No floppy files specified. Floppy disk will not be made.
2022/06/17 06:56:48 packer-plugin-vmware_v1.0.7_x5.0_linux_amd64 plugin: 2022/06/17 06:56:48 No CD files specified. CD disk will not be made.

Full log file

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions