Skip to content

Wrong parameter in .vmx on Big Sur / VMware Fusion 12.2 Pro  #52

@devops-42

Description

@devops-42

Closed hashicorp/packer#11380 and moved to here:

Overview of the Issue

I tried to create a Linux VM (Fedora) using packer, kickstart and VMware Fusion 12.2 Pro. The Linux VM should run in a separate network vmnet5 I created before in VMware Fusion. After kicking the VM gots an IP address from the NAT network (Share with my Mac). But according to the VM settings the network adapter has been configured to use vmnet5.
When looking into the .vmx file created I saw, that there's a parameter:

ethernet.bsdname=en0

which refers to the main ethernet adapter of the Mac. If I remove this line, the VM booted into the right network.

Reproduction Steps

  • Create a packer file fedora.json (see below)
  • Create necessary kickstart files and place them into path
  • Start packer builder:
PACKER_LOG=1 packer build fedora.json 
  • Wait until VM is up and provides an emergency shell
  • Verify IP with ip a

Packer version

packer version:

Packer v1.7.8

Simplified Packer Template

{
  "builders": [
    {
      "boot_command": [
        "<tab> ",
        "inst.ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `ks_path`}} loglevel=10 ",
        "biosdevname=0 ",
        "net.ifnames=0 ",
        "<enter>"
      ],
      "boot_wait": "5s",
      "cpus": "2",
      "disk_adapter_type": "scsi",
      "disk_size": "10240",
      "disk_type_id": "0",
      "guest_os_type": "fedora64Guest",
      "http_directory": "/path/to/ks",
      "iso_checksum": "...",
      "iso_url": "/path/to/fedora-server-netinst.iso",
      "network": "vmnet5",
      "network_adapter_type": "e1000",
      "memory": "2048",
      "output_directory": "/path/to/output/directory}",
      "shutdown_command": "****",
	  "ssh..."
      "type": "vmware-iso",
      "vm_name": "test"
    }
  ]
}

Operating system and Environment details

MacOS Big Sur, 11.6

Log Fragments and crash.log files

Log files looked good, packer detected the network:

[...]
2021/11/04 10:58:28 packer-builder-vmware-iso plugin: Located networkmapper configuration file using Fusion6: /Library/Preferences/VMware Fusion/networking
2021/11/04 10:58:28 packer-builder-vmware-iso plugin: Writing VMX to: /PATH/TO/VM/fedora.vmx
2021/11/04 10:58:28 packer-builder-vmware-iso plugin: Configuring VMX...
2021/11/04 10:58:28 packer-builder-vmware-iso plugin: Setting VMX: 'virtualHW.version' = '18'
2021/11/04 10:58:28 packer-builder-vmware-iso plugin: Writing VMX to: /PATH/TO/VM/fedora.vmx
2021/11/04 10:58:28 packer-builder-vmware-iso plugin: Suppressing messages in VMX
2021/11/04 10:58:28 packer-builder-vmware-iso plugin: Located networkmapper configuration file using Fusion6: /Library/Preferences/VMware Fusion/networking
2021/11/04 10:58:28 packer-builder-vmware-iso plugin: HostIP discovered custom device matching vmnet5: vmnet5
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions