hashicorp / packer-plugin-virtualbox

Packer plugin for VritualBox Builder
https://www.packer.io/docs/builders/virtualbox
Mozilla Public License 2.0
22 stars 36 forks source link

VBOX_E_NOT_SUPPORTED when building Windows server 2022 ISO with VirtualBox 7.1 #144

Open Desarc opened 1 week ago

Desarc commented 1 week ago

Overview of the Issue

I'm trying to build a custom Windows server 2022 ISO image, but it fails with the following error:

stderr: VBoxManage: error: The graphics controller does not support the given feature
VBoxManage: error: Details: code VBOX_E_NOT_SUPPORTED (0x80bb0009), component GraphicsAdapterWrap, interface IGraphicsAdapter, callee nsISupports
VBoxManage: error: Context: "SetFeature(GraphicsFeature_Acceleration3D, ValueUnion.f)" at line 1108 of file VBoxManageModifyVM.cpp
==> virtualbox-iso.windows: VBoxManage: error: Details: code VBOX_E_NOT_SUPPORTED (0x80bb0009), component GraphicsAdapterWrap, interface IGraphicsAdapter, callee nsISupports
==> virtualbox-iso.windows: VBoxManage: error: Context: "SetFeature(GraphicsFeature_Acceleration3D, ValueUnion.f)" at line 1108 of file VBoxManageModifyVM.cpp[0m

I have the latest VirtualBox version (7.1) installed, and after scratching my head for a while, I decided to test with an older version (6.1), which does not give this error, so the problem seems to be limited to 7.1.

See the attached log file for the full debug output: packer.log

Reproduction Steps

Attached is my Packer configuration file: windows.pkr.hcl.txt

Plugin and Packer version

Packer v1.11.2 VirtualBox 7.1 packer-plugin-virtualbox_v1.1.1_x5.0_linux_amd64

Operating system and Environment details

Tested on both Windows 10 and Ubuntu 24.04 with the same result.

rmacwhor commented 6 days ago

I ran into the same issue today. I believe the issue is something to do with the default graphics controller this plugin uses, which is vboxvga. From what I've read online, this is considered the "legacy" option to support older VMs, and as a matter of fact the default for Windows guests is actually vboxsvga: https://superuser.com/questions/1403123/what-are-differences-between-vboxvga-vmsvga-and-vboxsvga-in-virtualbox

In your source configuration, adding gfx_controller = "vboxsvga" should fix the error (since you are building a Windows Server VM). My personal opinion is that this should be the new default in this plugin going forward, unless there is a very specific reason why it is used as the default. The fact the new version of VirtualBox breaks this specifically implies to me they may no longer support this graphics controller in the near future.