Lab 15: Build an optimized Windows golden image

Objective and Tasks

In this lab, a VM has been created and the Windows installation has been started and is paused at the regional selection screen. You will proceed with the installation of Windows, install hypervisor tools, and Horizon agents. You will also use the Omnissa Windows OS Optimization Tool for Horizon to Optimize, Generalize, and Finalize Windows.

  1. Use the vCenter admin console to power on the VM (W11CleanBase) and open a console.
  2. Enter Windows audit mode.
  3. Install VMware Tools
  4. Access the network share where the OS Optimization Tool and the Horizon Agent installer are located.
  5. Optimize Windows using the Omnissa Windows OS Optimization Tool for Horizon (OSOT).
  6. Generalize Windows using the OS Optimization Tool.
  7. Install the Horizon Agent and optionally other agents.
  8. Finalize Windows using the OS Optimization Tool.
  9. Take a VM snapshot.

For more information and guidance on creating an optimized Windows golden image VM for use with Horizon, see the Tech Zone guide, Manually creating optimized Windows images for Horizon VMs.

Expand or collapse content Task 1: Use the vCenter admin console to power on the VM and open a console

Locate the VM in the vCenter admin console, power it on, and open a console to it.

  1. Open the vCenter server admin console.
    • On your ControlCenter desktop, open the a new tab in the Google Chrome browser.
    • Click the bookmark on the bookmark bar for vcenter-01
  2. Login in the vCenter admin console.
  3. Locate the VM you will use to create your golden image in the vCenter inventory.
    • Browse to and select the VM W11CleanBase.
  4. Power on the VM.
    • From the Actions top menu, select Power On (green arrow).
  5. Open a console when the VM is powered on.
    • Click on LAUNCH WEB CONSOLE.
Expand or collapse content Task 2: Enter Windows audit mode

After the Windows operating system is installed, you need to enter audit mode.

Audit mode allows you to bypass the Windows Out-of-Box Experience (OOBE), the initial setup screen that asks for user information, region, and language, so you can run tasks such as, adding drivers, installing applications, applying updates, running scripts, and applying optimizations.

You will exit audit mode and enter OOBE, in a later task when you Generalize Windows.

  1. Enter audit mode.
    • When Windows reboots after installing, you are prompted with a regional settings screen.
    • Press CTRL+SHIFT+F3 for Windows
    • Press CTRL+SHIFT+Fn+F3 for MacOS

Make sure that you click on the regional settings windows in the VM to give it focus before entering the key combination to enter audit mode.

On some keyboards the function keys might be dual function. You might also need to click the fn key to type F3.

Windows will reboot and you will get logged in as the local Administrator account.

As Windows is now in audit mode, a System Preparation Tool (SysPrep) dialog will be displayed each time Windows boots. You should cancel or close the dialog each time it is displayed.

  1. Cancel the System Preparation dialog.
    • Click Cancel or use the X to close the dialog without executing it.
Expand or collapse content Task 3: Install VMware Tools

Install the hypervisor tools. In this lab the VM is hosted on vSphere so you will install VMware Tools.

  1. Switch to the vCenter server admin console.
    • On your ControlCenter desktop, use the vSphere tab in the Google Chrome browser.
  2. Mount the VMware Tools installation media on the VM.
    • Ensure you are still viewing the VM W11CleanBase in the vCenter inventory.
    • Click on the Actions top menu and select Guest OS > Install VMware Tools.
    • In the Install VMware Tools dialog, click MOUNT.
  1.  Run the VMware Tools installation on W11CleanBase.
    • Switch back to the web console of the VM by selecting the W11CleanBase tab in Chrome.
    • Open Windows Explorer
    • Navigate to DVD Drive (D: ) VMware Tools.
    • Run setup.exe

The VMware Tools installation will start. If the dialog window gets hidden behind other windows, use the Windows taskbar to bring it to the front.

  1. Proceed through the welcome screen.
    • Click Next.
  2. On the Choose Setup Type screen:
    • Select Custom.
    • Click Next.

On the Custom Setup screen you can select or deselect the features of VMware Tools that will be installed.

  1. Deselect the features that will not be required.
    • Deselect VMware Carbon Black Helper.
    • Deselect Service Discovery.
    • Deselect Volume Shadow Copy Services Support.
    • Click Next.
  1. Complete the installation wizard.
    • Click Install.
  2. Close the VMware Tools setup wizard and restart Windows.
    • When the installation completes, click Finish.
    • Click Yes, to restart Windows.
  3. When Windows restarts, the System Preparation Tool dialog box will display again.
    • Cancel or close that dialog to leave Windows in audit mode for now.

At this point in the process you would normally run Windows update and install any applications that you want to be part of the golden image VM. You will not do that in this lab.

Expand or collapse content Task 4: Access the network share

In this lab environment the OS Optimization Tool and the Horizon Agent installer are located on an SMB file server.

