VMware {code} Community
karabax
Contributor
Contributor

LogInGuest fails with an error message "The command is not recognized by the Guest OS tools"

Hello,

Using VIP API v1.1.4 against Server v1.02 and getting an error on LogInGuest with the error message specified in the subject. When I execute the same script while machine is already powered on (not through my script) it works fine. As you can see I am using WaitForToolsInGuest and increased my wait time to 3 min still no luck. Any help with this will be greatly appreciated

###Script###

' Connect to host

Set job = lib.Connect("1", VixCOM.Constants.VIX_SERVICEPROVIDER_VMWARE_SERVER, strHostName, 902, strUserName , strPassword, 0, Nothing, Nothing)

Set results = Nothing

Err = job.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), results)

'QuitIfError(err)

Set host = results(0)

' Open the virtual machine provide path to .vmx file

Set job = host.OpenVM(strVMPath, Nothing)

err = job.Wait(Array(VixCOM.Constants.VIX_PROPERTY_JOB_RESULT_HANDLE), results)

'QuitIfError(err)

'Get root snanshot

' Set vm = results(0)

' Err = vm.GetRootSnapshot(0, snapshot)

'

' 'Revert to root snapshot

' Set job = vm.RevertToSnapshot(snapshot, 0, Nothing, Nothing)

' Err = job.WaitWithoutResults()

'

' ' Power on the virtual machine

Set vm = results(0)

Set job = vm.PowerOn(VixCOM.Constants.VIX_VMPOWEROP_LAUNCH_GUI, Nothing, Nothing)

err = job.WaitWithoutResults()

'QuitIfError(err)

'>>>>>>>>>>>>>>>Login and start performing tasks

' Wait until VMware Tools are running within the guest

Set vm = results(0)

Set job = vm.WaitForToolsInGuest(180000, Nothing)

Err = job.WaitWithoutResults()

If lib.ErrorIndicatesFailure(err) Then

WScript.Echo("Error: " & lib.GetErrorText(err, empty))

WScript.Quit

End If

' WScript.Sleep (500)

'

'

Set vm = results(0)

Set job = vm.LoginInGuest("qa\ababayan", "Password1", 0, Nothing)

Err = job.WaitWithoutResults()

If lib.ErrorIndicatesFailure(err) Then

WScript.Echo("Error: " & lib.GetErrorText(err, empty))

WScript.Quit

Else WScript.Echo "Completed"

End If

'

' host.Disconnect()

0 Kudos
1 Reply
karabax
Contributor
Contributor

Updating VMWare tools on Guest OS did the trick.

0 Kudos