"Invoke-VMScript Failed to authenticate with the guest operating system using the supplied credentials." With open-vm-tools, credentials are correct.

This post was originally published on this site

Hello, I am trying to use Invoke-VMScript to run a specific command on Linux guest machines.

The command errors with the following output:

Invoke-VMScript : 29-10-2020 12:04:47    Invoke-VMScript 

Failed to authenticate with the guest operating system usin

g the supplied credentials.  

At line:1 char:1

+ Invoke-VMScript -VM <REDACTED HOSTNAME> -ScriptText “sudo /bin/b …

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo    

: NotSpecified: (:) [Invoke-VMScript], InvalidGuestLogin

+ FullyQualifiedErrorId : Client20_VmGuestServiceImpl_RunScriptInGuest_ViError,VMware.VimAutomation.ViCore.Cm

   dlets.Commands.InvokeVmScript

 

In the linux host I’m currently trying I see the following in /var/log/audit/audit.log
type=USER_AUTH msg=audit(1603969482.812:4373542): pid=9477 uid=0 auid=4294967295 ses=4294967295 msg=’op=PAM:authentication grantors=? acct=”sa_vmware” exe=”/usr/bin/vmtoolsd” hostname=? addr=? terminal=? res=failed’

/var/log/vmware-vmsvc.log shows the following during the login:

[2020-10-29T11:20:18.672Z] [ message] [vix] VixTools_ProcessVixCommand: command 181
[2020-10-29T11:20:20.256Z] [ warning] [VCGA] PAM error: Authentication failure (7), mapped to VGAuth error 12
[2020-10-29T11:20:20.256Z] [ warning] [vix] VixToolsImpersonateUser: impersonation failed (3050)
[2020-10-29T11:20:20.256Z] [ message] [vix] VixToolsCreateTempFileInt: opcode 181 returning 3050
[2020-10-29T11:20:20.256Z] [ message] [vix] ToolsDaemonTcloReceiveVixCommand: command 181, additionalError = 4294967284

 

/etc/pam.d/vmtoolsd  Is the following:
auth       required     pam_shells.so
auth       substack     password-auth
auth       include      postlogin
account    required     pam_nologin.so
account    include      password-auth

with journalctl -xe I see

Oct 29 12:26:59 <REDACTED HOSTNAME> VGAuth[9477]: vmtoolsd: Username and password mismatch for ‘sa_vmware’.

I am completely sure the password entered in the command is the same as the user password.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.