Sysprep not working with Virtualbox guest additions using Packer

I am new to Packer and Vagrant and I am trying to build a lab with a Windows Server 2019 domain using Packer and Vagrant.

I have tried following some of the information I found on github and other forums saying that I need to append this on the autounattend.xml file so drivers are not uninstalled:

<settings pass="generalize">
    <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <SkipRearm>1</SkipRearm>
    </component>
    <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <PersistAllDeviceInstalls>true</PersistAllDeviceInstalls>
        <DoNotCleanUpNonPresentDevices>true</DoNotCleanUpNonPresentDevices>
    </component>
</settings>
<!-- *** END OF CUSTOM GENERALIZE SETTINGS *** -->

but I can´t figure out why sysprep is not keeping the VirtualBox Guest Additions after running sysprep.

I have created a repo on Github here: GitHub - mgonzcast/oilrig-lab: Oilrig lab automation creation

Since I am using Vagrant I have decided to install the Virtualbox guest additions there adding the corresponding plugin but I consider more “clean” to have the Virtualbox guest additions installed just once for the Windows Server 2019 template from Packer and not to have to install it on every virtual machine I provision with Vagrant.

Maybe someone can point me to the right direction.

Also, I have to mention that I have tried to create manually the virtual machine using the autounattend.xml within the ISO file and install Virtualbox guest additions and run sysprep and It worked with no issues, so there is something that goes wrong during the packer provision process.