Packer: VirtualBox Optical Drive not created as master in EFI mode

Created on 7 Dec 2018  ยท  7Comments  ยท  Source: hashicorp/packer

  • Packer version: 1.3.2
  • VirtualBox Version 5.2.22 r126460 (Qt5.6.3)
  • Host platform: macOS Mojave v10.14.1

When creating an EFI enabled VM, the optical drive isn't set to master (primary or secondary), this prevents the mounted ISO from being loaded and failing into the EFI shell.

The Optical drive should be an IDE secondary master, VirtualBox does this by default when creating a VM manually.

bug buildevirtualbox

Most helpful comment

ok, I finally got an ISO working in EFI mode without having to modify/attach another IDE device. All I had to do is force the iso_interface to be setup as a SATA drive instead of the default IDE mode by adding the following to my packer config.

      "iso_interface": "sata",
      "vboxmanage": [
        [ "modifyvm", "{{.Name}}", "--firmware", "EFI" ]
      ]

This will allow the ISO to be bootable.

All 7 comments

Getting the same issue. Virtualbox ISO cd does not load unless it was set to IDE secondary master for me in EFI mode.

Do either of you have a template for reproducing? It'll be way faster for me to get a patch in if I know how you're configuring this.

I got abit closer now to make Virtualbox in EFI mode boot an ISO. Since I didn't know how to modify the existing "IDE Controller" that the ISO file used to change the port, I had to modify my packer file to add a new IDE controller as type IDE primary master and manually attach the ISO that way under "vboxmanage" .

    "vboxmanage": [
        [ "modifyvm", "{{.Name}}", "--firmware", "EFI" ],
        [ "storageattach", "{{.Name}}", "--storagectl", "IDE Controller", "--port", "0", "--device", "0", "--type", "dvddrive", "--medium", "C:\centos8.iso"],
    ]

Of course, It would be better to be able to modify the port/device of the IDE Controller from within packer instead of me creating a new device.

Definitely. We have a fairly primitive driver for attaching disks; I won't get a chance to before the 1.4.5 release but adding more direct ability to control the storagectl commands could be something we aim for in the 1.5 release.

ok, I finally got an ISO working in EFI mode without having to modify/attach another IDE device. All I had to do is force the iso_interface to be setup as a SATA drive instead of the default IDE mode by adding the following to my packer config.

      "iso_interface": "sata",
      "vboxmanage": [
        [ "modifyvm", "{{.Name}}", "--firmware", "EFI" ]
      ]

This will allow the ISO to be bootable.

Awesome. So sounds like we have some work to do around making sure we set reasonable defaults, and add lots of documentation.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wduncanfraser picture wduncanfraser  ยท  3Comments

mwhooker picture mwhooker  ยท  3Comments

s4mur4i picture s4mur4i  ยท  3Comments

frezbo picture frezbo  ยท  3Comments

craigsimon picture craigsimon  ยท  3Comments