Jul 31 2020 07:45 AM - edited Oct 30 2020 04:40 AM
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.
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.
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.
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.
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.
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.
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.
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
{
"AppxPackage": "Microsoft.WindowsCalculator",
"VDIState": "Enabled",
"URL": "https://www.microsoft.com/en-us/p/windows-calculator/9wzdncrfhvn5",
"Description": "Microsoft Calculator app"
},
Services.json - example Windows Update Service {
"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."
},
Set-ExecutionPolicy -ExecutionPolicy Bypass
.\Win10_VirtualDesktop_Optimize.ps1 -WindowsVersion 2004 -Verbose
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.
Have the user open Task Manager, then end the following two processes:
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.
Dec 15 2020 04:46 PM
@MortenPedholt - Thanks! Not sure who i overlooked that....
Dec 21 2020 08:28 AM
Can't get this fix to work. ShellExperienceHost.exe is not running, shutting down the StartMenuExperienceHost.exe is not helping.
Any idea how to fix that? I'm running 2004.
Jan 12 2021 05:58 PM
@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
Feb 02 2021 12:16 PM - edited Feb 02 2021 12:28 PM
Feb 02 2021 12:16 PM - edited Feb 02 2021 12:28 PM
@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.
Feb 03 2021 05:38 AM
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
Feb 03 2021 06:38 AM
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...
Feb 04 2021 05:10 AM
@Nagorg-Terralogic - Great idea but does need more testing!
Feb 18 2021 10:12 AM
I have an issue when running the tool - it breaks Snip & Sketch. I have excluded the app from being removed. But there seems to be other optimisations happening that breaks it and causes it to crash when pressing Win + Shift + S.
Faulting application name: ScreenClippingHost.exe, version: 2001.22012.0.551, time stamp: 0x5f7e6f9b
Faulting module name: ScreenClipping.dll, version: 2001.22012.0.551, time stamp: 0x5f7e6b8c
Exception code: 0x80000003
Fault offset: 0x000000000001b92d
Faulting process id: 0x200
Faulting application start time: 0x01d7061f864d4936
Faulting application path: C:\Windows\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\ScreenClipping\ScreenClippingHost.exe
Faulting module path: C:\Windows\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\ScreenClipping\ScreenClipping.dll
Report Id: 03cc773f-c630-4c66-aea4-49df01a43ccc
Faulting package full name: MicrosoftWindows.Client.CBS_120.2212.551.0_x64__cw5n1h2txyewy
Faulting package-relative application ID: ScreenClipping
The app works find before optimisation script is run. Now trying to see what optimisations are causing it to break and exclude those as well.
Running on a Windows 10 20H2 image in Azure trying to set up a gold image to update a session pool.
Feb 18 2021 02:01 PM
Howdy.
I believe if you edit the services.json file, find the CapureService and change the VDIState value to "Unchanged", the will allow the CaptureService to start and Snip will work.
Note: I was unable to make it work AFTER it broke, but setting that value kept it from breaking after I rebuilt the session host and re-ran the optimize.
example:
{
"Name": "CaptureService",
"VDIState": "Unchanged",
"URL": "https://docs.microsoft.com/en-us/uwp/api/windows.graphics.capture?view=winrt-19041",
"Description": "OneCore capture service: enables optional screen capture functionality for applications that call the Windows.Graphics.Capture API."
}
Good luck
Feb 18 2021 04:49 PM
You sir are a gent, that got Snip & Sketch working - sort of. Win + Shift + S now works and allows a screen capture, but there is no notification of the screen capture taken. So you can't click on it to open it in Snip & Sketch.
If I go in to Snip & Sketch and start a capture from there, that works and appear so it can be edited. There's another optimisation that is still in play that isn't allowing full functionality.
Feb 19 2021 04:05 AM
I found out why it's not working - toast notifications are disabled in the LGPO phase of the optimisation:
If you set this back to not configured S&S works as expected.
Feb 22 2021 01:49 PM
Feb 22 2021 02:16 PM
May 21 2021 11:33 PM - edited May 21 2021 11:36 PM
May 21 2021 11:33 PM - edited May 21 2021 11:36 PM
@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.
Jun 14 2021 12:35 PM
Dec 16 2021 11:17 AM
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
Dec 16 2021 05:17 PM
Dec 17 2021 08:28 AM
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.
Dec 17 2021 04:11 PM
May 16 2022 01:18 PM