Horizon View vGPU desktop – Resolution mismatch on View Client connection

Published by Richard on

I ran into a couple of issues with vGPU powered Horizon View Instant Clone desktops. I already created a post regarding the Flip Screen issue when multi monitor setups are being used, but I also had an issue where the initial resolution would not be set correctly after starting a new VDI session.

When using multi monitor setups in HD resolution (1920 x 1080) I observed the following issues on initial connect:

  1. The VDI session does not size correctly after start. The resolution in the VDI session was set to 2560 x 1600 for both monitors resulting in horizontal and vertical scrollbars. There was no autoresize to match the endpoints configuration, so to get the resolution correct within the session I had to resize the Horizon Client, or disconnect / reconnect. This issue was observed on Windows and ThinOS (Dell Linux) thin clients.
  2. The VDI session does not size correctly after start, but within a few seconds the VDI session would automatically resize from 2560 x 1600 to the correct endpoint configuration.
  3. The VDI session resized correct immediatly when the session was started.

This issue could occur at random and it was noticed that this issue was a result of the way our golden image was sealed before it can be published. As you probably know already, each VMware Horizon image needs to be sealed properly before the snapshot can be made. This includes the release of the IP address so provisioning will be successful. Since this environment is solely based on NVidia GRID powered desktops there is no way to properly shutdown the Golden Image through the vSphere console.

I use the VMware Horizon Direct Connect Agent in my image to setup a Horizon View Client session to shutdown the Golden Image. To properly shutdown the image a simple batchfile is used containing the following tasks:

REM Prompt Image version script to store the image version in the registry
powershell.exe -executionpolicy bypass -file C:\Temp\Prompt-ImageVersion-V01.ps1

REM Uninstall any installed MSI (only if needed)
REM MsiExec /x {MSI GUID} /qb-

REM Enforce new McAfee Agent GUID on Master Image for deployment to new clients
 (McAfee only)
"C:\Program Files\McAfee\Agent\maconfig.exe" -enforce -noguid

REM Remove old VC redistributable files
del c:\eula*
del c:\install*
del c:\vc*
del c:\globdata*

ipconfig /release

shutdown -s -f -t 60

REM Reset multi monitor layout before shutdown of image
REG import Reset-Monitor-Layout.reg

QRes.exe /X:1920 /Y:1080

@echo off
FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V
IF (%adminTest%)==(Access) goto noAdmin
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%G")
echo.
echo goto theEnd
:do_clear
echo clearing %1
wevtutil.exe cl %1
goto :eof
:noAdmin
exit

As you can see in the batchfile a couple of actions are done during the final shutdown of the Golden Image. The task wich will be addressed in this post is the import of the following Registry script file:

Windows Registry Editor Version 5.00

[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration]
[-HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Connectivity]

Save this file as Reset-Monitor-Layout.reg

This regfile will remove all entries withing the Windows registry which correspond to the display setup of the last connection to this Windows session. After clearing these settings I have never observed any resolution mismatch within a connection to a Horizon View desktop. All sessions which are initiated will scale to the endpoint’s resolution just fine!


0 Comments

Leave a Reply