Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cd_files not working properly on vmware-iso #10935

Closed
t0rr3sp3dr0 opened this issue Apr 20, 2021 · 3 comments
Closed

cd_files not working properly on vmware-iso #10935

t0rr3sp3dr0 opened this issue Apr 20, 2021 · 3 comments

Comments

@t0rr3sp3dr0
Copy link

Overview of the Issue

The latest version of Packer doesn't seem to attach the cd_files generated ISO to the VM upon start.

It only works when adding the following setting:

  vmx_data = {
    "sata1.present": "TRUE",
  }

Reproduction Steps

  1. run packer build
  2. check that the VM doesn't have the generated ISO attached

Packer version

Packer v1.7.2

Simplified Packer Buildfile

source "vmware-iso" "big-sur" {
  # VMware-ISO Builder Configuration Reference
  cdrom_adapter_type = "sata"
  guest_os_type = "darwin20-64"
  version = 18

  # Extra Disk Configuration
  disk_adapter_type = "nvme"
  disk_type_id = 0

  # ISO Configuration
  iso_checksum = "file:./Install macOS Big Sur.cdr.sum"
  iso_url = "./Install macOS Big Sur.cdr"

  # CD configuration
  cd_files = [
    "./init.sh",
  ]

  # Shutdown configuration
  shutdown_command = "sudo shutdown -h now"

  # Communicator configuration
  communicator = "ssh"
  ssh_username = "user"
  ssh_password = "pass"
}

build {
  name = "vmware-iso"

  sources = [
    "sources.vmware-iso.big-sur",
  ]
}

Operating system and Environment details

macOS Big Sur Version 11.2.3 (20D91)
VMware Fusion Player Version 12.1.1 (17801503)

Log Fragments and crash.log files

2021/04/20 00:01:31 [INFO] Packer version: 1.7.2 [go1.16.3 darwin amd64]
2021/04/20 00:01:31 [TRACE] discovering plugins in /usr/local/bin
2021/04/20 00:01:31 [TRACE] discovering plugins in /Users/pedro/.packer.d/plugins
2021/04/20 00:01:31 [TRACE] discovering plugins in .
2021/04/20 00:01:31 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/04/20 00:01:31 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/pedro/.packerconfig
2021/04/20 00:01:31 [WARN] Config file doesn't exist: /Users/pedro/.packerconfig
2021/04/20 00:01:31 [INFO] Setting cache directory: /var/folders/mc/smgjlfwx7x7dqzllygvlkly00000gn/T/tmp.FHZeHndKa0/packer_cache
2021/04/20 00:01:31 [TRACE] Starting internal plugin packer-builder-vmware-iso
2021/04/20 00:01:31 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-vmware-iso"}
2021/04/20 00:01:31 Waiting for RPC address for: /usr/local/bin/packer
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: [INFO] Packer version: 1.7.2 [go1.16.3 darwin amd64]
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/pedro/.packerconfig
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: [WARN] Config file doesn't exist: /Users/pedro/.packerconfig
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: [INFO] Setting cache directory: /var/folders/mc/smgjlfwx7x7dqzllygvlkly00000gn/T/tmp.FHZeHndKa0/packer_cache
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: args: []string{"packer-builder-vmware-iso"}
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Plugin address: unix /var/folders/mc/smgjlfwx7x7dqzllygvlkly00000gn/T/packer-plugin743236302
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Waiting for connection...
2021/04/20 00:01:31 Received unix RPC address for /usr/local/bin/packer: addr is /var/folders/mc/smgjlfwx7x7dqzllygvlkly00000gn/T/packer-plugin743236302
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Serving a plugin connection...
2021/04/20 00:01:31 Build debug mode: false
2021/04/20 00:01:31 Force build: false
2021/04/20 00:01:31 On error: 
2021/04/20 00:01:31 Waiting on builds to complete...
2021/04/20 00:01:31 Starting build run: vmware-iso.vmware-iso.box
2021/04/20 00:01:31 Running builder: 
2021/04/20 00:01:31 [INFO] (telemetry) Starting builder 
vmware-iso.vmware-iso.box: output will be in this color.