By default, Windows does not permit mounting SMB file shares as an unauthenticated users.  To get around this you will need to run two commands and reboot Windows, before accessing the share.

  1. Open the Windows PowerShell (Administrator) console on W11CleanBase
    • Right-click on the Windows Start icon and select Terminal (Admin).
  2. Enter the following commands to permit mount SMB file shares as an unauthenticated user
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation" /v AllowInsecureGuestAuth /t REG_DWORD /d 1 /f
Set-SmbClientConfiguration -RequireSecuritySignature $false -Force
  1. Restart Windows.
    • Use Windows Start > Power button > Restart.
  2. Access the file share.
    • Right-click on Start Menu and select Run.
    • Open: \\labfiler\resources
    • Click OK.
Expand or collapse content Task 5: Optimize Windows using the OS Optimization Tool

In this task, you use the Windows OS Optimization Tool for Horizon (OSOT) to analyze the list of recommended optimizations, confirm your selections, and apply those optimizations.

  1. Run the OS Optimization Tool on W11CleanBase
    • Browse to \\labfiler\resources\Software\OS Optimization Tool_2512
    • Run OmnissaHorizonOSOptimizationTool-x86_64-1.2.2512.XXXXX.exe
  2. When the OS Optimization Tool first launches, the Omnissa General Terms dialog will display.
    • Tick the checkbox next to I accept the terms of the agreement.
    • Click Next.
  3. Open the Optimize feature of OS Optimization Tool.
    • Select Optimize from the ribbon menu.

Before you can optimize Windows, you need to use OSOT to analyze the current configuration and settings.

  1. Analyze the current state of Windows.
    • Click on Analyze in the bottom right.

When Analyze completes, you can tune the optimizations that will be applied.

  1. Open the Common Options wizard
    • Click on the Common Options button in the middle of the screen.
  2. Configure the Visual Effect settings.
    • Select the Visual Effect option from the left-hand menu.
    • Select Best performance.
  3. Configure the Windows Update settings.
    • Select the Update option from the left-hand menu.
    • Leave all options as the defaults to disable Windows Update functionality.

By default, Windows installs many Microsoft store applications which can cause an overhead and waste of resources. OSOT allows you to remove the store apps and also choose to retain some of the more frequently used ones.

  1. Configure the Windows Store Apps settings.
    • Select the Store Apps option from the left-hand menu.
    • Ensure that the default option Remove Windows Store Applications is selected.
    • Select the following Windows Store Applications to be kept: Calculator, Sticky Notes, and Paint3D.
  2. Configure the Windows Background settings.
    • Select the Background option from the left-hand menu.
    • Leave the default checkbox selections.
    • Use the color pane to select a preferred color.
  3. Close the Common Options wizard.
    • Click OK.

You can also configure, select, and deselect individual optimization settings in the Optimize screen.

  1. Start the optimization process.
    • Click on Optimize in the bottom right.
    • Monitor the optimization results until the process is complete.
  2. Restart Windows.
    • Use Windows Start > Power button > Restart.
  3. When Windows restarts, the System Preparation Tool dialog box will display again.
    • Cancel or close that dialog to leave Windows in audit mode for now.
Expand or collapse content Task 6: Generalize Windows using the OS Optimization Tool

Generalizing a Windows image means removing computer-specific information so that the image can be deployed throughout an enterprise. You use the Generalize tab of the OS Optimization Tool to run the system preparation tool (SysPrep) with a supplied and editable unattend.xml answer file.

Some recent versions of Windows 11 have been observed enabling device encryption functionality during installation. This causes an error during Sysprep execution when the Generalize task takes Windows out of  audit mode to enter Out-of-Box Experience (OOBE).

You will need to disable device encryption before you can run a Generalize (SysPrep).

  1. Open the Device encryption settings in Windows Settings.
    • Open Windows Settings with Windows Start > Settings.
    • Navigate to Privacy & security and select Device encryption.
  2. Turn off Device encryption.
    • Toggle Device encryption to Off.
    • Confirm by clicking Turn off in the Turn off device encryption dialog box.

Turning off device encryption can take some time to complete. Make sure decryption has fully completed, shown in Windows Settings, before moving on to the next step.

  1. Access the file share.
    • Right-click on Start Menu and select Run.
    • Open: \\labfiler\resources
    • Click OK.
  2. Run the OS Optimization Tool on W11CleanBase
    • Browse to \\labfiler\resources\Software\OS Optimization Tool_2512
    • Run OmnissaHorizonOSOptimizationTool-x86_64-1.2.2512.XXXXX.exe
  3. Open the Generalize feature of OS Optimization Tool.
    • Select Generalize from the ribbon menu.
  4. Configure the Generalize settings.
    • Note the options for changing Time Zone, Input Locale, and System Locale.
    • Also note that you can View Answer File to see the unattend.xml file that will be used. You can also access an Editor.
    • Leave all the selections as the default values.
  5. Start the Generalize process.
    • Click on Generalize in the bottom right.
    • Monitor the generalize process until it is complete.
  6. Restart Windows.
    • Use Windows Start > Power button > Restart.

