Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtualbox-iso: NVMe not exporting properly #8317

Closed
breisig opened this issue Nov 4, 2019 · 8 comments
Closed

Virtualbox-iso: NVMe not exporting properly #8317

breisig opened this issue Nov 4, 2019 · 8 comments

Comments

@breisig
Copy link

breisig commented Nov 4, 2019

Overview of the Issue

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.

Operating system and Environment details

  • Windows 10 Pro
  • Virtualbox 6.0.14
  • Packer 1.4.5
  • [Using the latest CentOS 8 iso]
@sylviamoss
Copy link
Member

Hi @breisig! Can you please provide a complete minimal buildfile? I'm finding difficult to reproduce this.

@martinandersson
Copy link

martinandersson commented Jan 19, 2020

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).

@davecardwell
Copy link

I made a buildfile that reproduces this issue by modifying roboxes.org’s 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’s 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’re seeing. VBoxManage export just does not support exporting of NVMe drives.

@davecardwell
Copy link

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’ll accept a patch for it.

@harmjanblok
Copy link

Issue in VirtualBox issue tracker still seems to be unresolved. @davecardwell maybe you can resent your message to the (dev) mailinglist so this subject gets some attention?

@davecardwell
Copy link

@harmjanblok Unfortunately I didn’t get a reply to my ticket, patch, or email to the dev list, and have since moved onto another project. Perhaps you could follow up on the mailing list with a link to my original bug report at https://www.virtualbox.org/ticket/19320 and see if there is any interest now?

@ghost
Copy link

ghost commented Apr 16, 2021

This issue has been automatically migrated to hashicorp/packer-plugin-virtualbox#10 because it looks like an issue with that plugin. If you believe this is not an issue with the plugin, please reply to hashicorp/packer-plugin-virtualbox#10.

@ghost ghost closed this as completed Apr 16, 2021
@ghost
Copy link

ghost commented May 17, 2021

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.

@ghost ghost locked as resolved and limited conversation to collaborators May 17, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants