1 2 3 Previous Next 32 Replies Latest reply on Jun 30, 2020 10:35 AM by sachingaikwad

    Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now

    sachingaikwad Novice

      Invoke-VMScript has stopped working from past couple days. The same VM has been working from past few months. But now when I run any Invoke-VMScript command, Invoke-VMScript: 6/24/2020 1:21:39 PM  Invoke-VMScript  A general system error occurred: vix error codes = (1, 0). Error is getting displayed

       

      Sample command:

      $Command_text="dir C:\users\"

      Invoke-VMScript -VM $TARGET_VM -ScriptText $Command_text -GuestUser $vm_user -GuestPassword '&rWn.

       

      Based on the previous posts, I tried following things:

      • Made sure that correct password is used
      • Passed the password in single quote as password contains special char

       

      Here is the vmware.log excerpt:

      2020-06-24T13:51:29.004Z| vcpu-1| I125: Guest: DXUM_devapi: 2020-06-24T09:51:29.0092| Thread ID: 4524 |Application requested vm3ddevapi version 2

       

      2020-06-24T13:51:29.022Z| vcpu-0| I125: TOOLS autoupgrade protocol version 2

      2020-06-24T13:51:29.022Z| vcpu-0| I125: Vix: [mainDispatch.c:4156]: VMAutomationReportPowerStateChange: Reporting power state change (opcode=2, err=0).

      2020-06-24T13:51:29.022Z| vcpu-0| I125: TOOLS Received tools.set.version rpc call, version = 10304, setting type to 1 from guest OS

      2020-06-24T13:51:29.022Z| vcpu-0| I125: Tools_SetVersionAndType did nothing; new tools version (10304) and type (1) match old Tools version and type

      2020-06-24T13:53:50.874Z| vmx| I125: VigorTransportProcessClientPayload: opID=f0c9f8f-2e-0c76 seq=29344: Receiving GuestOps.CreateTemporaryFile request.

      2020-06-24T13:53:51.023Z| vcpu-1| I125: VigorTransport_ServerSendResponse opID=f0c9f8f-2e-0c76 seq=29344: Completed GuestOps request with messages.

       

      Please suggest.

       

        • 1. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
          LucD Guru
          User ModeratorsCommunity WarriorsvExpert

          Did you already try adding the Verbose switch to the Invoke-VMScript cmdlet?

           

          Can you also try adding the parameter -ScriptType Bat, on a Windows Guest OS the default is PowerShell.

           

          As an alternative try my Invoke-VMScriptPlus with the Verbose option.

          That function tends to provide a bit more information.

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
            sachingaikwad Novice

            LucD

            Adding verbose and -ScriptType Bat, didn't help much. This is the output:

            VERBOSE: Performing the operation "Invoke-VMScript" on target "QA-CICD-Win10-64

            VERBOSE: 6/24/2020 3:14:53 PM   Invoke-VMScript Finished execution

            Invoke-VMScript: 6/24/2020 3:15:15 PM   Invoke-VMScript         A general system error occurred: vix error codes = (1, 0).

             

            As you suggested, tried Invoke-VMScriptPlus

            $credVM = Get-VICredentialStoreItem -Host $vmName

            $cred = New-Object System.Management.Automation.PSCredential ($vm_user, (ConvertTo-SecureString $vm_pass -AsPlainText -Force))

            $sInvoke = @{

                VM = $vmName

                GuestCredential = $cred

                ScriptText = 'dir C:\users\'

                ScriptType = 'bash'

            }

            Invoke-VMScriptPlus @sInvoke

            Output:

            Invoke-VMScriptPlus: VMware Tools are not running on VM.

             

            But VMWare Tools is installed in the VM, here is the screenshot.

            Screen Shot 2020-06-24 at 4.01.55 PM.png

             

             

            Tried the Invoke-VMScriptPlus with the Verbose option, this is the output I see:

            PS /Users/sgaikwad> Invoke-VMScriptPlus @sInvoke -Verbose

            VERBOSE: 6/24/2020 4:04:19 PM Get-View Finished execution

            VERBOSE: 6/24/2020 4:04:19 PM Get-View Finished execution

            VERBOSE: 6/24/2020 4:04:19 PM Get-View Finished execution

            VERBOSE: 6/24/2020 4:04:19 PM Get-View Finished execution

            VERBOSE: No GuestOSType value provided. Trying to determine now.

            VERBOSE: It's a Windows guest OS

            VERBOSE: Invalid scripttype provided

            Invoke-VMScriptPlus: For a Windows guest OS the ScriptType can be Bat, PowerShell, PowerShellv6 or PowerShellv7

            MethodInvocationException: /Users/sgaikwad/Invoke-VMScriptPlus V3.ps1:438

            Line |

            438 |  … oraryDirectoryInGuest($moref, $auth, "$($env:USERNAME)_$($PID)", $nul …

                 |                                                             ~~~~

                 | Exception calling "CreateTemporaryDirectoryInGuest" with "5" argument(s): "A general system error occurred: vix error codes = (1, 0). "

             

             

            VERBOSE: Created temp folder in guest OS

            VERBOSE: Encountered a problem creating the script file in the guest OS

            Exception: /Users/sgaikwad/Invoke-VMScriptPlus V3.ps1:459

            Line |

            459 |  Throw "$error[0].Exception.Message"

                 |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                 | Exception calling "CreateTemporaryFileInGuest" with "5" argument(s): "A general system error occurred: vix error codes = (1, 0). " Exception calling "CreateTemporaryDirectoryInGuest" with "5" argument(s): "A general system error occurred: vix error codes

                 | = (1, 0). " For a Windows guest OS the ScriptType can be Bat, PowerShell, PowerShellv6 or PowerShellv7 A parameter cannot be found that matches parameter name 'Veerbose'. VMware Tools are not running on VM QA-CICD-Win10-64 Cmdlet

                 | Get-VICredentialStoreItem is not supported on PowerShell Core. Cannot process argument transformation on parameter 'GuestPassword'. Cannot convert the "&rWnh[Uyw38nYjhu" value of type "System.String" to type "System.Security.SecureString".

                 | System.Management.Automation.ParseException: At line:1 char:1 + . + ~ Missing expression after '.' in pipeline element.    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)    at

                 | System.Management.Automation.Runspaces.Pipeline.Invoke()    at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown, ExecutionOptions options) 6/24/2020 3:15:43 PM Invoke-VMScript  A general system error

                 | occurred: vix error codes = (1, 0).   6/24/2020 3:15:15 PM Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).   The term 'Test-InvokeVMScript' is not recognized as the name of a cmdlet, function, script file, or operable program.

                 | Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 6/24/2020 1:21:39 PM Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).   6/24/2020 1:21:23 PM Invoke-VMScript  A general

                 | system error occurred: vix error codes = (1, 0).   6/24/2020 1:21:07 PM Invoke-VMScript  Timeout error while waiting for VMware Tools to start in the guest.  6/24/2020 9:53:51 AM Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).

                 | 6/22/2020 2:26:35 PM Invoke-VMScript  Server vcenter.nyoffice.company.com is not connected.  6/22/2020 11:53:51 AM Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).   6/22/2020 11:53:40 AM Invoke-VMScript  Value cannot be found for

                 | the mandatory parameter VM  6/20/2020 10:24:34 PM Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).   6/20/2020 10:24:05 PM Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).   6/20/2020 3:58:07 PM

                 | Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).   Cannot bind parameter 'ScriptType'. Cannot convert value "=" to type "VMware.VimAutomation.ViCore.Types.V1.ScriptType". Error: "Unable to match the identifier name = to a valid

                 | enumerator name. Specify one of the following enumerator names and try again: Powershell, Bat, Bash" 6/19/2020 5:23:56 PM Invoke-VMScript  Value cannot be found for the mandatory parameter VM  System.Management.Automation.ParseException: At line:1 char:7

                 | + $ECHO $Command_text +       ~~~~~~~~~~~~~ Unexpected token '$Command_text' in expression or statement.    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)    at System.Management.Automation.Runspaces.Pipeline.Invoke()

                 | at Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown, ExecutionOptions options) System.Management.Automation.ParseException: At line:1 char:7 + $ECHO $Command_text +       ~~~~~~~~~~~~~ Unexpected token

                 | '$Command_text' in expression or statement.    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)    at System.Management.Automation.Runspaces.Pipeline.Invoke()    at

                 | Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown, ExecutionOptions options) System.Management.Automation.ParseException: At line:1 char:7 + $ECHO $Command_text +       ~~~~~~~~~~~~~ Unexpected token

                 | '$Command_text' in expression or statement.    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)    at System.Management.Automation.Runspaces.Pipeline.Invoke()    at

                 | Microsoft.PowerShell.Executor.ExecuteCommandHelper(Pipeline tempPipeline, Exception& exceptionThrown, ExecutionOptions options) 6/19/2020 4:28:51 PM Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).   6/19/2020 4:16:40 PM

                 | Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).   6/19/2020 4:14:46 PM Invoke-VMScript  A general system error occurred: vix error codes = (1, 0).   6/19/2020 4:14:24 PM Invoke-VMScript  A general system error occurred: vix

                 | error codes = (1, 0).   A positional parameter cannot be found that accepts argument 'True'. A positional parameter cannot be found that accepts argument 'True'. A positional parameter cannot be found that accepts argument 'true'. A positional parameter

                 | cannot be found that accepts argument 'True'. Cannot bind parameter 'ScriptType'. Cannot convert value "=" to type "VMware.VimAutomation.ViCore.Types.V1.ScriptType". Error: "Unable to match the identifier name = to a valid enumerator name. Specify one of

                 | the following enumerator names and try again: Powershell, Bat, Bash" 6/18/2020 10:28:05 PM Copy-VMGuestFile  Cannot complete the operation because the file or folder C:\Users\qa.XRAY\RegisterAppiumNodeTask.ps1 already exists  6/18/2020 10:18:34 PM

                 | Copy-VMGuestFile  The guest operations agent could not be contacted.  Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided.

                 | Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were provided. Parameter set cannot be resolved using the specified named parameters. One

                 | or more parameters issued cannot be used together or an insufficient number of parameters were provided. Cannot bind parameter because parameter 'ScriptText' is specified more than once. To provide multiple values to parameters that can accept multiple

                 | values, use the array syntax. For example, "-parameter value1,value2,value3". Parameter set cannot be resolved using the specified named parameters. One or more parameters issued cannot be used together or an insufficient number of parameters were

                 | provided. 6/18/2020 3:25:54 PM Invoke-VMScript  Failed to authenticate with the guest operating system using the supplied credentials.  The term 'New-JobTrigger' is not recognized as the name of a cmdlet, function, script file, or operable program. Check

                 | the spelling of the name, or if a path was included, verify that the path is correct and try again. The term 'New-ScheduledTaskAction' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,

                 | or if a path was included, verify that the path is correct and try again. 6/17/2020 5:04:46 PM Invoke-VMScript  SSPI is not supported on Unix OS. [0].Exception.Message

            • 3. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
              LucD Guru
              User ModeratorsCommunity WarriorsvExpert

              Looks like you specified ScriptType = 'bash' instead of 'bat' on the Invoke-VMScriptPlus call

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 4. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                sachingaikwad Novice

                I got the same output:

                $credVM = Get-VICredentialStoreItem -Host $vmName

                 

                $cred = New-Object System.Management.Automation.PSCredential ($vm_user, (ConvertTo-SecureString $vm_pass -AsPlainText -Force))

                $sInvoke = @{

                    VM = $vmName

                    GuestCredential = $cred

                    ScriptText = 'dir C:\users\'

                    ScriptType = 'bat'

                }

                Invoke-VMScriptPlus @sInvoke

                 

                VERBOSE: 6/24/2020 5:35:25 PM Get-View Finished execution

                VERBOSE: 6/24/2020 5:35:25 PM Get-View Finished execution

                VERBOSE: 6/24/2020 5:35:25 PM Get-View Finished execution

                VERBOSE: 6/24/2020 5:35:25 PM Get-View Finished execution

                Invoke-VMScriptPlus: VMware Tools are not running on VM VMName

                 

                But as I mentioned in the earlier VMware Tools was already installed. I also tried restarting the 'VMWare Tools' service but I was getting the same error.

                --------

                I was running 'Invoke-VMScriptPlus' from Mac so I switched to Windows OS but looks like the script is looking for VIX\VixCOM.dll which was not available.

                So I installed 'VMware-VIX-1.14.0-2306114.exe' from https://my.vmware.com/group/vmware/downloads/get-download?downloadGroup=VIXAPI114 

                But 'VMware-VIX-1.14.0-2306114.exe' got installed in C:\Program Files (x86)\VMware\VMware VIX location and script is still complaining that it is not able to find VIX\VixCOM.dll

                Screen Shot 2020-06-24 at 10.20.03 PM.png

                I see that there are latest versions of 'vmware vix api' available but all the links throw below message. Only VIXAPI114  worked.Screen Shot 2020-06-24 at 10.29.28 PM.png

                Please suggest.

                • 5. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                  LucD Guru
                  Community WarriorsUser ModeratorsvExpert

                  Does the Guest OS account you are using have a profile in the Guest OS?

                  In other words, did you ever logon with that account in the Guest OS?

                  Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                  • 7. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                    LucD Guru
                    User ModeratorsvExpertCommunity Warriors

                    For one reason or another, the Invoke-VMScriptPlus function doesn't seem to be able to create a temporary folder (in which the script and script output will be stored).

                    That folder is created in the temporary folder ($env:Temp) of the user that is defined in the GuestCredential.

                     

                    Just to make sure, can you create a folder in $env:Temp for that user when logged into the Guest OS?


                    Otherwise, you should perhaps consider using debug logging for VMware Tools on that VM.See KB1007873.

                    That might provide some additional information.

                    Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                    • 8. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                      sachingaikwad Novice

                      Can you please let me know the path $env? I tried creating Temp directory in Home directory and C:\Windows it worked as the user I'm logging in with is a domain admin.

                       

                      Turned on the debug logging for VMWare tools, looks like additional logs are getting displayed now.

                      This is the error logs for Invoke-VMScriptPlus function:

                      2020-06-25T15:58:57.949Z| vcpu-2| I125: TOOLS autoupgrade protocol version 0

                       

                      2020-06-25T15:58:57.956Z| vcpu-2| I125: GuestRpc: Reinitializing Channel 1(toolbox)

                      2020-06-25T15:59:00.517Z| vmx| I125: Guest: toolbox: Version: build-7253323

                      2020-06-25T15:59:00.517Z| vcpu-1| W115: GuestRpc: application toolbox, changing channel 65535 -> 0

                      2020-06-25T15:59:00.517Z| vcpu-1| I125: GuestRpc: Channel 0, guest application toolbox.

                      2020-06-25T15:59:00.517Z| vcpu-1| I125: DEPLOYPKG: ToolsDeployPkg_Begin: state=0 err=0, msg=null

                      2020-06-25T15:59:00.527Z| vmx| I125: TOOLS autoupgrade protocol version 2

                      2020-06-25T15:59:00.527Z| vmx| I125: Vix: [mainDispatch.c:4156]: VMAutomationReportPowerStateChange: Reporting power state change (opcode=2, err=0).

                      2020-06-25T15:59:00.528Z| vmx| I125: TOOLS Received tools.set.versiontype rpc call, version = 10304, type = 1

                      2020-06-25T15:59:00.528Z| vmx| I125: Tools_SetVersionAndType did nothing; new tools version (10304) and type (1) match old Tools version and type

                      2020-06-25T15:59:12.442Z| vmx| I125: VigorTransportProcessClientPayload: opID=fe05de9-2a-30ef seq=65225: Receiving GuestOps.CreateTemporaryDirectory request.

                      2020-06-25T15:59:12.674Z| vcpu-2| I125: VigorTransport_ServerSendResponse opID=fe05de9-2a-30ef seq=65225: Completed GuestOps request with messages.

                      2020-06-25T15:59:12.712Z| vmx| I125: VigorTransportProcessClientPayload: opID=53357423-74-30f5 seq=65236: Receiving GuestOps.CreateTemporaryFile request.

                      2020-06-25T15:59:12.720Z| vcpu-1| I125: VigorTransport_ServerSendResponse opID=53357423-74-30f5 seq=65236: Completed GuestOps request with messages.

                      2020-06-25T15:59:30.188Z| vmx| I125: GuestRpc: Got RPCI vsocket connection 526, assigned to channel 1.

                      2020-06-25T15:59:31.204Z| vmx| I125: GuestRpc: Got error for channel 1 connection 527: Remote disconnected

                      2020-06-25T15:59:31.204Z| vmx| I125: GuestRpc: Closing channel 1 connection 527

                      • 9. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                        LucD Guru
                        vExpertCommunity WarriorsUser Moderators

                        That path is defined in the environment variable $env:Temp

                        Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                        • 10. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                          sachingaikwad Novice

                          Yes, I'm able to create TEMP folder in C:\Windows folder.

                          Does logs from vmware.log help? or pls lmk if you need any other info?

                          • 11. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                            LucD Guru
                            vExpertUser ModeratorsCommunity Warriors

                            Are you actually getting back C:\Windows when you display $env:Temp?

                            That should be a path under C:\Users\...

                             

                            The log seems to say that the temp directory was created.

                            Which is strange, since the verbose message seems to indicate the creation of the temp folder failed.

                            Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                            • 12. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                              sachingaikwad Novice

                              You're right in powershell, $env:Temp is printing as C:\Users\QAD3DF_1.XRA\AppdData\Local\Temp

                              But in environment variables I see C:\Windows\Temp location, here is the screenshot

                               

                              Validated that Temp folder exists in the $env:Temp location.

                              • 13. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                                LucD Guru
                                Community WarriorsUser ModeratorsvExpert

                                Ok, so the temp folder is created.

                                 

                                 

                                Next step is to use the KeepFiles switch.

                                That way the temporary folder and files will not be removed and we can check if they exist and what is in there

                                Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                                • 14. Re: Previously working VM - 'A general system error occurred: vix error codes = (1, 0)' is getting displayed now
                                  sachingaikwad Novice

                                  I ran the Invoke-VMScriptPlus with KeepFiles switch. Here is the output:

                                  Screen Shot 2020-06-25 at 1.48.17 PM.png

                                   

                                  In the Guest OS, I see these 2 files created in TEMP folder:

                                  1 2 3 Previous Next