VMware Cloud Community
yuni1988
Contributor
Contributor
Jump to solution

Copy-VMGuestFile - Failed to authenticate with the guest operating system using supplied credentials. [Linux]

I'm using PowerCLI to copy a file from the host operating system to the guest.

I'm successfully working with Windows VMs, but Linux VM is causing some problems. Note that this is the first time I'm working with a Linux VM, so I might be missing something obvious.

The command:

Get-Item "I:\SWUpdates\myInstaller.tar.gz" | Copy-VMGuestFile -Force -Destination /home/install/Desktop/installerTest\myInstaller.tar.gz -VM Ubuntu-20.4 -LocalToGuest -GuestUser xxx -GuestPassword yyy -Verbose

The error:

Copy-VMGuestFile - Failed to authenticate with the guest operating system using supplied credentials.

+ CategoryInfo          : NotSpecified: (:) [Copy-VMGuestFile], InvalidGuestLogin

+ FullyQualifiedErrorId : Client20_VmGuestServiceImpl_DirectoryExistsInGuest_ViError,VMware.VimAuttomation.ViCore.Cmdlets.Commands.CopyVMGuestFile

  1. Credentials are correct, I am able to log in to the VM using VMWare Workstation.
  2. (possible solution from different thread) VMTools appear to be installed and running on the system. If I run vmware-toolbox-cmd -v, I get: 11.0.5.11716 (build-15389592). ps aux | grep vmtoolsd shows two hits.
  3. (possible solution from different thread) I checked and /bin/bash is listed in /etc/shells.
  4. (possible solution from different thread) I tried wrapping the credentials in single quotes and double quotes, no difference.

Any other ideas what I could check?

Thanks in advance!

Reply
0 Kudos
1 Solution

Accepted Solutions
yuni1988
Contributor
Contributor
Jump to solution

So, one of the IT guys noticed what I was doing wrong - I was using the display name to log in, not the username.

Once I started using the actual username it started to work, so the error was spot on :smileygrin:

Thanks for your time! Smiley Happy

View solution in original post

Reply
0 Kudos
5 Replies
LucD
Leadership
Leadership
Jump to solution

Did you already try setting the logging level to 'verbose' for the VCSA and then check the vpxd log?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
yuni1988
Contributor
Contributor
Jump to solution

Could you please point me to the instructions on how to do this?

Is this done on the vSphere or the guest?

I tried following these instructions:

VMware Knowledge Base

The log files are generated, but I'm unsure what I should be looking for.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

That is logging for VMware Tools, I meant the vpxd log on the VCSA.
You can set that via Advanced Settings for te VCSA.
See Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting d...


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
yuni1988
Contributor
Contributor
Jump to solution

OK, after some help from IT, I was able to get this log...

This appears to be the relevant part:

2020-08-18T06:09:52.678+02:00 verbose vpxd[04313] [Originator@6876 sub=guestops opID=390d22d] [PostGuestOpEvent] reporting event for ListFilesInGuest

2020-08-18T06:09:52.678+02:00 verbose vpxd[04313] [Originator@6876 sub=Vmomi opID=390d22d] Invoke error: vim.vm.guest.FileManager.listFiles session: 52216618-ac1d-b82e-85be-4fbef8dd90a6 Throw: vim.fault.InvalidGuestLogin

2020-08-18T06:09:52.679+02:00 info vpxd[04313] [Originator@6876 sub=vpxLro opID=390d22d] [VpxLRO] -- FINISH lro-2152869

2020-08-18T06:09:52.679+02:00 info vpxd[04313] [Originator@6876 sub=Default opID=390d22d] [VpxLRO] -- ERROR lro-2152869 -- guestOperationsFileManager -- vim.vm.guest.FileManager.listFiles: vim.fault.InvalidGuestLogin:

--> Result:

--> (vim.fault.InvalidGuestLogin) {

-->    faultCause = (vmodl.MethodFault) null,

-->    faultMessage = <unset>

-->    msg = "Received SOAP response fault from [<cs p:00007f0208470b10, TCP:esxi2.our.server:443>]: listFiles

--> Received SOAP response fault from [<cs p:000000be2025d3c0, TCP:localhost:8307>]: listFiles

--> Failed to authenticate with the guest operating system using the supplied credentials."

--> }

--> Args:

-->

--> Arg vm:

--> 'vim.VirtualMachine:vm-37'

--> Arg auth:

--> (vim.vm.guest.NamePasswordAuthentication) {

-->    interactiveSession = false,

-->    username = "xxx",

-->    password = (not shown)

--> }

--> Arg filePath:

--> "/home/install/Desktop/installerTest/myFile.tar.gz"

--> Arg index:

--> 0

--> Arg maxResults:

--> 2

--> Arg matchPattern:

-->

2020-08-18T06:09:52.679+02:00 verbose vpxd[04617] [Originator@6876 sub=PropertyProvider opID=390d22d] RecordOp ASSIGN: disabledMethod, vm-16796. Sent notification immediately.

2020-08-18T06:09:52.680+02:00 warning vpxd[04617] [Originator@6876 sub=MoHost opID=18d68a2f] Unknown API version 6.7.3 found for host esxi2.our.server; assuming it is compatible with vim.version.version7

2020-08-18T06:09:52.680+02:00 verbose vpxd[04617] [Originator@6876 sub=Vmomi opID=18d68a2f] Invoke done: vmodl.query.PropertyCollector.waitForUpdatesEx session: 5239b8d7-2c82-c071-e7cf-de5b8dc3c0d8

2020-08-18T06:09:52.710+02:00 verbose vpxd[04315] [Originator@6876 sub=Default opID=75f46403] [VpxVmomi] Invoking [waitForUpdatesEx] on [vmodl.query.PropertyCollector:propertyCollector] session [5239b8d7-2c82-c071-e7cf-de5b8dc3c0d8(52667de0-4520-e2d9-dc1b-5cabd6206d3b)]

Do you notice anything useful?

I'm unsure what the API version warning is referring to - my PowerCLI version is 11.2.0 build 12483598, if it's relevant.

Reply
0 Kudos
yuni1988
Contributor
Contributor
Jump to solution

So, one of the IT guys noticed what I was doing wrong - I was using the display name to log in, not the username.

Once I started using the actual username it started to work, so the error was spot on :smileygrin:

Thanks for your time! Smiley Happy

Reply
0 Kudos