The real value of Windows Virtual Desktop is the Multi-Session capability. When comparing to similar products of VDI, WVD Windows 10 image has the capability to cater to multiple users in a single VM. This will help to save Azure usage costs and other licensing costs. However, the VM can be slowed due to the number of users and their workloads. So, it is important to optimize the Windows 10 image while removing unnecessary applications, processors, and services.
Also, with this post, I am discussing optimizing the Teams app to use in multi-session while redirecting camera and audio to the local device. You can configure these settings to the golden image before deploying it in WVD. Please refer to my previous blog post on Image management (here)
Windows 10 Image optimization for WVD
There is a free tool available for optimizing windows 10, which will disable services and remove the application in the operating system that does not require windows virtual desktop session host. This tool is released as a community-driven implementation by Robert M. Smith and Tim Muessig from Microsoft and I referred the post from Christiaan Brinkhoff to implement in my environment. I used this script to optimize my WVD windows 10 image and using it as my golden image after SysPrep.
- To download the Optimization scripts, browse the following GitHub repository and click the code, and select download ZIP
- Unzip the content to a folder
- Open PowerShell in Run as admin and change the Execution policy to Bypass as follows.
- Run the script using the following command inside the unzipped folder
.\Win10_VirtualDesktop_Optimize.ps1 -WindowsVersion 2004 -Verbose
- After the optimization, restart the VM. Then you can SysPrep the image to use in Windows virtual desktop.
Before and After Optimization
Microsoft Teams Optimization for Windows Virtual Desktop
Microsoft has introduced Audio and Video redirection with media optimization for Microsoft teams running on Windows virtual desktop. With media optimization for Microsoft Teams, the Windows Desktop client handles audio-video locally for Teams calls and meetings. You need to install WebRTC clients, which will help to initiate a peer-to-peer high-performance streaming, device redirection to the same hardware device, and another modern decoding.
Installing Teams client with Per-machine mode
- Teams per machine installation only support WVD configured windows 10, so before installation, you need to create the below Registry entry to represent the WVD environment.
Open Regedit and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Teams\ and create a new key as Teams.
- Create a DWORD Value with Name – IsWVDEnvironment, Value-1
- Download the Teams MSI Per-Machine installation from the below URLs
32bit MSI - https://aka.ms/teams64bitmsi
64bit MSI - https://aka.ms/teams32bitmsi
- Navigate to the MSI location from the command prompt and run the below command to install the teams for per-machine mode.
Msiexec /i Teams_windows_x64.msi /l*v Teams.log ALLUSERS=1 ALLUSER=1
- Now the Teams installation will be available in the Program files folder. Usually, it goes to the user's profile.