Somebody help plx! The architecture of the target machine is not supported or failed to get the architecture of the target machine

Hello all! Completely beginner here!

Im trying to develop a virtual keyboard device with WDF (Windows Drive Framework) and Virtual HID Framework. Basically, I want to create a C application that is able to send inputs (reports) to a virtual keyboard in a Kernel Mode (without a physical device).

I started to this current tutorial in this half-link windows-hardware/drivers/gettingstarted/writing-a-kmdf-driver-based-on-a-template and Im almost there! But im stuck on “Prepare the target computer for provisioning“ part.

I am using VirtualBox Version 7.2.2 r170484 (Qt6.8.0 on windows) with a Windows VM for tests. Right now I’m facing this error when I click on top menu Extensions→Driver→Test→Configure Devices in Visual Studio

Installing necessary components...
Removing TAEF test service
    Task "Removing TAEF test service" completed successfully
Copying required files
    Task "Copying required files" completed successfully
Configuring WDK Remote User Account
    Task "Configuring WDK Remote User Account" completed successfully
Installing .NET Framework (possible reboot)
    Task "Installing .NET Framework (possible reboot)" completed successfully
Installing VC Redist (x64)
    Task "Installing VC Redist (x64)" completed successfully
Installing test automation (x86)
    Task "Installing test automation (x86)" completed successfully
Installing test automation (x64)
    Task "Installing test automation (x64)" completed successfully
Installing debuggers (x86)
    Task "Installing debuggers (x86)" completed successfully
Installing debuggers (x64)
    Task "Installing debuggers (x64)" completed successfully
Installing onecore driver test framework
    Task "Installing onecore driver test framework" completed successfully
Installing desktop driver test framework
    Task "Installing desktop driver test framework" completed successfully
Registering logging components
Task "Registering logging components" completed successfully
Set CEIP key
Task "Set CEIP key" completed successfully
Installing TAEF service
Task "Installing TAEF service" completed successfully
Configuring TAEF test service to start automatically
Task "Configuring TAEF test service to start automatically" completed successfully
Configuring kernel debugger settings (possible reboot)
Task "Configuring kernel debugger settings (possible reboot)" was aborted because an error occured on the target machine during execution.

An error occurred on the target machine while executing a process.
Error code: 50
Error message: The architecture of the target machine is not supported or failed to get the architecture of the target machine '$KitRoot$\\Testing\\Runtimes\\TAEF%PROCESSOR_ARCHITECTURE%\\MinTE\\te.exe'.
Configuring computer settings (possible reboot)
Task "Configuring computer settings (possible reboot)" was aborted because an error occured on the target machine during execution.

An error occurred on the target machine while executing a process.
Error code: 50
Error message: The architecture of the target machine is not supported or failed to get the architecture of the target machine '$KitRoot$\\Testing\\Runtimes\\TAEF%PROCESSOR_ARCHITECTURE%\\MinTE\\te.exe'.
Creating system restore point
Task "Creating system restore point" completed successfully
Computer configuration log file://C:/Users/fabri/AppData/Roaming/Microsoft/WDKTestInfrastructure/ProvisioningLogs/Driver%20Test%20Computer%20Configuration%2020251023092907178.log
Failed installing components

I really dont know what to do! Inittially, my VM PROCESSOR_ARCHITECTURE variable has value AMD64 and inside directory C:\Program Files(x86)\Windows Kits\10\Testing\Runtimes\TAEF has only directories arm64, MinTe, netstandard, x64 and x86. I tried set this variable value as x64 both to user and system variables, but doenst work

Somebody help me pleease

Don’t use the awful visual studio driver testing nonsense. Just install your test drivers manually on the target system and use windbg for debugging.

I dont know exactly what happens, but after following some youtube tutorials, I just deleted the VM from VirtualBox and started to use VMWare Workstation 17. The driver testing on Visual Studio worked all good after this

The problem now is on driver install. It doenst work, maybe because I did something worng on the code from Microsft tutorial to use virtual HID framework

Can you help me with it ? This is my driver code

#include "driver.h"
#include "driver.tmh"
#include <vhf.h>

