Forum Discussion
Christiaan_Brinkhoff
Microsoft
Jul 31, 2020(Azure) Virtual Desktop Optimization Tool now available
Optimizing images has always been an important component of preparing images as part of a traditional Remote Desktop Services (RDS) infrastructure or virtual desktop infrastructure (VDI). Optimizing session hosts, in particular, can increase user density and eventually lower costs. With the Virtual Desktop Optimization Tool, you can optimize your Windows 10, version 2004 multi- and single-session deployments in Windows Virtual Desktop.
Note: The information in this post is community-driven; nothing has yet been officially launched by the Windows Virtual Desktop product team. Credit goes to Robert M. Smith and Tim Muessig from Microsoft, previously known as the VDIGuys, for creating this tool and make it available for free for the community.
Windows 10 multi-session image name change
As noted in recent announcements, Office 365 ProPlus is now Microsoft 365 apps for Enterprise. With this name change, we have updated the Windows Virtual Desktop image names in Azure Marketplace. As a result, when you are looking for an image in the Azure Marketplace image gallery, you should begin by selecting Windows 10 Enterprise multi-session, version 2004 + Microsoft 365 Apps – Gen1 as your baseline image.
How the Virtual Desktop Optimization Tool works
The (Windows) Virtual Desktop Optimization Tool disables services in the operating system that you most likely won’t need for your Windows Virtual Desktop session host. To make sure that your line-of-business (LOB) applications continue running as they should, there are some preliminary steps that should first performed.
Note: There are settings default disabled when you run the scrip out of the box such as AppX Packages for the Windows Calculator. We strongly suggest analyzing the tool via the JSON files that include the default settings. This also gives you the opportunity to enable them before running the tool so they remain untouched. I'll explain more about this later on in the article.
The full list of enhancements for native Windows services will be available soon. Bookmark Run and tune your Remote Desktop Services environment for the latest updates.
Expected performance gains
Windows Virtual Desktop value-added services provider and Microsoft partner LoginVSI performed early tests with the Virtual Desktop Optimization Too and gained over 100 users in their internal benchmarking lab environment with a Windows 10, version 2004 single session. We, therefore, assume that this gain will also be possible with Windows 10 Enterprise multi-session.
VSImax asserts a maximum number of users that are able to log on to the virtual desktop hosts pool as part of the underlying infrastructure. That number is the "sweet spot" as going over that number will decrease performance for all users. (Thanks to LoginVSI for sharing these results with us.)
Note: We recommend you use simulation tools to test your deployment using both stress tests and real-life usage simulations to ensure that your system is responsive and resilient enough to meet user needs Remember to vary the load size to avoid surprises.
Desktops in the Cloud on Performance Optimizations for Windows Virtual Desktop with Robert and Tim (aka VDI Guys)
We recently had the creators of the Virtual Desktop Optimization tool as guests on our Desktops in the Cloud video-podcast. Robert and Tim explained everything you should know, as well as best practices and lessons learned. A must watch in extension to this article. Watch it below.
How to use the Virtual Desktop Optimization Tool
The Virtual Desktop Optimization Tool makes it possible to disable uncommon services for virtual desktop environments, such as Windows Virtual Desktop.
Note: We recommend that you run the script after the Sysprep (System Preparation) process, most likely as startup script w with a large set of virtual machines. This is due to the AppX Packages that conflict and most likely the sysprep will fail.
- Download all scripts from the Virtual-Desktop-Optimization-Tool GitHub repository.
- Select Clone or download, followed by Download ZIP.
Unzip the folder to your Windows Virtual Desktop session host(s) to a specified folder (e.g. C:\Optimize or C:\Temp).
Note: You could also run the scripts as part of your image management procedure e.g. Azure image Builder (AIB) or Azure DevOps.
Important information before running the tool
-
There are settings default disabled when you run the scrip out of the box such as AppX Packages for the Windows Calculator. We strongly suggest analyzing the tool via the JSON files that include the default settings. This also gives you the opportunity to enable them before running the tool so they remain untouched.
-
You can find the JSON file in the Windows built number folder, under ConfigurationFiles - e.g. C:\Optimize\2004\ConfigurationFiles.
-
You've to put the settings to Enabled - that you want to keep as default. Below is the example file for AppX Packages, there are JSON files for Services and scheduled tasks as well.
-
Another option is to remove the while entry out of the JSON file.
AppxPackages.json - Example Windows Calculator App
Services.json - example Windows Update Service{ "AppxPackage": "Microsoft.WindowsCalculator", "VDIState": "Enabled", "URL": "https://www.microsoft.com/en-us/p/windows-calculator/9wzdncrfhvn5", "Description": "Microsoft Calculator app" },
{ "Name": "UsoSvc", "VDIState": "Enabled", "Description": "Update Orchestrator service, manages Windows Updates. If stopped, your devices will not be able to download and install the latest updates." },
- Prepare to launch Windows PowerShell and select Run as Administrator.
- In PowerShell, change the directory to the folder to which you downloaded the scripts, e.g. C:\Optimize or your own specific folder.
- Run the following command:
Set-ExecutionPolicy -ExecutionPolicy Bypass
- Run the Virtual Desktop Optimization Tool using the following command:
.\Win10_VirtualDesktop_Optimize.ps1 -WindowsVersion 2004 -Verbose
Note: When you use a different version of Windows 10, you must change the WindowsVersion parameter. Version 1803 and later are supported for Windows 10 Enterprise. Windows 10 multi-session support is only available with Windows 10, version 2004 and later. - Select Yes when prompted to reboot the session hosts(s).
- Start your Windows Virtual Desktop session.
As you can see in the Task Manager comparison below, the number of threads and handles has decreased noticeably after running the Virtual Desktop Optimization Tool.
Do you have any problems with orphaned Start Menu shortcuts after running the tool?
Have the user open Task Manager, then end the following two processes:
- ShellExperienceHost.exe
- StartMenuExperienceHost.exe
Have them check the Start Menu and they should be gone.
Happy optimizing! 🙂
Let us know your feedback on the tool in the comment section below.
Prefer to watch and learn? There’s also a video on Azure Academy available later this week by Dean Cefola. You can find it here.
- StuartHendryCopper ContributorHello Christian,
Firstly thank you for all your work on the optimisation front. I have been using these scripts for a few years on Windows 10 for AVD for my client.
Been having an issue with W11 23H2 where the start menu crashes. I tried 3 variants:
1) Using the scripts I applied to W10 which has only the AppPackages.json customisation.
2) Using ALL settings as default (no changes in any of the config files)
3) Using minor tweaks in the AppPackages.json
In all cases I am running:
.\Windows_VDOT.ps1 -Optimizations All -AdvancedOptimizations All -AcceptEULA -Verbose
So applying everything. Been working on this for two weeks now, and got totally stuck. If I dont use the scripts it works fine btw. So not sure what is breaking the start menu. Tried with local profiles and FSlogix, and makes no difference.
Works perfectly well on W10, but same scripts on W11 cause the start menu issue. When you click on the start menu, then click on the name of the logged on user, in order to sign out, the start menu disappears and when you check app logs, its crashed. Here is the event log:
I realise I have been too dependant on your 'default' out of the box settings, and will need to tailor them.
Many Thanks
Stuart
Faulting application name: StartMenuExperienceHost.exe, version: 10.0.22621.3958, time stamp: 0x77b900e4
Faulting module name: StartDocked.dll, version: 10.0.22621.4036, time stamp: 0xc9cf76a9
Exception code: 0xc0000005
Fault offset: 0x00000000000125b8
Faulting process id: 0x0x3FD0
Faulting application start time: 0x0x1DB03903ED6C762
Faulting application path: C:\Windows\SystemApps\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\StartMenuExperienceHost.exe
Faulting module path: C:\Windows\SystemApps\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\StartDocked.dll
Report Id: 00134c88-1265-4de5-a10c-f88f518f69f7
Faulting package full name: Microsoft.Windows.StartMenuExperienceHost_10.0.22621.3958_neutral_neutral_cw5n1h2txyewy
Faulting package-relative application ID: App - Michael GranicaCopper ContributorLooking at using this on in our VDI that is running Server 2016 version 1607. Wanted to find out if this will work before attempting on a machine.
- Robert_SmithCopper ContributorHello Michael,
We haven't tested this tool on Server 1607, as 1607 is past end-of-life. Besides that, even if it did run, the gains would likely be fractional, as this tool is geared toward the client OS SKUs.
Thanks,
Robert Smith
- Richard Blanco Jr.Brass Contributor
Hi. Is there a way to perform a process to reverse the optimization process on a WVD host?Unfortunately, not having the Windows Store apps has caused usability issues for a deployment. The users actually need Windows Calculator and the Windows Media player as an example.
Attempts for the user to reinstall the Windows Store app ends in unusual behavior where if the user installs Calculator as an example, it is not available for their current session. Once they logoff and logon again, the Store apps are no longer available and even a taskbar pin to the app no longer works. I assume this may be some Local policy or similar, but not sure where to start to check.
My initial thoughts were to reverse the entire process but not sure that is even possible?
Open to recommendations.Thanks
Richard- MortenPedholtCopper ContributorHi Richard
I hope this can help you a bit.
So I have been using this optimization Tool since it came out both for Azure Virtual Desktop and Windows 365. I have tried reverting once but gave up because many things were a mess. So I created my session host again (It was not a big deal since I'm using DevOps Automation.) and excluded the things in the optimization script I still needed.
Regarding the Windows Store app, if you are using FSLogix, the apps won't be there after the users log off and on again. Then they have to download it again. This is FSLogix specific issue.
https://techcommunity.microsoft.com/t5/azure-virtual-desktop/how-do-we-install-store-apps-the-proper-way/m-p/1603362/highlight/true#M4009- Richard Blanco Jr.Brass Contributor
Thanks so much for your reply. We considered recreating the WVD shared hosts but the amount of LOB apps already in the deployment is staggering.
The link you sent regarding the Modern Windows apps and the FSLogix profile is certainly news to us. All our deployments use FSLogix and the fact that this wont work is amazing. I just tested this in a secondary deployment and the Windows app (i.e. Calculator) definitely gets removed from the user after the install.
I guess I need to find a way to install a regular Win32 calculator app or even the classic windows one if its available.
- DolinhasBrass ContributorHi everyone. Has anyone ran the script successfully from AIB? Or even from JasonofLondon json files? I keep getting failures on the script all the time.
- Chris_Zwergel_925Copper Contributor
Christiaan_Brinkhoff Please create a PowerShell Mgmt Pack for the Optimization Tool. You could do the same thing instead of messing around with JSON without all of the complexity. Think simplicity.
- PasharCopper Contributor
Hi there, thank you guys for developing this tool. I am testing it and having it execute as a start up script after provisioning the Windows 10 2004 multi-session hosts. What I have noticed is that the optimization script appears to break the Citrix Workspace App/Receiver. When the Citrix Receiver is invoked or executed to start a published citrix app, it tries to repair itself. If I dont run the optimization script, the Citrix Workspace App/Receiver launches correctly. Has anyone else seen this?
Thanks
- Nagorg-TerralogicBrass Contributor
Personally I have seen this break a lot of stuff. I've had better luck applying most of the optimizations via GPO. This doesn't remove the MISX Apps but I honestly think this tool takes a "bull in a china closet" approach on that.
My .02...
- PasharCopper Contributor
Nagorg-Terralogic - Great idea but does need more testing!
- GregorySuvalianIron Contributor
Christiaan_Brinkhoff This tool shall reset back execution policy to default or instruct to set it only for current execution scope (current process via Set-ExecutionPolicy Bypass -Scope Process) otherwise it
leaves system in undesired security state.
- GarthlogicBrass Contributor
Christiaan_Brinkhoff Robert_Smith
Any joy on the cleanup? We have FSLogix profiles installed and after running I noticed 2 things.
1) Orphaned icons in the Start menu. Would prefer not to have users have to run a script to clean that up. Is that the only way?
2) I disable XBox items and snip and sketch breaks, and then I can't re-enable and restart the capture service.
Any thoughts or suggestions?
Thanks!Garth
- GarthlogicBrass Contributor
Christiaan_Brinkhoff Great article, thank you very much! Like others I was looking for guidance on when (and where) to run it, since you don't recommend running it before sysprep. Do you suggest local GPEdit startup script, or another way,?
Thank you so much!
Garth
- ChristopherB2175Copper ContributorWhen can we expect a 20H2 refresh of the tool?
- MortenPedholtCopper Contributor
ChristopherB2175 i Think they already added support for 20h2. ?
GitHub - The-Virtual-Desktop-Team/Virtual-Desktop-Optimization-Tool
- fmartelBrass Contributor
Nice work, it is alway welcomed to have an Windows 10 LTSC/ Windows Server 2019 like exeperience, this script and others Microsoft/Citrix recommendations helped us alot to improve the performance of WVD.
Christiaan_Brinkhoffcan you explain what is going on with Wsearch service?
One of our main performance bottleneck is the Wsearch index performance and outlook in multi session environnement.
1909 recommandations is to not enable Windows Search: https://docs.microsoft.com/en-us/windows-server/remote/remote-desktop-services/rds_vdi-recommendations-1909
2004 recommandations according to this script is to let it unchanged. (Auto-Start)
https://github.com/The-Virtual-Desktop-Team/Virtual-Desktop-Optimization-Tool/commits/master/2004
d Some people started to force back Windows Search per machine using multiple tweaks: https://social.msdn.microsoft.com/Forums/en-US/a9b5000d-e2a8-442b-9cbf-48e05136f732/support-for-server-2019-and-office-2019-search-roaming?forum=FSLogix
We are using th default settings Windows Search per users and we had many issues last weeks with the Outlook Build 12527.20880, the index got crazy on large Outlook profiles causing kernel loops. We had to rollback multiples servers to Build 11929.20838.
We are planning to upgrade our customers to Windows 2004 and Office Build 12527.20988 which seem to fix performances issues https://docs.microsoft.com/en-us/officeupdates/semi-annual-enterprise-channel#version-2002-august-11
What are your recomendations, should we disable the service after the upgrade?