When Windows restarts after the Generalize and SysPrep, it will download and apply Windows updates.

Expand or collapse content Task 7: Install the Horizon Agent
  1. Access the file share.
    • Right-click on Start Menu and select Run.
    • Open: \\labfiler\resources
    • Click OK.
  2. Run the Horizon Agent for Windows installer executable on W11CleanBase
    • Browse to \\labfiler\resources\Software\Horizon__2512
    • Run Omnissa-Horizon-Agent-x86_64-2512-8.17.0-XXXXX.exe

The installer may get hidden behind other Windows. Use the Windows taskbar to select it and bring it to the front.

  1. Proceed through the welcome screen.
    • Click Next.
  2. On the Network protocol configuration screen:
    • Ensure the default of IPv4 is selected.
    • Click Next.

You can use the Custom Setup screen to customize and select the features that you want to install as part of the Horizon Agent for Windows.

  1. Enable the installation of the USB Redirection feature.
    • On the Custom Setup screen, use the drop down menu to the left of USB Redirection.
    • Select This feature, and all subfeatures, will be installed on local hard drive
  2. Enable the installation of the Horizon Performance Tracker feature.
    • On the Custom Setup screen, use the drop down menu to the left of Horizon Performance Tracker.
    • Select This feature, and all subfeatures, will be installed on local hard drive
  3. Explore the other options available on the Custom Setup screen.
    • Review the other options and features available for selection.
    • Click Next.

Note that the Instant Clone Agent feature is enabled by default. This is used for automated pool provisioning and customization, both with instant clones and linked clones.

  1. On the Remote Desktop Protocol Configuration screen:
    • Ensure the default of Enable the Remote Desktop capability on this computer is selected.
    • Select Next.
  2. On the Ready to Install the program screen:
    • Select the checkbox next to Automatically restart system on successful completion.
    • Click Install.

Once the Horizon Agent installation has completed, Windows will reboot.

You can also install additional Omnissa and third-party agents at this time. When installing multiple Omnissa agents, and third-party agents, the following installation order should be the followed.

  1. Horizon Agent.
  2. Dynamic Environment Manager FlexEngine.
  3. FSLogix (example of a third-party agent).
  4. App Volumes Agent.
Expand or collapse content Task 8: Finalize Windows using the OS Optimization Tool

Before you shut down the Windows VM to use it to create or update a Horizon desktop pool or farm, it is best practice to run certain system cleanup jobs and clear information from certain fields.

You use the Finalize tab of OS Optimization Tool to perform this.

  1. Access the file share.
    • Right-click on Start Menu and select Run.
    • Open: \\labfiler\resources
    • Click OK.
  2. Run the OS Optimization Tool on W11CleanBase
    • Browse to \\labfiler\resources\Software\OS Optimization Tool_2512
    • Run OmnissaHorizonOSOptimizationTool-x86_64-1.2.2512.XXXXX.exe
  3. Open the Finalize feature of the OS Optimization Tool.
    • Select Finalize from the ribbon menu.

To reduce the time required to complete this lab, you will deselect several Finalize options. Normally you would leave these selected to properly prepare and Finalize the image.

  1. In the Choose system cleanup jobs area, deselect the following options:
    • Native Image Generator (NGEN)
    • Side by side Component Cleanup (DISM)
    • Compact
    • Disk Cleanup
  2. In the Choose information to clear area, deselect the following options:
    • Clear system event logs
    • Clean Default User Profile
    • Zero empty disk space
    • Create Local Group Policies
  3. Start the Finalize process.
    • Click Finalize in the bottom right corner.
    • Monitor the finalize process until it is complete.
  4. When Finalize completes, an Information window will be displayed.
    • Take note of the recommended next steps.
    • Click OK to close the OS Optimization Tool.
  1. Shutdown Windows.
    • Use Windows Start > Power button > Shut down.
Expand or collapse content Task 9: Take a VM snapshot

Before you can use your golden image to create or update a Horizon pool you need to to take a VM snapshot.

  1. Open the vCenter admin console.
    • On your ControlCenter desktop, switch to the vSphere tab in the Google Chrome browser.
    • Click the bookmark on the bookmark bar for vcenter-01
  2. Locate the golden image VM in the vCenter inventory.
    • Browse to and select the VM W11CleanBase
    • Confirm that the Power Status is Powered off (in the Virtual Machine Details pane).
  3. Take a new snapshot of the golden image.
    • Select the Snapshots tab.
    • Click on TAKE SNAPSHOT.
    • In the Name field, enter 2512.
    • Optionally enter a Description.
    • Note that the two check box options will be clear and you cannot select them. This is expected as the VM is powered off.
    • Click CREATE.
  4. Confirm that the Snapshot was created.
    • You should now see a new entry (2512) displayed in the Snapshot tree for the VM.

Your optimized Windows golden image is now ready to use to create or update a Horizon desktop pool.

This concludes this lab.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.