VM in Devtest lab, connection via Bastion (Browser connect) ClearType settings

Gennart, Tony 26 Reputation points
2020-07-14T12:44:47.277+00:00

Hi,
We use "browser connect" via Bastion to connect to our VMs in Devtest-Labs (Base Windows 10).
Sometimes the display is not clear, to solve this we enable "ClearType".
However after logoff/login, the "Cleartype" settings is not saving. Do you have any idea how to solve this?

Also, is there a way to display the VM in multi-screen via this connection Browser connect (Bastion)? => As the option "Use all my monitors for the remote session" with RDP way.

Thanks in advance.

Tony

Azure DevTest Labs
Azure DevTest Labs
An Azure service that is used for provisioning development and test environments.
277 questions
Azure Bastion
Azure Bastion
An Azure service that provides private and fully managed Remote Desktop Protocol (RDP) and Secure Shell (SSH) access to virtual machines.
264 questions
0 comments No comments
{count} votes

Accepted answer
  1. svijay-MSFT 5,236 Reputation points Microsoft Employee
    2020-07-16T12:42:19.077+00:00

    Hello @GennartTony-0062,

    Azure Bastion Host connects the VM with the minimum features.The Font Smoothing/ClearType Text gets enabled/disabled based upon client request - in this case Azure Bastion - is initiating the remote session to without Font Smoothing. That is reason why we see the ClearType Text gets disabled on connecting to the Azure VM.

    Hardcoding the registry keys at machine level and user level will not unfortunately help. Every time, the session is initiated, the remote machine's setting is overridden by the remoting client.

    As far as I have researched, at this point of time we currently don't have a option to configure the Bastion Host to initiate the Remote session with FontSmoothing.

    Upon further researching and testing, I was able to find a temporary workaround :

    Step 1 :
    Create a Powershell script that enables the Clear Type Text .
    Created PS1 file with the below script.

     $signature = @'
     [DllImport("user32.dll")]
     public static extern bool SystemParametersInfo(
         uint uiAction,
         uint uiParam,
         uint pvParam,
         uint fWinIni);
     '@
        
     $SPI_SETFONTSMOOTHING      = 0x004B
     $SPI_SETFONTSMOOTHINGTYPE  = 0x200B
     $SPIF_UPDATEINIFILE        = 0x1
     $SPIF_SENDCHANGE           = 0x2
     $FE_FONTSMOOTHINGCLEARTYPE = 0x2
        
     $winapi = Add-Type -MemberDefinition $signature -Name WinAPI -PassThru
     [void]$winapi::SystemParametersInfo($SPI_SETFONTSMOOTHING, 1, 0, $SPIF_UPDATEINIFILE -bor $SPIF_SENDCHANGE)
     [void]$winapi::SystemParametersInfo($SPI_SETFONTSMOOTHINGTYPE, 0, $FE_FONTSMOOTHINGCLEARTYPE, $SPIF_UPDATEINIFILE -bor $SPIF_SENDCHANGE)
    

    Step 2 :
    Create a task with the trigger - On Connection to user session and action to execute the above script using Powershell.

    12678-image.png

    Output :
    The script ran and enabled the ClearType Text on connecting through the Azure Bastion (or any remoting client)
    The script runtime was very less- you will see a window for a second.
    The text became clearer.

    Additional Suggestion
    In case you would not prefer manually doing the above steps for multiple Lab VMs. You could create custom image from the VM implemented with above steps, create VMs of this custom image.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.