ReadEnvironmentVariableInGuest API returns system variable in Windows VM
search cancel

ReadEnvironmentVariableInGuest API returns system variable in Windows VM

book

Article ID: 320126

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Symptoms:
If VMware tools versions between  9.10 (included) - 10.2.0 (excluded)  is installed in Windows virtual machine, ReadEnvironmentVariableInGuest API returns system variable irrespective of any user used by the NamePasswordAuthentication data object.

For example:
  • If Windows virtual machine with VMware tools versions prior to 9.10.0 is  installed:
    • User A logs off.
    • Interactive session is set to false.
    • Executing ReadEnvironmentVariableInGuest API by passing NamePasswordAuthentication parameter for user A.
    • It returns environment variables for user A.

      For example, value for variable TEMP is C:\Users\A\AppData\Local\Temp.
       
  • Windows virtual machine with VMware tools versions between  9.10.0 (included)- 10.2.0(excluded) is installed:
    • User A logs off.
    • Interactive session is set to false.
    • Executing ReadEnvironmentVariableInGuest API by passing NamePasswordAuthentication parameter for user A.
    • It returns environment variables for system user.

      For example, value for variable TEMP is C:\Windows\Temp.


Environment

VMware vSphere Web Services SDK 4.1

Resolution

To resolve this issue:
  1. Create the tools.conf file by using this parameter:

    [guestoperations]
    useVGAuth = false

     
  2. In the Windows virtual machine, move the tools.conf file to VMware Tools folder:

    C:\ProgramData\VMware\VMware Tools\tools.conf
 
  1. Restart the virtual machine.
     
Note:
  • If you set useVGAuth to false, you cannot use the SAML bearer tokens for authentication of guest operations. Other functionalities of VMware tools are not affected.
  • SRM fails if you set useVGAuth to false as SRM depends on SAML authentication.
  • This issue is fixed in VMware Tools version 10.2.0, we recommend to upgrade to latest available VMware Tools version and remove [guestoperations]useVGAuth = false from tools.conf

 


Additional Information

Impact/Risks: