Prepare and customize a master VHD image
This article tells you how to prepare a master virtual hard disk (VHD) image for upload to Azure, including how to create virtual machines (VMs) and install software on them. These instructions are for a Windows Virtual Desktop Preview-specific configuration that can be used with your organization's existing processes.
Create a VM
Windows 10 Enterprise multi-session is available in the Azure Image Gallery. There are two options for customizing this image.
The second option is to create the image locally by downloading the image, provisioning a Hyper-V VM, and customizing it to suit your needs, which we cover in the following section.
Local image creation
Once you've downloaded the image to a local location, open Hyper-V Manager to create a VM with the VHD you copied. The following instructions are a simple version, but you can find more detailed instructions in Create a virtual machine in Hyper-V.
To create a VM with the copied VHD:
Open the New Virtual Machine Wizard.
On the Specify Generation page, select Generation 1.
Under Checkpoint Type, disable checkpoints by unchecking the check box.
You can also run the following cmdlet in PowerShell to disable checkpoints.
Set-VM -Name <VMNAME> -CheckpointType Disabled
If you create a VM from an existing VHD, it creates a dynamic disk by default. It can be changed to a fixed disk by selecting Edit Disk... as shown in the following image. For more detailed instructions, see Prepare a Windows VHD or VHDX to upload to Azure.
You can also run the following PowerShell cmdlet to change the disk to a fixed disk.
Convert-VHD –Path c:\\test\\MY-VM.vhdx –DestinationPath c:\\test\\MY-NEW-VM.vhd -VHDType Fixed
Software preparation and installation
This section covers how to prepare and install FSLogix, Windows Defender, and other common applications.
If you're installing Office 365 ProPlus and OneDrive on your VM, see Install Office on a master VHD image. Follow the link in Next steps of that article to return to this article and complete the master VHD process.
If your users need to access certain LOB applications, we recommend you install them after completing this section’s instructions.
Disable Automatic Updates
To disable Automatic Updates via local Group Policy:
- Open Local Group Policy Editor\Administrative Templates\Windows Components\Windows Update.
- Right-click Configure Automatic Update and set it to Disabled.
You can also run the following command on a command prompt to disable Automatic Updates.
reg add HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU /v NoAutoUpdate /t REG_DWORD /d 1 /f
Specify Start layout for Windows 10 PCs (optional)
Run this command to specify a Start layout for Windows 10 PCs.
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v SpecialRoamingOverrideAllowed /t REG_DWORD /d 1 /f
Set up user profile container (FSLogix)
To include the FSLogix container as part of the image, follow the instructions in Set up a user profile share for a host pool. You can test the functionality of the FSLogix container with this quickstart.
Configure Windows Defender
If Windows Defender is configured in the VM, make sure it's configured to not scan the entire contents of VHD and VHDX files during attachment.
This configuration only removes scanning of VHD and VHDX files during attachment, but won't affect real-time scanning.
For more detailed instructions for how to configure Windows Defender on Windows Server, see Configure Windows Defender Antivirus exclusions on Windows Server.
To learn more about how to configure Windows Defender to exclude certain files from scanning, see Configure and validate exclusions based on file extension and folder location.
Configure session timeout policies
Remote session policies can be enforced on Group Policy level since all VMs in a host pool are part of the same security group.
To configure remote session policies:
- Navigate to Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Session Time Limits.
- In the panel on the right side, select the Set time limit for active but idle Remote Desktop Services sessions policy.
- After the modal window appears, change the policy option from Not configured to Enabled to activate the policy.
- In the drop-down menu beneath the policy option, set the amount of time to 4 hours.
You can also configure remote session policies manually by running the following commands:
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v RemoteAppLogoffTimeLimit /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fResetBroken /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v MaxConnectionTime /t REG_DWORD /d 10800000 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v RemoteAppLogoffTimeLimit /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v MaxDisconnectionTime /t REG_DWORD /d 5000 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v MaxIdleTime /t REG_DWORD /d 7200000 /f
Set up time zone redirection
Time zone redirection can be enforced on Group Policy level since all VMs in a host pool are part of the same security group.
To redirect time zones:
- On the Active Directory server, open the Group Policy Management Console.
- Expand your domain and Group Policy Objects.
- Right-click the Group Policy Object that you created for the group policy settings and select Edit.
- In the Group Policy Management Editor, navigate to Computer Configuration > Policies > Administrative Templates > Windows Components > Remote Desktop Services > Remote Desktop Session Host > Device and Resource Redirection.
- Enable the Allow time zone redirection setting.
You can also run this command on the master image to redirect time zones:
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fEnableTimeZoneRedirection /t REG_DWORD /d 1 /f
Disable Storage Sense
For Windows Virtual Desktop session host that use Windows 10 Enterprise or Windows 10 Enterprise multi-session, we recommend disabling Storage Sense. You can disable Storage Sense in the Settings menu under Storage, as shown in the following screenshot:
You can also change the setting with the registry by running the following command:
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\StorageSense\Parameters\StoragePolicy /v 01 /t REG_DWORD /d 0 /f
Include additional language support
This article doesn’t cover how to configure language and regional support. For more information, see the following articles:
Other applications and registry configuration
This section covers application and operating system configuration. All configuration in this section is done through registry entries that can be executed by command-line and regedit tools.
You can implement best practices in configuration with either Group Policy Objects (GPOs) or registry imports. The administrator can choose either option based on their organization's requirements.
For feedback hub collection of telemetry data on Windows 10 Enterprise multi-session, run this command:
reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection "AllowTelemetry"=dword:00000003 reg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection /v AllowTelemetry /d 3
Run the following command to fix Watson crashes:
remove CorporateWerServer* from Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting
Enter the following commands into the registry editor to fix 5k resolution support. You must run the commands before you can enable the side-by-side stack.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp] "MaxMonitors"=dword:00000004 "MaxXResolution"=dword:00001400 "MaxYResolution"=dword:00000b40 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\rdp-sxs] "MaxMonitors"=dword:00000004 "MaxXResolution"=dword:00001400 "MaxYResolution"=dword:00000b40
Prepare the image for upload to Azure
After you've finished configuration and installed all applications, follow the instructions in Prepare a Windows VHD or VHDX to upload to Azure to prepare the image.
After preparing the image for upload, make sure the VM remains in the off or deallocated state.
Upload master image to a storage account in Azure
This section only applies when the master image was created locally.
The following instructions will tell you how to upload your master image into an Azure storage account. If you don’t already have an Azure storage account, follow the instructions in this article to create one.
Convert the VM image (VHD) to Fixed if you haven’t already. If you don’t convert the image to Fixed, you can't successfully create the image.
Next, go to the Azure portal in your browser and search for “Images.” Your search should lead you to the Create image page, as shown in the following screenshot:
Once you’ve created the image, you should see a notification like the one in the following screenshot:
Now that you have an image, you can create or update host pools. To learn more about how to create and update host pools, see the following articles:
Send feedback about: