imagetypes_vm: add support for graphics controller configuration

Message ID 20260904103023.150460-1-vidyasagar.gc@siemens.com
State Under Review
Headers show
Series imagetypes_vm: add support for graphics controller configuration | expand

Commit Message

vidyasagar.gc Sept. 4, 2026, 10:30 a.m. UTC
From: Vidyasagar G C <vidyasagar.gc@siemens.com>

By default, when an ova image is imported into virtualbox, the graphics
controller was previously set to VBOXVGA (legacy).
However, virtualbox (> 6.0) recommends using VMSVGA for modern Linux guests
to ensure proper display initialization and performance.

To address this, introduce the OVA_GRAPHICS_CONTROLLER variable to set
the recommended graphics controller by default, while also allowing
downstream layers to customize the controller type in the generated
ovf descriptor.

Signed-off-by: Vidyasagar G C <vidyasagar.gc@siemens.com>

Patch

diff --git a/meta/classes-recipe/imagetypes_vm.bbclass b/meta/classes-recipe/imagetypes_vm.bbclass
index 9f1f4c48..fd4e97ed 100644
--- a/meta/classes-recipe/imagetypes_vm.bbclass
+++ b/meta/classes-recipe/imagetypes_vm.bbclass
@@ -49,6 +49,7 @@  OVA_FIRMWARE ?= "efi"
 OVA_ACPI ?= "true"
 OVA_3D_ACCEL ?= "false"
 OVA_SHA_ALG = "1"
+OVA_GRAPHICS_CONTROLLER ?= "VMSVGA"
 
 # Generate random MAC addresses just as VirtualBox does, the format is
 # their assigned prefix for the first 3 bytes followed by 3 random bytes.
@@ -59,7 +60,7 @@  macgen() {
 }
 
 OVA_VARS = "OVA_NAME OVA_MEMORY OVA_NUMBER_OF_CPU OVA_VRAM \
-            OVA_FIRMWARE OVA_ACPI OVA_3D_ACCEL \
+            OVA_FIRMWARE OVA_ACPI OVA_3D_ACCEL OVA_GRAPHICS_CONTROLLER \
             OVA_SHA_ALG VIRTUAL_MACHINE_IMAGE_FILE VMDK_SUBFORMAT"
 
 IMAGE_TEMPLATE_FILES:ova = "${OVF_TEMPLATE_FILE}"
diff --git a/meta/recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl b/meta/recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl
index c3295149..f4d1271c 100644
--- a/meta/recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl
+++ b/meta/recipes-core/images/virtualbox/vm-img-virtualbox.ovf.tmpl
@@ -125,7 +125,7 @@ 
         <Firmware type="${OVA_FIRMWARE_UPPERCASE}"/>
         <HID Pointing="USBTablet"/>
         <Chipset type="ICH9"/>
-        <Display VRAMSize="${OVA_VRAM}" monitorCount="1" accelerate3D="${OVA_3D_ACCEL}" accelerate2DVideo="false"/>
+        <Display VRAMSize="${OVA_VRAM}" monitorCount="1" accelerate3D="${OVA_3D_ACCEL}" accelerate2DVideo="false" controller="${OVA_GRAPHICS_CONTROLLER}"/>
         <RemoteDisplay enabled="true"/>
 	<BIOS>
           <IOAPIC enabled="${OVA_ACPI}"/>