In the fast-evolving world of cloud computing and virtualization, Azure Virtual Desktop (AVD) has emerged as a key solution for deploying Windows 11 environments efficiently. However, one common hurdle that many IT professionals face is the Out-of-Box Experience (OOBE), which requires user interaction during initial setups. This process not only disrupts unattended image builds but can also slow down deployment times. Fortunately, with the right techniques, you can bypass OOBE seamlessly, enabling faster image provisioning and automated configurations. In this article, we will explore how to automate the OOBE bypass in Packer builds for AVD, ensuring a more streamlined deployment process.
Understanding OOBE and Its Impact
The Out-of-Box Experience (OOBE) is the initial setup process of Windows 11 that prompts users to configure settings like region, language, and privacy preferences. When building images for AVD with tools like Packer, these prompts can become obstacles, requiring manual input and wasting valuable time. By leveraging automated methods to skip OOBE, you can ensure that your virtual machines are ready for further configuration scripts and application installations with minimal human intervention.
Automating OOBE Bypass with Unattend.xml
Step 1: Prepare Your Unattend.xml File
To automate the process, you’ll first need to create an Unattend.xml answer file. This XML file contains predefined responses to Windows setup prompts, allowing the build to progress without manual input. The crucial section for bypassing OOBE is within the oobeSystem configuration pass. Below is a minimal example of how your Unattend.xml file should look:
1<unattend xmlns="urn:schemas-microsoft-com:unattend">
2 <settings pass="oobeSystem">
3 <component name="Microsoft-Windows-International-Core">
4 <InputLocale>en-US</InputLocale>
5 <SystemLocale>en-US</SystemLocale>
6 <UILanguage>en-US</UILanguage>
7 <UserLocale>en-US</UserLocale>
8 </component>
9 <component name="Microsoft-Windows-Shell-Setup">
10 <OOBE>
11 <HideEULAPage>true</HideEULAPage>
12 <NetworkLocation>Work</NetworkLocation>
13 <ProtectYourPC>3</ProtectYourPC>
14 <HideLocalAccountScreen>true</HideLocalAccountScreen>
15 <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
16 <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
17 <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
18 </OOBE>
19 <UserAccounts>
20 <AdministratorPassword>
21 <Value>YourSecurePassword123!</Value>
22 <PlainText>true</PlainText>
23 </AdministratorPassword>
24 </UserAccounts>
25 <RegisteredOrganization>YourOrg</RegisteredOrganization>
26 <RegisteredOwner>YourOwner</RegisteredOwner>
27 <TimeZone>UTC</TimeZone>
28 <AutoLogon>
29 <Username>Administrator</Username>
30 <Password>
31 <Value>YourSecurePassword123!</Value>
32 <PlainText>true</PlainText>
33 </Password>
34 <Enabled>true</Enabled>
35 </AutoLogon>
36 </component>
37 </settings>
38</unattend>
Ensure that you modify this file according to your organization’s preferences and credentials. The Hide* elements suppress various OOBE screens, while AutoLogon guarantees the Administrator account is available for later provisioning.

Step 2: Integrate Unattend.xml into Your Packer Build
Next, you need to integrate your Unattend.xml file into the Packer build. Use the floppy_files or boot_command options to inject the answer file into your Packer template. For instance, in the builders section, you might use:
1"floppy_files": [
2 "autounattend.xml"
3]
For Azure-specific configurations, make sure to employ the customize step to copy the file and execute sysprep with the answer file attached.
Step 3: Verify Your Build Process
Once integrated, it’s time to verify the build process. When the virtual machine boots, Windows Setup should process the Unattend.xml file automatically, skipping OOBE prompts and reaching the desktop, ready for additional provisioning scripts without requiring manual setup.
Using Sysprep with OOBE Skip Parameters
Step 1: Run Sysprep with Appropriate Flags
After installing Windows and the necessary software, use the sysprep tool with the /oobe and /unattend switches to prepare your image. This command generalizes the image and applies your unattended configuration, effectively stripping unique system information:
1sysprep /generalize /oobe /shutdown /unattend:C:\Path\To\Unattend.xml
When this command completes, your image is primed for deployment without engaging OOBE screens.

Step 2: Capture the Image for Azure Virtual Desktop
After sysprep runs and the VM shuts down, proceed with capturing the image according to your Packer workflow or Azure environment requirements.
Alternative Methods for OOBE Bypass
For scenarios where Unattend.xml is not suitable, some administrators resort to temporary workarounds such as registry edits or command-line options. While effective for quick bypassing, these methods are not as robust and could become unsupported in future Windows releases.
Registry Modification Approach
To suppress OOBE, you can adjust registry values using command lines:
1reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\OOBE" /v SkipMachineOOBE /t REG_DWORD /d 1 /f
2reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\OOBE" /v SkipUserOOBE /t REG_DWORD /d 1 /f

After making these changes, reboot the VM. Keep in mind that while this may allow Windows to skip some OOBE screens, it’s not guaranteed to bypass all setup steps and isn’t recommended for production images.
Conclusion
By utilizing an Unattend.xml file in conjunction with Packer, you can effectively bypass the Out-of-Box Experience during Windows 11 image builds for Azure Virtual Desktop. This reliable approach not only streamlines the deployment process but also minimizes manual setup time, allowing your focus to shift towards configuration and application provisioning. As cloud technology continues to transform how we manage virtual environments, mastering these automation techniques will significantly enhance your operational efficiency.
And if you'd like to go a step further in supporting us, you can treat us to a virtual coffee ☕️. Thank you for your support ❤️!
We do not support or promote any form of piracy, copyright infringement, or illegal use of software, video content, or digital resources.
Any mention of third-party sites, tools, or platforms is purely for informational purposes. It is the responsibility of each reader to comply with the laws in their country, as well as the terms of use of the services mentioned.
We strongly encourage the use of legal, open-source, or official solutions in a responsible manner.


Comments