I am running the latest packer 1.4.5 which now supports running NVMe support in the latest Virtualbox [I am running the latest 6.0.14]. To allow virtualbox to boot an NVMe device, you have force it in EFI mode and set the ISO interface to sata to allow ISO booting in EFI mode using the following config options.
"hard_drive_interface": "pcie",
"iso_interface": "sata",
"vboxmanage": [
[ "modifyvm", "{{.Name}}", "--firmware", "efi" ]
]
So it looks like packer sets the NVMe device and my CentOS 8 source can install onto it but it seems when packer is shutting down the virtualbox image and and it tries to export, the following error message occurs.
==> virtualbox-iso: Preparing to export machine...
virtualbox-iso: Deleting forwarded port mapping for the communicator (SSH, WinRM, etc) (host port 4429)
==> virtualbox-iso: Exporting virtual machine...
virtualbox-iso: Executing: export centos-8-baseinstall --output source_images\centos-8-source\centos-8-baseinstall.ova
==> virtualbox-iso: Error exporting virtual machine: VBoxManage error: VBoxManage.exe: error: Cannot handle medium attachment: storageBus is 7, channel is 0, device is 0
==> virtualbox-iso: VBoxManage.exe: error: Details: code VBOX_E_NOT_SUPPORTED (0x80bb0009), component MachineWrap, interface IMachine, callee IUnknown
==> virtualbox-iso: VBoxManage.exe: error: Context: "ExportTo(pAppliance, Bstr(pszAbsFilePath).raw(), pVSD.asOutParam())" at line 1343 of file VBoxManageAppliance.cpp
==> virtualbox-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
==> virtualbox-iso: Deregistering and deleting VM...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error exporting virtual machine: VBoxManage error: VBoxManage.exe: error: Cannot handle medium attachment: storageBus is 7, channel is 0, device is 0
VBoxManage.exe: error: Details: code VBOX_E_NOT_SUPPORTED (0x80bb0009), component MachineWrap, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "ExportTo(pAppliance, Bstr(pszAbsFilePath).raw(), pVSD.asOutParam())" at line 1343 of file VBoxManageAppliance.cpp
==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error exporting virtual machine: VBoxManage error: VBoxManage.exe: error: Cannot handle medium attachment: storageBus is 7, channel is 0, device is 0
VBoxManage.exe: error: Details: code VBOX_E_NOT_SUPPORTED (0x80bb0009), component MachineWrap, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "ExportTo(pAppliance, Bstr(pszAbsFilePath).raw(), pVSD.asOutParam())" at line 1343 of file VBoxManageAppliance.cpp
==> Builds finished but no artifacts were created.
This issue doesn't happen when using setting it from pcie -> back to sata mode nd putting it in bios mode.
Hi @breisig! Can you please provide a complete minimal buildfile? I'm finding difficult to reproduce this.
Same here, using Windows 10, Packer 1.5.1 and VirtualBox 6.1.2.
I tried with and without hard_drive_nonrotational
and hard_drive_discard
specified (ambiguous statement, I know, but I also argue these properties are or should be considered details).
I made a buildfile that reproduces this issue by modifying roboxes.org鈥檚 alpine install: https://gist.github.com/davecardwell/e44d5ce3dcd1395a52a33e15f8301251
Commented on the gist with the log output I see.
However, I believe the issue is with VirtualBox, not Packer, and it鈥檚 falling out of this switch statement:
https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp?rev=81682#L478
There is no branch for StorageBus_PCIe
so the default action is to throw the error we鈥檙e seeing. VBoxManage export
just does not support exporting of NVMe drives.
I raised a bug with VirtualBox at https://www.virtualbox.org/ticket/19320 and will have a crack at implementing NVMe import/export and see if they鈥檒l accept a patch for it.
Most helpful comment
I raised a bug with VirtualBox at https://www.virtualbox.org/ticket/19320 and will have a crack at implementing NVMe import/export and see if they鈥檒l accept a patch for it.