To limit the possibility of session hijacking, when accessing the VM console, the guest operating system must be locked when the last console user disconnects.
Resolution
To configure the "tools.guest.desktop.autolock" setting within the VM's advanced settings, the setting should be set to "true"& the host must be in maintenance mode, but powered on in order resolve the settings.
Place host in maintenance mode.
Access the vSphere Client: Connect to your vCenter server or ESXi host using the vSphere Client.
Navigate to VM Settings: Right-click the virtual machine and select "Edit Settings".
Go to VM Options: Click on "VM Options".
Choose Advanced: Expand "Advanced" and select "Configuration Parameters".
Edit Configuration: Click "Edit Configuration".
Find or Create "tools.guest.desktop.autolock": Locate the "tools.guest.desktop.autolock" setting or create it if it doesn't exist.
Set to "true": Set the value of "tools.guest.desktop.autolock" to "true".
Click OK: Click "OK" to save the changes.
Note: The change will take effect upon the next cold boot of the VM. It's also recommended to perform this configuration using VMware PowerCLI while the VM is powered on, as the PowerCLI command will apply the change directly.