When defining a virtualbox-iso runner with "cpus": 2, a VM configuration will be created where the machine has multiple cores but IO-APIC is disabled.
This is indicated as invalid when opening the VM settings in VirtualBox and will automatically be fixed once the settings are saved via the UI and the machine rebooted (but not on the first boot).
This can be fixed manually by running modifyvm --ioapic on on that VM, but this should really be done internally by packer if more than one CPU core is enabled.
For 64-bit machines this does not appear to be an issue, since IO-APIC is mandated on 64-bit and probably handled by the template that is chosen through ostype.
Reproduction Steps
Start a packer run using PACKER_LOG=1 packer build -debug template.json (where template.json is the attached template JSON)
Inspect the Settings UI for the created VirtualBox machine, where an icon will show up in the bottom (with more information showing when hovering over it)
Overview of the Issue
When defining a
virtualbox-iso
runner with"cpus": 2
, a VM configuration will be created where the machine has multiple cores but IO-APIC is disabled. This is indicated as invalid when opening the VM settings in VirtualBox and will automatically be fixed once the settings are saved via the UI and the machine rebooted (but not on the first boot).This can be fixed manually by running
modifyvm --ioapic on
on that VM, but this should really be done internally by packer if more than one CPU core is enabled.For 64-bit machines this does not appear to be an issue, since IO-APIC is mandated on 64-bit and probably handled by the template that is chosen through
ostype
.Reproduction Steps
PACKER_LOG=1 packer build -debug template.json
(wheretemplate.json
is the attached template JSON)Plugin and Packer version
Simplified Packer Buildfile
Template JSON
``` { "builders": [ { "type": "virtualbox-iso", "name": "debian10", "vm_name": "packer-debian10", "output_directory": "output/debian10", "boot_wait": "10s", "boot_keygroup_interval": "1s", "disk_size": 20480, "cpus": 2, "memory": 2048, "guest_os_type": "Debian", "headless": true, "vrdp_bind_address": "127.0.0.1", "vrdp_port_min": 11000, "vrdp_port_max": 12000, "iso_url": "https://cdimage.debian.org/cdimage/archive/10.10.0/i386/iso-cd/debian-10.10.0-i386-netinst.iso", "iso_checksum": "sha256:cf824084643fb82f74d1fbec804baaf74539dadd279af2098da94254f758e5b7", "ssh_username": "root", "ssh_password": "vagrant", "ssh_port": 22, "ssh_timeout": "3600s", "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now" } ] } ```Operating system and Environment details
OS: Arch Linux Host architecture: amd64 Guest architecture: i386/i686
Log Fragments and crash.log files
Debug output of stepCreateVM
``` 2021/08/21 15:37:23 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"createvm", "--name", "packer-debian10", "--ostype", "Debian", "--register"} 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: stdout: Virtual machine 'packer-debian10' is created and registered. 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: UUID: 0099d7bf-9aef-4329-b9ca-6eedcb205f38 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: Settings file: '/home/tim/.vbox/packer-debian10/packer-debian10.vbox' 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--boot1", "disk", "--boot2", "dvd", "--boot3", "none", "--boot4", "none"} 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--cpus", "2"} 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:27 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--memory", "2048"} 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--usb", "off"} 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--audio", "none", "--audiocontroller", "ac97"} 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--chipset", "piix3"} 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--firmware", "bios"} 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--nictype1", "82540EM", "--nictype2", "82540EM", "--nictype3", "82540EM", "--nictype4", "82540EM", "--nictype5", "82540EM", "--nictype6", "82540EM", "--nictype7", "82540EM", "--nictype8", "82540EM"} 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--graphicscontroller", "vboxvga", "--vram", "4"} 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--rtcuseutc", "off"} 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stderr: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: Executing VBoxManage: []string{"modifyvm", "packer-debian10", "--accelerate3d", "off"} 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stdout: 2021/08/21 15:37:28 packer-builder-virtualbox-iso plugin: stderr: ```