-
Notifications
You must be signed in to change notification settings - Fork 51
Packer plugin not working well with VMware Fusion Pro 13.0 on M1-based chipset. #108
Description
Overview of the Issue
packer build <template> command dies immediately upon launch with the following error message:
2022/12/26 19:56:46 packer-builder-vmware-iso plugin: Executing: /Applications/VMware Fusion.app/Contents/Library/vmrun -T fusion start builds/rocky9-base/rocky9-base.vmx nogui
2022/12/26 19:56:46 packer-builder-vmware-iso plugin: stdout: 2022-12-26T19:56:46.812| ServiceImpl_Opener: PID 10561
2022/12/26 19:56:46 packer-builder-vmware-iso plugin: Error: The operation was canceled
2022/12/26 19:56:46 packer-builder-vmware-iso plugin: stderr:
==> vmware-iso: Error: The operation was canceled
==> vmware-iso: Error starting VM: VMware error: 2022-12-26T19:56:46.812| ServiceImpl_Opener: PID 10561
==> vmware-iso: Error: The operation was canceled
Upon closer examination of the available vmware.log, I found more clarifying details about the specific error condition:
2022-12-26T08:22:01.269Z In(05) vmx Command line: "/Applications/VMware Fusion.app/Contents/Library/vmware-vmx" "-s" "vmx.noUIBuildNumberCheck=TRUE" "-#" "product=1;name=vmrun;version=1.17.0;buildnumber=20802013;licensename=VMware Fusion for Mac OS;licenseversion=13.0;" "-@" "duplex=3;msgs=ui" "/Users/<<user>/workspace/sandboxes/builds/rocky9-base/rocky9-base.vmx"
2022-12-26T08:22:01.269Z In(05) vmx Msg_SetLocaleEx: HostLocale=UTF-8 UserLocale=en
.
.
.
2022-12-26T08:22:01.361Z In(05) vmx Msg_Post: Error
2022-12-26T08:22:01.361Z In(05) vmx [msg.guestos.badArch] This virtual machine cannot be powered on because it requires the X86 machine architecture, which is incompatible with this Arm machine architecture host. See KB-84273.
2022-12-26T08:22:01.361Z In(05) vmx ----------------------------------------
2022-12-26T08:22:01.361Z In(05) vmx MsgIsAnswered: Using builtin default 'OK' as the answer for 'msg.guestos.badArch'
2022-12-26T08:22:01.361Z In(05) vmx Module 'GuestOS' power on failed.
I was able to build a guest VM manually using VMware Fusion Pro 13.0 on my MacBook Air with M1 without issue. When reviewing the vmware.log from that successful run, I noticed the generated command-line for the vmware-vmx invocation was different. The options after the Product-specific settings (after the -# flag) had product=64, instead of product=1 as seen from the packer-generated command-line.
2022-12-27T03:15:27.776Z In(05) vmx Command line: "/Applications/VMware Fusion.app/Contents/Library/vmware-vmx" "-E" "en" "-s" "vmx.stdio.keep=TRUE" "-#" "product=64;name=VMware Fusion;version=13.0.0;buildnumber=20802013;licensename=VMware Fusion for Mac OS;licenseversion=13.0;" "-@" "duplex=3;msgs=ui" "-D" "4" "/Users/<user>/Virtual Machines.localized/rocky-minimal-base.vmwarevm/rocky-minimal-base.vmx"
System Setup
System: MacBook Air, M1 2020
OS: macOS Ventura 13.1
Hypervisor Software: VMware Fusion Pro 13.0
Packer Version: 1.8.5
Packer Plugin: packer-plugin-vmware_v1.0.7_x5.0_darwin_arm64
Full VMware Log
https://gist.github.com/yhuang/2d872ae318e3d293d38aa9bc312389b1
Packer Log
https://gist.github.com/yhuang/b6ba61121a19f8317993fca0c096a5aa