#ifdef ALLOC_PRAGMA
#pragma alloc_text (INIT, DriverEntry)
#pragma alloc_text (PAGE, KmdfDriverEvtDeviceAdd)
#pragma alloc_text (PAGE, KmdfDriverEvtDriverContextCleanup)
#endif

UCHAR VhfHeadSetReportDescriptor[] = {
    0x05, 0x01,        // USAGE_PAGE (Generic Desktop)
    0x09, 0x06,        // USAGE (Keyboard)
    0xA1, 0x01,        // COLLECTION (Application)

    0x05, 0x07,        //   USAGE_PAGE (Keyboard)
    0x19, 0xE0,        //   USAGE_MINIMUM (Keyboard LeftControl)
    0x29, 0xE7,        //   USAGE_MAXIMUM (Keyboard Right GUI)
    0x15, 0x00,        //   LOGICAL_MINIMUM (0)
    0x25, 0x01,        //   LOGICAL_MAXIMUM (1)
    0x75, 0x01,        //   REPORT_SIZE (1)
    0x95, 0x08,        //   REPORT_COUNT (8)
    0x81, 0x02,        //   INPUT (Data,Var,Abs) ; Modifier byte

    0x95, 0x01,        //   REPORT_COUNT (1)
    0x75, 0x08,        //   REPORT_SIZE (8)
    0x81, 0x03,        //   INPUT (Cnst,Var,Abs) ; Reserved byte

    0x95, 0x05,        //   REPORT_COUNT (5)
    0x75, 0x01,        //   REPORT_SIZE (1)
    0x05, 0x08,        //   USAGE_PAGE (LEDs)
    0x19, 0x01,        //   USAGE_MINIMUM (Num Lock)
    0x29, 0x05,        //   USAGE_MAXIMUM (Kana)
    0x91, 0x02,        //   OUTPUT (Data,Var,Abs) ; LED report

    0x95, 0x01,        //   REPORT_COUNT (1)
    0x75, 0x03,        //   REPORT_SIZE (3)
    0x91, 0x03,        //   OUTPUT (Cnst,Var,Abs) ; LED padding

    0x95, 0x06,        //   REPORT_COUNT (6)
    0x75, 0x08,        //   REPORT_SIZE (8)
    0x15, 0x00,        //   LOGICAL_MINIMUM (0)
    0x25, 0x65,        //   LOGICAL_MAXIMUM (101)
    0x05, 0x07,        //   USAGE_PAGE (Keyboard)
    0x19, 0x00,        //   USAGE_MINIMUM (Reserved (no event))
    0x29, 0x65,        //   USAGE_MAXIMUM (Keyboard Application)
    0x81, 0x00,        //   INPUT (Data,Ary,Abs) ; Key array (6 bytes)

    0xC0               // END_COLLECTION
};

NTSTATUS
DriverEntry(
    _In_ PDRIVER_OBJECT  DriverObject,
    _In_ PUNICODE_STRING RegistryPath
    )
{
    WDF_DRIVER_CONFIG config;
    NTSTATUS status;
    WDF_OBJECT_ATTRIBUTES attributes;

    //
    // Initialize WPP Tracing
    //
    WPP_INIT_TRACING(DriverObject, RegistryPath);

    TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DRIVER, "%!FUNC! Entry");

    //
    // Register a cleanup callback so that we can call WPP_CLEANUP when
    // the framework driver object is deleted during driver unload.
    //
    WDF_OBJECT_ATTRIBUTES_INIT(&attributes);
    attributes.EvtCleanupCallback = KmdfDriverEvtDriverContextCleanup;

    WDF_DRIVER_CONFIG_INIT(&config,
                           KmdfDriverEvtDeviceAdd
                           );

    status = WdfDriverCreate(DriverObject,
                             RegistryPath,
                             &attributes,
                             &config,
                             WDF_NO_HANDLE
                             );

    if (!NT_SUCCESS(status)) {
        TraceEvents(TRACE_LEVEL_ERROR, TRACE_DRIVER, "WdfDriverCreate failed %!STATUS!", status);
        WPP_CLEANUP(DriverObject);
        return status;
    }

    TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DRIVER, "%!FUNC! Exit");

    return status;
}

