Creating a gold image from scratch (Windows 11)
This article will go through the steps for creating and optimizing a new gold image to be used in Azure Virtual Desktop (AVD).
Creating the Virtual Machine
Open and log into Microsoft Azure Portal
In the top search box, search for “Virtual Machines”. Under Services, click on Virtual Machines.
In the Virtual machines section, click on Create > Azure virtual machine from the tool bar.
In the Create a virtual machine wizard go through the steps using the suggested options below:
Basics Tab
Subscription: Arts Subscription
Resource Group: Arts-ACO-WVD (or create a new resource group if needed)
Virtual machine name: <insert vm name here> (should use the following format vm-arts-avd-unique name/description)
Region: East US
Availability Options: Leave as default option (No infrastructure redundancy required)
Security Type: Standard
Image: Click on See all images
Search for Windows 11
Click on Select under Windows 11 and find Windows 11 Enterprise multi-session with the most current version(i.e. 22H2)
VM Architecture: x64
Run with Azure Spot discount: Leave unchecked
Size: Standard_D2as_v4 – 2 vcpus, 8 GiB memory (Should be the default option, but depends on specs needed and use)
Administrator Account:
Username: acoadmin [it is possible the userid is artsadmin as well]
Password: <default ACOAdmin PW>
Confirm Password: <default ACOAdmin PW>
Public inbound ports: None.
I confirm I have an eligible Windows 10/11 license with multi-tenant hosting rights: Check the box.
Click Next.
Disks Tab
OS disk type: Premium SSD (Locally-redundant storage)
Delete with VM: Check
Leave the rest of the settings as default and click on Next.
Networking Tab
Virtual network: Arts-ACO-WVD-Network/Arts-ACO-WVD-vnet
Subnet: Arts-ACO-WVD-subnet(10.16.6.128/26)
Public IP: None
NIC network security group: Basic
Public inbound ports: none
Delete NIC when VM is deleted: Check
Enable accelerated networking: Check
Place the machine behind an existing load balancing solution? Leave unchecked
Click Next.
Management Tab
Leave all settings as they are.
Monitoring Tab
Leave all settings as they are.
Advanced Tab
Leave all settings as they are.
Tags Tab
Set the following tags:
Created On: Set the current date
Created By: Put who created the VM
Owner: ACO
Click Next.
Review + Create Tab
Check over the settings and ensure everything is set correctly. Correct any errors if there are any.
Click Create.
Wait for the deployment to complete.
Connecting to the Virtual Machine
Open and log into Microsoft Azure Portal.
In the top search box, search for “Virtual Machines”. Under Services, click on Virtual Machines.
Click on the newly created virtual machine. On the Overview tab locate the Network section under properties. Note the Private IP address.
On your PC, open Microsoft Remote Desktop and connect to the server called arts-mgmt.
Once the desktop has loaded, open Microsoft Remote Desktop again in the VM and then connect to the IP address noted in step 3.
Log in with the admin account that was set up when the VM was created.
Prepping the Virtual Machine
Once connected to and logged into the Azure virtual machine, various settings will need to be set to optimize the VM for use on Azure Virtual Desktop.
Map a drive to //fileapps.uwaterloo.ca/winapps$/wvd/arts
Open Explorer.
Right click on “This PC” and click on Map network drive.
Set the drive to N:.
Set the folder to \\fileapps.uwaterloo.ca\winapps$\wvd\arts
Check both Reconnect at sign-in and Connect using different credentials
Log in using your Nexus credentials that have appropriate permissions for this share (Bang account).
Run the PowerShell code below or go to the N: drive and load up and run the PrepAzureVM.ps1 script found \\fileapps.uwaterloo.ca\winapps$\wvd\arts\
Configure Windows Defender exclusions
#Virtual Hard Disk File
add-MpPreference -ExclusionExtension .vhd
#Virtual Hard Disk v2 file
add-MpPreference -ExclusionExtension .vhdx
#Virtual Hard Disk snapshot file
add-MpPreference -ExclusionExtension .avhd
#Virtual Hard Disk v2 snapshot file
add-MpPreference -ExclusionExtension .avhdx
#VHD set file
add-MpPreference -ExclusionExtension .vhds
#FSLogics directory
add-MpPreference -ExclusionPath "C:\Program Files\FSLogix"
Configure FSLogixs
#Create registry keys to configure FSLogixs
new-item -path "HKLM:\Software\FSLogix\Profiles"
new-itemproperty -path "HKLM:\Software\FSLogix\Profiles" -Name "VHDLocations" -Value "\\uwwvdprofilesa.file.core.windows.net\profiles" -PropertyType STRING -Force
new-itemproperty -path "HKLM:\Software\FSLogix\Profiles" -Name "Enabled" -Value "1" -PropertyType DWORD -Force
new-itemproperty -path "HKLM:\Software\FSLogix\Profiles" -Name "PreventLoginWithFailure" -Value "1" -PropertyType DWORD -Force
new-itemproperty -path "HKLM:\Software\FSLogix\Profiles" -Name "DeleteLocalProfileWhenVHDShouldApply" -Value "1" -PropertyType DWORD -Force
#Add accounts to FSLogixs profile exclude list
Add-LocalGroupMember -Group "FSLogix ODFC Exclude List" -Member "Artsadmin"
Add-LocalGroupMember -Group "FSLogix ODFC Exclude List" -Member "ACOAdmin"
Add-LocalGroupMember -Group "FSLogix ODFC Exclude List" -Member "Administrators"
Add-LocalGroupMember -Group "FSLogix Profile Exclude List" -Member "Artsadmin"
Add-LocalGroupMember -Group "FSLogix Profile Exclude List" -Member "Administrators"
Add-LocalGroupMember -Group "FSLogix Profile Exclude List" -Member "ACOAdmin"
Disable Automatic Updates
#Disables Windows Automatic Update
new-itemproperty -path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "NoAutoUpdate" -Value "1" -PropertyType DWORD -Force
Configure Timezone Redirection
Disables Storage Sense
For feedback hub collection of telemetry data on Windows 11 Enterprise multi-session
Fix 5k resolution support
Set TLS Settings
Set UTC Time Settings
Set Environment Variables
Check Windows Services
Set RDP Settings
Set Firewall Settings
Sets Dump Log settings
Sets the power configuration
Sets Diskpart SAN policy
Remove WinHTTP proxy
System File Checker
Check disk
Boot Configuration Data settings
Windows Management Instrumentation repository settings
Netstat check for port 3389
Set the pagefile to go to D: drive
Disables Store auto updates
Disables content delivery auto download apps that they want to promote to users
Local GPO Settings to apply
Note: Applying these setting with PowerShell will not show the settings being applied within Local Group Policy Editor. This is by design.
Click on Start and start typing Edit group policy.
Open the Local Group Policy Editor.
Navigate to the paths noted below and set as required:
Remote Desktop Settings
Set RDP Access settings
Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Allow log on through Remote Desktop Services
Check to make sure that administrator's group is added
Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Deny access to this computer from the network
Check to make sure there are no settings set for this
Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Deny log on through Remote Desktop Services
Check to make sure there are no settings set for this
Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Access this computer from the network
Check to make sure that the following groups are listed
Administrators
Backup Operators
Everyone
Users
Set RDP Session Timeouts
Sets the timeout settings for RDP. 15 mins for disconnect when idle, 2 hours for ending session.
Computer configuration\administrative templates\windows components\remote desktop services\remote desktop session host\session time limits
set time limit for active but idle Remote Desktop Services Sessions
enable and set to 15 minutes
End Session when time limits reached
Enable
Set time limit for disconnected sessions
enable and set for 2 hours
or through PowerShell
Windows Explorer Settings
Hide all drive in Windows Explorer except for personal folders (i.e. Documents, downloads, desktop, etc)
User Configuration\Administrative Templates\Windows Components\File Explorer\
Hide these specific drives in My Computer
Select Restrict All drives
Or through PowerShell
Group Policy Settings
Enable group policy loop back in replace mode
Computer Configuration \ Administrative Templates\system\Group Policy
Configure User Group Policy loopback processing mode
Select Enabled and Select Replace
Or through PowerShell
Windows Store Settings
Sets settings to remove access to Windows Store
Computer Configuration\Administrative Templates\Windows Components\Store
Turn off store applications
Select Enable
Or through PowerShell
Sets Start Menu settings
Prevent users from shutting down/reboot/sleeping the VM’s
Computer Configuration\Administrative Templates\Start Menu and Task Bar\
Remove and prevent the access to the shutdown, restart, and sleep
Select and set to Enabled
Or through PowerShell
Run the Virtual Machine Optimization script
This will run and set various settings to optimize the VM.
Extract and copy to \\fileapps.uwaterloo.ca\winapps$\wvd\arts. If the folder exists, overwrite.
On the VM, copy the folder Virtual-Desktop-Optimization-Tool-main to the vm and place it in C:\Temp.
Open PowerShell and navigate to C:\Temp\Virtual-Desktop-Optimization-Tool-main\
Run .\Windows_VDOT.ps1 -WindowsVersion 2009 -Optimizations All -Verbose -AcceptEula
When done, proceed to Installing Software.
Related articles