-
Notifications
You must be signed in to change notification settings - Fork 51
vmware-iso: Allow Architecture configuration for arm64/aarch64 #45
Description
This issue was originally opened by @MarkProminic in hashicorp/packer#10706 and has been migrated to this repository. The original issue description is below.
Community Note
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
Description
When the ESXI-Arm fling came out I was giddy with excitement about where this could lead. In my process of trying to get OctoPi installed on my freshly install ESXI 7 Raspberry Pi v4. I found that it wasn't super easy to convert everything over. So In their source, they include instructions for Vagrant, but since the Vagrant image uses debian\buster64 (arm64) and is only build for Virtualbox. I thought, how hard can it be to get Packer to build for ESXI on Raspberry Pi if I can get it to work on ESXI x86.
Well, after some trial an error creating a Packer json build file for it, I found that there is one setting left that I can't change in the builder variables. That is the Architecture in the VMX file:
architecture = "arm64"
is the variable in the VMX that I need to adjust, and I have confirmed that after adjusting this variable, I was able to get the invalid VMX configuration to change to valid an the VM would boot up.
I've searched the Github repo and I can see that there was a Architecture flag added for AWS/AMI instances. Would it be possible to get this flag added to the VMWare-ISO Module?
Use Case(s)
The ability to build and protoype different OS's rapidly on ESXI-Arm.
Working Configuration
.encoding = "UTF-8"
RemoteDisplay.maxConnections = "-1"
architecture = "arm64"
bios.bootorder = "hdd,cdrom"
cleanshutdown = "TRUE"
config.version = "8"
displayname = "DebianBuster641"
ehci.pcislotnumber = "34"
ehci.present = "TRUE"
ethernet0.bsdname = "en0"
ethernet0.connectiontype = "nat"
ethernet0.displayname = "Ethernet"
ethernet0.linkstatepropagation.enable = "FALSE"
ethernet0.pcislotnumber = "33"
extendedconfigfile = "DebianBuster641.vmxf"
firmware = "efi"
floppy0.present = "FALSE"
guestos = "debian10-64"
gui.fullscreenatpoweron = "FALSE"
gui.viewmodeatpoweron = "windowed"
hgfs.linkrootshare = "TRUE"
hgfs.maprootshare = "TRUE"
isolation.tools.hgfs.disable = "FALSE"
memsize = "4096"
msg.autoanswer = "true"
numvcpus = "2"
nvme0.present = "FALSE"
nvram = "DebianBuster641.nvram"
parallel0.autodetect = "FALSE"
parallel0.filename = ""
parallel0.present = "FALSE"
parallel0.startconnected = "FALSE"
pcibridge0.pcislotnumber = "17"
pcibridge0.present = "TRUE"
pcibridge4.functions = "8"
pcibridge4.pcislotnumber = "21"
pcibridge4.present = "TRUE"
pcibridge4.virtualdev = "pcieRootPort"
pcibridge5.functions = "8"
pcibridge5.pcislotnumber = "22"
pcibridge5.present = "TRUE"
pcibridge5.virtualdev = "pcieRootPort"
pcibridge6.functions = "8"
pcibridge6.pcislotnumber = "23"
pcibridge6.present = "TRUE"
pcibridge6.virtualdev = "pcieRootPort"
pcibridge7.functions = "8"
pcibridge7.pcislotnumber = "24"
pcibridge7.present = "TRUE"
pcibridge7.virtualdev = "pcieRootPort"
powertype.poweron = "soft"
powertype.suspend = "soft"
proxyapps.publishtohost = "FALSE"
replay.supported = "FALSE"
sched.cpu.affinity = "all"
sched.cpu.latencySensitivity = "normal"
sched.cpu.min = "0"
sched.cpu.shares = "normal"
sched.cpu.units = "mhz"
sched.mem.min = "0"
sched.mem.minSize = "0"
sched.mem.shares = "normal"
sched.scsi0:0.shares = "normal"
sched.scsi0:0.throughputCap = "off"
scsi0.pcislotnumber = "16"
scsi0.present = "TRUE"
scsi0.virtualdev = "pvscsi"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.filename = "disk.vmdk"
scsi0:0.present = "TRUE"
serial0.autodetect = "FALSE"
serial0.filename = ""
serial0.filetype = ""
serial0.pipe.endpoint = ""
serial0.present = "FALSE"
serial0.startconnected = "FALSE"
serial0.trynorxloss = ""
serial0.yieldonmsrread = ""
sound.autodetect = "TRUE"
sound.filename = "-1"
sound.present = "FALSE"
sound.startconnected = "FALSE"
svga.autodetect = "TRUE"
toolScripts.afterPowerOn = "TRUE"
toolScripts.afterResume = "TRUE"
toolScripts.beforePowerOff = "TRUE"
toolScripts.beforeSuspend = "TRUE"
tools.guest.desktop.autolock = "FALSE"
tools.synctime = "FALSE"
tools.upgrade.policy = "manual"
usb.pcislotnumber = "32"
usb.present = "FALSE"
uuid.action = "create"
virtualhw.productcompatibility = "hosted"
virtualhw.version = "17"
vmci0.id = "1861462627"
vmci0.pcislotnumber = "35"
vmci0.present = "TRUE"
vmotion.checkpointfbsize = "65536000"
Currently Generated Packer Configuration:
.encoding = "UTF-8"
RemoteDisplay.maxConnections = "-1"
bios.bootorder = "hdd,cdrom"
cleanshutdown = "TRUE"
config.version = "8"
displayname = "DebianBuster641"
ehci.pcislotnumber = "34"
ehci.present = "TRUE"
ethernet0.bsdname = "en0"
ethernet0.connectiontype = "nat"
ethernet0.displayname = "Ethernet"
ethernet0.linkstatepropagation.enable = "FALSE"
ethernet0.pcislotnumber = "33"
extendedconfigfile = "DebianBuster641.vmxf"
firmware = "efi"
floppy0.present = "FALSE"
guestos = "debian10-64"
gui.fullscreenatpoweron = "FALSE"
gui.viewmodeatpoweron = "windowed"
hgfs.linkrootshare = "TRUE"
hgfs.maprootshare = "TRUE"
isolation.tools.hgfs.disable = "FALSE"
memsize = "4096"
msg.autoanswer = "true"
numvcpus = "2"
nvme0.present = "FALSE"
nvram = "DebianBuster641.nvram"
parallel0.autodetect = "FALSE"
parallel0.filename = ""
parallel0.present = "FALSE"
parallel0.startconnected = "FALSE"
pcibridge0.pcislotnumber = "17"
pcibridge0.present = "TRUE"
pcibridge4.functions = "8"
pcibridge4.pcislotnumber = "21"
pcibridge4.present = "TRUE"
pcibridge4.virtualdev = "pcieRootPort"
pcibridge5.functions = "8"
pcibridge5.pcislotnumber = "22"
pcibridge5.present = "TRUE"
pcibridge5.virtualdev = "pcieRootPort"
pcibridge6.functions = "8"
pcibridge6.pcislotnumber = "23"
pcibridge6.present = "TRUE"
pcibridge6.virtualdev = "pcieRootPort"
pcibridge7.functions = "8"
pcibridge7.pcislotnumber = "24"
pcibridge7.present = "TRUE"
pcibridge7.virtualdev = "pcieRootPort"
powertype.poweron = "soft"
powertype.suspend = "soft"
proxyapps.publishtohost = "FALSE"
replay.supported = "FALSE"
sched.cpu.affinity = "all"
sched.cpu.latencySensitivity = "normal"
sched.cpu.min = "0"
sched.cpu.shares = "normal"
sched.cpu.units = "mhz"
sched.mem.min = "0"
sched.mem.minSize = "0"
sched.mem.shares = "normal"
sched.scsi0:0.shares = "normal"
sched.scsi0:0.throughputCap = "off"
scsi0.pcislotnumber = "16"
scsi0.present = "TRUE"
scsi0.virtualdev = "pvscsi"
scsi0:0.deviceType = "scsi-hardDisk"
scsi0:0.filename = "disk.vmdk"
scsi0:0.present = "TRUE"
serial0.autodetect = "FALSE"
serial0.filename = ""
serial0.filetype = ""
serial0.pipe.endpoint = ""
serial0.present = "FALSE"
serial0.startconnected = "FALSE"
serial0.trynorxloss = ""
serial0.yieldonmsrread = ""
sound.autodetect = "TRUE"
sound.filename = "-1"
sound.present = "FALSE"
sound.startconnected = "FALSE"
svga.autodetect = "TRUE"
toolScripts.afterPowerOn = "TRUE"
toolScripts.afterResume = "TRUE"
toolScripts.beforePowerOff = "TRUE"
toolScripts.beforeSuspend = "TRUE"
tools.guest.desktop.autolock = "FALSE"
tools.synctime = "FALSE"
tools.upgrade.policy = "manual"
usb.pcislotnumber = "32"
usb.present = "FALSE"
uuid.action = "create"
virtualhw.productcompatibility = "hosted"
virtualhw.version = "17"
vmci0.id = "1861462627"
vmci0.pcislotnumber = "35"
vmci0.present = "TRUE"
vmotion.checkpointfbsize = "65536000"
Current JSON Build File
{
"builders": [
{
"name": "DebianBuster641",
"type": "vmware-iso",
"vm_name": "DebianBuster641",
"network": "lan",
"guest_os_type": "debian11-64",
"tools_upload_flavor": "linux",
"headless": true,
"vnc_over_websocket": true,
"insecure_connection": true,
"iso_urls": ["iso/ubuntu-18.04.5-server-amd64.iso",
"http://cdimage.ubuntu.com/ubuntu/releases/18.04/release/ubuntu-18.04.5-server-amd64.iso"
],
"iso_checksum": "8c5fc24894394035402f66f3824beb7234b757dd2b5531379cb310cedfdf0996",
"cpus": 2,
"memory": 4096,
"disk_size": 20140,
"disk_type_id": "thin",
"boot_wait": "10s",
"boot_command": [
"<esc><wait>",
"<esc><wait>",
"<enter><wait>",
"/install/vmlinuz",
" initrd=/install/initrd.gz ",
"auto=true ",
"url=https://gist.githubusercontent.com/G0nz0uk/22afe85abc8a1b008602f79b381ea262/raw/ef166effdbdc12b6dc00e40fe5e194181a6b06d4/preseed1.cfg ",
"fb=false ",
"auto=true ",
"language=en ",
"locale=en_GB ",
"priority=critical ",
"keymap=uk ",
"netcfg/get_hostname={{ .Name }} ",
"netcfg/get_domain=vm ",
"debconf/frontend=noninteractive ",
"debian-installer/country=US ",
"console-setup/ask_detect=false ",
"console-keymaps-US/keymap=us ",
"DEBCONF_DEBUG=5 ",
"<enter>"
],
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "20m",
"shutdown_command": "sudo systemctl poweroff",
"vnc_disable_password": true,
"format": "vmx",
"remote_type": "esx5",
"version": 17,
"remote_host": "{{user `esxi_host`}}",
"remote_datastore": "{{user `esxi_datastore`}}",
"remote_username": "{{user `esxi_username`}}",
"remote_password": "{{user `esxi_password`}}",
"keep_registered": true,
"skip_export": true
,
"vmx_data": {
"ethernet0.networkName": "lan"
}
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "echo '{{user `ssh_password`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"inline": [
"apt-get update",
"apt-get install -y",
"echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"
]
}
]
}
References to get me this far
https://www.virtuallyghetto.com/2020/10/how-to-run-raspberry-pi-os-as-a-vm-on-esxi-arm.html
https://www.reddit.com/r/homelab/comments/lemdr4/trying_to_use_packer_with_single_esxi_host_for/
https://www.reddit.com/r/vmware/comments/lfbzw9/packer_almost_working_with_my_esxi_host_lab_just/