VOID
VhfSourceDeviceCleanup(
    _In_ WDFOBJECT DeviceObject
)
{
    PDEVICE_CONTEXT deviceContext;
    PAGED_CODE();
    TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DEVICE, "%!FUNC! Entry");
    deviceContext = DeviceGetContext(DeviceObject);

    if (deviceContext->VhfHandle != WDF_NO_HANDLE)
    {
        VhfDelete(deviceContext->VhfHandle, TRUE);
        deviceContext->VhfHandle = WDF_NO_HANDLE;
    }
}

NTSTATUS
KmdfDriverEvtDeviceAdd(
    _In_    WDFDRIVER       Driver,
    _Inout_ PWDFDEVICE_INIT DeviceInit
    )
{

    UNREFERENCED_PARAMETER(Driver);

    PAGED_CODE();

    TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DRIVER, "%!FUNC! Entry");

    WDF_OBJECT_ATTRIBUTES   deviceAttributes;
    PDEVICE_CONTEXT deviceContext;
    VHF_CONFIG vhfConfig;
    WDFDEVICE device;
    NTSTATUS status;

    PAGED_CODE();

    WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&deviceAttributes, DEVICE_CONTEXT);
    deviceAttributes.EvtCleanupCallback = VhfSourceDeviceCleanup;

    status = WdfDeviceCreate(&DeviceInit, &deviceAttributes, &device);

    if (NT_SUCCESS(status))
    {
        deviceContext = DeviceGetContext(device);

        VHF_CONFIG_INIT(&vhfConfig,
            WdfDeviceWdmGetDeviceObject(device),
            sizeof(VhfHeadSetReportDescriptor),
            VhfHeadSetReportDescriptor);

        status = VhfCreate(&vhfConfig, &deviceContext->VhfHandle);

        if (!NT_SUCCESS(status)) {
            TraceEvents(TRACE_LEVEL_ERROR, TRACE_DEVICE, "VhfCreate failed %!STATUS!", status);
            return status;
        }

        status = VhfStart(deviceContext->VhfHandle);
        if (!NT_SUCCESS(status)) {
            TraceEvents(TRACE_LEVEL_ERROR, TRACE_DEVICE, "VhfStart failed %!STATUS!", status);
            VhfDelete(deviceContext->VhfHandle, TRUE);
            deviceContext->VhfHandle = WDF_NO_HANDLE;
            return status;
        }

        // Create a device interface so that applications can find and talk to us.
        status = WdfDeviceCreateDeviceInterface(
            device,
            &GUID_DEVINTERFACE_KmdfDriver,
            NULL // ReferenceString
        );

        if (!NT_SUCCESS(status)) {
            TraceEvents(TRACE_LEVEL_ERROR, TRACE_DEVICE, "WdfDeviceCreateDeviceInterface failed %!STATUS!", status);
            // continue; interface failure will prevent user-mode open
        }

        // Initialize the I/O Package and any Queues
        status = KmdfDriverQueueInitialize(device);
        if (!NT_SUCCESS(status)) {
            TraceEvents(TRACE_LEVEL_ERROR, TRACE_DEVICE, "KmdfDriverQueueInitialize failed %!STATUS!", status);
            // cleanup VHF
            VhfDelete(deviceContext->VhfHandle, TRUE);
            deviceContext->VhfHandle = WDF_NO_HANDLE;
            return status;
        }

    }

    TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DRIVER, "%!FUNC! Exit");

    return status;
}

VOID
KmdfDriverEvtDriverContextCleanup(
    _In_ WDFOBJECT DriverObject
    )
{
    UNREFERENCED_PARAMETER(DriverObject);

    PAGED_CODE();

    TraceEvents(TRACE_LEVEL_INFORMATION, TRACE_DRIVER, "%!FUNC! Entry");

    WPP_CLEANUP(WdfDriverWdmGetDriverObject((WDFDRIVER)DriverObject));
}

The architecture of target machine is usually specified in the .vcxproj. You might want to double-check the settings for any related options.