0 Replies Latest reply: Mar 19, 2013 6:59 AM by NinjaManatee RSS

    Getting "VMware Tools are not running in the guest" from VIX, but tools are running

    NinjaManatee Lurker

      I'm having an issue with a Perl VIX script that I am writing. I am connecting to a VM, I wait for the VMWare tools using VMWaitForToolsInGuest, and then I execute a VBScript. After about 15 minutes, I get an 3016 error code "VMWare Tools are not running in the guest", but if I check the VM manually, the tools are running. Does anyone have any clue as to why I might get this error if the tools are running?


      Below is the code that I am using. I am able to connect to the VM before this in the same script without error. The error occurs during the last VMRunProgramInGuest.


      Any help would be greatly appreciated.





      print Time(), "Connecting to host...";
      $err, $hostHandle) = HostConnect(
            $hostName, # hostName
            0, # hostPort
            $userName, # userName
            $password, # password
            0, # options
            VIX_INVALID_HANDLE); # propertyListHandle
      CheckError("HostConnect() failed");
      print "Connected\n";
      print Time(), "Opening VM...";
      ($err, $vmHandle) = VMOpen(
      CheckError("VMOpen() failed");
      print "Opened\n";
      print Time(), "Powering on VM...";
      $err = VMPowerOn(
            VIX_VMPOWEROP_LAUNCH_GUI, # powerOnOptions
            VIX_INVALID_HANDLE);  # propertyListHandle
      CheckError("VMPowerOn() failed");
      print "Powered on\n";
      print Time(), "Waiting for tools...";
      $err = VMWaitForToolsInGuest(
            3600); # timeoutInSeconds
      CheckError("VMWaitForToolsInGuest() failed");
      print "Ready\n";   
      print Time(), "Logging in as $userName...";
      $err = VMLoginInGuest(
            $userName, # userName
            $password, # password
            0); # options
      CheckError("VMLoginInGuest() failed");
      print "Logged in\n";   
      $err =  VMRunProgramInGuest(
            $cscript, #executable
            "$vmTestsDir\\runAnt.vbs $vmTestsDir\\build.xml $buildTarget", #arguments
            0, # options
      CheckError("VMRunProgramInGuest(JUnit tests) failed");
      print "Finished\n";