VMware App Volumes, NVIDIA, InstaClones, and the Invalid Session Cookie Error

Error from Manager [REDACTED]
[error code: 401]:
Invalid session cookie: Session key [REDACTED] does not match active computer session [REDACTED] on Computer [REDACTED]
Virtualization is disabled

This is the error we received after logging into a Horizon View Desktop with an NVIDIA GPU enabled. it is a weird conflict with App Volumes, NVIDIA GPU, and Instaclones basically. The way the GPUs are assigned to the instaclones requires them to be restarted twice which creates a weird issue with App Volumes Session Cookies. They get a second cookie which creates a mismatch and prevents the agent from mounting any application volumes.

We originally found the solution in this blog post and this forum thread.
The fix is basically to manually disable the agent session cookies in the SQL database.

One of the VMware support techs changed something in the settings table in the App Volume Management database: 
disable_agent_session_cookie = 1

So far the change was pretty easy and didn’t create an issues with non-gpu desktops or other VDI sessions.

Happy InstaCloning!