Estimated reading time: 6 minutes

How do you notify users – or even Administrators – when a requested VM deployment is complete? The answer often varies. Some environments integrate with IT Service Management (ITSM) tools like ServiceNow, others use automated emails triggered by Orchestrator workflows, and some still rely on manual processes. In many cases, a mix of these methods is employed.
That’s great, but what about visual indicators? Think about how much we rely on them in everyday life – from traffic lights at intersections to the warning lights on a car’s dashboard, or even visually checking if a tire is flat. These cues provide immediate feedback, enabling rapid decision-making. If visual indicators are so effective elsewhere, why not use them for VM deployments? Imagine providing users with a clear, visual representation of a VM’s deployment status – whether it’s still being built or ready to go.
I demonstrated this concept alongside Dale Hassinger, author of the vCROCS blog, during our session at VMware Explore Las Vegas 2024 (INDB1917LV – Streamlining Healthcare with Automation: How VMware by Broadcom Can Help), where it was met with enthusiastic feedback. Our goal was to enhance the user experience while minimizing errors caused by misinterpreted deployment states. Let’s take a closer look into how visual indicators can revolutionize your VM deployment workflows.
Example Outcome
Prerequisites
- This demonstration only applies to Windows VMs with the Desktop Experience enabled.
- Windows Server 2019 is referenced in this demonstration. Steps may vary slightly between Windows editions.
- You must have access to the Gold Image VM or VM you intend to convert to a VM Template. This VM/template must not be generalized using Sysprep yet.
- You must have administrative access to the VM, as this demonstration involves modifying a Windows Registry key.
- Your Cloud Template must have the “cloudConfig” code block populated in the Cloud Template’s YAML code and Cloudbase-Init must be installed and configured on the VM you intend to templatize. I will cover this aspect in a future blog post!
Getting Started
First, power-on your VM and authenticate as needed to access the desktop. You may use Remote Desktop Protocol (RDP) or the Remote Console in vCenter or ESXi – either is fine.
Save the image files from the “Example Outcome” section above to your VM. Use a directory outside of a user’s profile. In this demonstration, I will save the files to a directory named “MyOrg” I created within the “Sysprep” directory. If your VM does not have direct access to the Internet, download the images to your local workstation (or create your own branded images!) and transfer the files using your preferred method.
The directory I have chosen is: C:/Windows/System32/Sysprep/MyOrg
Modify Registry Values
Once the image files have been placed in the “MyOrg” directory, open the Windows Registry Editor by clicking on the “Start” button, then typing “regedit” (without quotes) and click on the “Registry Editor” menu item. Alternatively, you may press the WIN + R keys on your keyboard to open the “Run” dialog box, then type “regedit” inside the text field and press the “Enter” key.
The “Registry Editor” window opens. Using the cascading tree inside the left-side pane, navigate to the path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization
Click on the “Personalization” registry key, which appears as a “folder icon” in the left-side pane.
In the right-side pane, you will see several values. Look for a value named “LockScreenImage” of type “REG_SZ“. If this value is already present, simply double-click on it to modify, and skip to the next paragraph. If the value is not present, right-click on an open space within the right-side pane, hover your mouse over the “New” menu item, then click on the “String Value” menu item. A new value is created with the cursor placed so you may type the value name, which must be “LockScreenImage” (without quotes).
The “Value Data” field is the path to an image file. In this case, we want the selected image to reflect the “config” background. We select that image because Cloudbase-Init will toggle the registry key to the “standard” image at the end of the deployment tasks, which we will discuss next. Type or paste the location of the “config” image in this box, then click on the “Ok” button.

Modify Cloud Template
Using a web browser of choice, browse to your Cloud Template in VCF Automation Assembler. Scroll down in the “Code” pane to the end of the “cloudConfig” code block. The snippet below is written in YAML but contains some PowerShell code, which is run by Cloudbase-Init on first boot. Type or paste the highlighted portion of the snippet below while preserving indentation, which is very important in YAML:
# Begin Cloudbase-Init commands
cloudConfig: |
Content-Type: multipart/mixed; boundary="==NewPart=="
MIME-Version: 1.0
--==NewPart==
Content-Type: text/x-shellscript; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="initial_config.ps1"
#ps1_sysnative
# Unrelated PowerShell snippets go here.
# Set standard lock screen image
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name 'LockScreenImage' -Value 'C:\Windows\System32\Sysprep\MyOrg\background_standard.png' -Force
# Reboot VM for changes to take effect
Restart-Computer
YAMLThe highlighted snippet above is pretty straightforward. On lines 16-17, we instruct Cloudbase-Init to toggle the “LockScreenImage” registry key from the “config” background to the “standard” background. Lines 19-20 instruct the VM the reboot at the conclusion of running commands, which can be omitted if you prefer.
Having done all that, you may now deploy a new VM directly from the Cloud Template or create a new Version of the Cloud Template and and Release it, then deploy from Service Broker. When the VM is first deployed and powers-on for the first time, notice that the “config” lock screen background is displayed, indicating that users/Administrators should wait before attempting to log-in. Once the VM finishes running the Cloudbase-Init commands and reboots, notice that the lock screen now displays the “standard” image! This provides users and Administrators with a visual indicator that the Cloudbase-Init tasks have finished running and it is now safe to begin using the server.