First of all, it is not really a Windows Virtual Desktop problem, this has been a Microsoft Windows setting for many years now. However, when publishing a Desktop or a RemoteApp from a Windows Virtual Desktop host pool where the session host VMs running Windows 10, there are no visible borders around the windows by default.
For example, see the blow screenshot. A File Explorer window is open, with on top of it the Microsoft Paint application. You cannot see where one window ends and the other one starts.
This can easily be fixes by changing a registry key value under HKEY_CURRENT_USER and logoff and login again.
Manually
You can test it by running the following command in your Windows Virtual Desktop session and logoff and login again.
reg add "HKCU\Control Panel\Desktop" /v UserPreferencesMask /t REG_BINARY /d 9032078010000000 /f
Default user
To apply this setting to all users, you can add the registry key to the Default User profile. However, keep in mind that in this case the setting will only be applied to users that will login for the first time and not already have an existing profile.
To add this registry key to the Default User profile, login as Administrator to your “Master VM” or session host VM. Start an elevated DOS prompt and run the following commands.
To load the Default User hive run:
reg Load HKLM\WVD C:\Users\Default\NTUSER.DAT
To add the registry key run:
reg add "HKLM\WVD\Control Panel\Desktop" /v UserPreferencesMask /t REG_BINARY /d 9032078010000000 /f
To unload the Default User hive run:
reg Unload HKLM\WVD
Group Policy Preference
You can also apply this registry key via a Group Policy Preference. But keep in mind that in this case the setting will apply the second time the user will login and not the first time.
Open the Group Policy Management Editor, open or create a GPO that will apply on the Windows Virtual Desktop host pool. Navigate to: User Configuration > Preferences > Windows Settings > Registry
Add a New Registry key with the following parameters;
Action : Update
Hive : HKEY_CURRENT_USER
Key Path : Control Panel\Desktop
Value name : UserPreferencesMask
Value type : REG_BINARY
Value data : 9032078010000000
After adding the setting to the GPO, run gpupdate /force in an elevated Command Prompt on every session host VM in your host pool.
The result
Once the setting have been applied to the user, every window now has a border, as you can see in the screenshot below.
[…] https://www.robinhobo.com/how-to-fix-the-borderless-window-problem-in-windows-virtual-desktop/ […]
[…] Robin Hobo has shared a solution to the problem that many face around not having a border around applications when they are published. Robin explains what the problem is, the fix and the end result. You can read the post here – https://www.robinhobo.com/how-to-fix-the-borderless-window-problem-in-windows-virtual-desktop/ […]
Why on earth can Microsoft think that borderless Windows is a good idea by default. This modern UI is terrible. So many lo contrast or low contrast controls, disappearing grab-bars, etc… It takes longer to use this UI. You have so slowly move your mouse near where you think the control is. “I know its around here somewhere!”
In my opinion Windows Vista “Aero” was hands-down the BEST Windows UI. Why is this not an option anymore?
Thank you so much. This works perfectly and it has been annoying me for some time since working from home with remote desktop
thanks, worked like a charm