2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Detected VMware version: 12
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Testing against vmware driver *common.Fusion6Driver, Success: true
==> vmware-iso.vmware-iso.box: Retrieving ISO
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Acquiring lock for: ./Install%20macOS%20Big%20Sur.cdr?checksum=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (/var/folders/mc/smgjlfwx7x7dqzllygvlkly00000gn/T/tmp.FHZeHndKa0/packer_cache/81fec7813499d6750363f9c7d57fbded7d9e232c.iso.lock)
==> vmware-iso.vmware-iso.box: Trying ./Install macOS Big Sur.cdr
==> vmware-iso.vmware-iso.box: Trying ./Install%20macOS%20Big%20Sur.cdr?checksum=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Leaving retrieve loop for ISO
==> vmware-iso.vmware-iso.box: ./Install%20macOS%20Big%20Sur.cdr?checksum=sha256%3Ae3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 => /var/folders/mc/smgjlfwx7x7dqzllygvlkly00000gn/T/tmp.FHZeHndKa0/Install macOS Big Sur.cdr
==> vmware-iso.vmware-iso.box: Configuring output and export directories...
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: No floppy files specified. Floppy disk will not be made.
==> vmware-iso.vmware-iso.box: Creating CD disk...
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: CD path: /var/folders/mc/smgjlfwx7x7dqzllygvlkly00000gn/T/packer587008816.iso
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Wrote 0 bytes to init.sh
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Executing: /usr/bin/hdiutil [makehybrid -o /var/folders/mc/smgjlfwx7x7dqzllygvlkly00000gn/T/packer587008816.iso -hfs -joliet -iso -default-volume-name packer /var/folders/mc/smgjlfwx7x7dqzllygvlkly00000gn/T/packer_to_cdrom357419727]
    vmware-iso.vmware-iso.box: Creating hybrid image...
    vmware-iso.vmware-iso.box: Done copying paths from CD_dirs
==> vmware-iso.vmware-iso.box: Creating required virtual machine disks
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: [INFO] Creating disk with Path: output-box/disk.vmdk and Size: 40000M
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Executing: /Applications/VMware Fusion.app/Contents/Library/vmware-vdiskmanager -c -s 40000M -a nvme -t 0 output-box/disk.vmdk
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: stdout: Creating disk 'output-box/disk.vmdk'
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Virtual disk creation successful.
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: stderr:
==> vmware-iso.vmware-iso.box: Building and writing VMX file
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Located networkmapper configuration file using Fusion6: /Library/Preferences/VMware Fusion/networking
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Writing VMX to: output-box/packer-box.vmx
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Configuring VMX...
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Writing VMX to: output-box/packer-box.vmx
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Suppressing messages in VMX
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Located networkmapper configuration file using Fusion6: /Library/Preferences/VMware Fusion/networking
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: HostIP discovered device matching nat: vmnet8
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Host IP for the VMware machine: 172.16.96.1
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Looking for available port between 5900 and 6000
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Found available port: 5967 on IP: 127.0.0.1
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Found available VNC port: 127.0.0.1:5967
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Writing VMX to: output-box/packer-box.vmx
==> vmware-iso.vmware-iso.box: Starting virtual machine...
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: Executing: /Applications/VMware Fusion.app/Contents/Library/vmrun -T fusion start output-box/packer-box.vmx gui
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: stdout:
2021/04/20 00:01:31 packer-builder-vmware-iso plugin: stderr:
@SwampDragons
Copy link
Contributor

Hi, thanks for reaching out. We'll try to take a look when we get a chance. Until then, I'm glad the vmx_data gives you a workaround.

@ghost
Copy link

ghost commented Apr 22, 2021

This issue has been automatically migrated to hashicorp/packer-plugin-vmware#15 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-vmware#15.

@ghost
Copy link

ghost commented May 23, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators May 23, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants