
Image deployment in MDT is defined by task sequences, which are a set of instructions that tell the program how to create or deploy an image. For example, a task sequence can be created that will deploy an operating system and perform Windows updates on a reference virtual machine. Task sequences are the heart and soul of the deployment solution. When creating a task sequence, you need to select a template. The templates are located in the Templates folder in the MDT installation directory, and they determine which default actions are present in the sequence.
Kindly see these related guides too: ADK, MDT, Microsoft Endpoint Configuration Manager (SCCM), Intune, Autopilot, and WSUS. No bootable media found system halted: Unable to PXE boot WDS to Virtualbox, WDS/DHCP scenarios: How to configure DHCP Server option 60, 66, and 67 for Windows Deployment Services, Uninstall WDS: How to remove Windows Deployment Services role via the GUI and PowerShell.
Microsoft Deployment Toolkit (MDT) is a unified collection of tools, processes, and guidance for automating desktop and server deployment. MDT has been in existence since 2003, when it was first introduced as Business Desktop Deployment (BDD) 1.0. The toolkit has evolved, both in functionality and popularity, and today it is considered fundamental to Windows operating system and enterprise application deployment.
You can use it to create reference images or as a complete deployment solution. MDT is one of the most important tools available to IT professionals today. Here is a guide on how to install ADK, MDT, and WDS: How to deploy Windows images via Microsoft Deployment Toolkit and Windows Deployment Services.
I was testing Windows 11 in my Lab and the following error was prompted. You may be prompted with the same error when trying to deploy a Windows image via MDT. This error appears when the TS gets to “Install Operating System” on the Task Sequence (TS) and fails. As you can see in the image below, it says “Failed to run the action: Install Operating System”.

More Failure Reasons
When you access the BDD log, the following log entry will also be present. This error is because the “Task Sequence Engine failed! Code: enExecutionFail
“. This is because Windows was unable to activate the license key. As a result the error occurs and then the OS could not be deployed.

Error code 0x80004005. This problem may occur if a file that the Windows Product Activation (WPA) requires is damaged or missing.
Solution: Enable “Continue on error”:
To fix this issue, you will have to check the button to continue on error as shown below. This is a temporary fix, kindly ensure the root cause “Windows Product Activation” issue is resolved later. This guide will not be discussing that at the moment. Here is a related guide: Disable Task Sequence Step: How to disable Microsoft Deployment Toolkit Task Sequence property sheet.

Alternatively, If you have your task sequence configured to activate the OS correctly, then you can disable this step. Which will solve error as well. Also try to ensure you have the latest ADK version installed. Here are some related guides also: PowerShell Deployment Extension for MDT: How to deploy Windows using PSD, Microsoft Deployment Toolkit, and Windows Deployment Services, Disable Task Sequence Step: How to disable Microsoft Deployment Toolkit Task Sequence property sheet, and how to update Microsoft Defender Antivirus into the install image of Windows (install.wim). How to check if Windows Updates were installed on your device
I hope you found this blog post on fixing “Failed to run the action install Operating System” when installing Windows image via MDT helpful. If you have any questions, please let me know in the comment session.