<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    <br>
    <div class="moz-cite-prefix">On 18.10.2017 11:41, kaloon jone wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:PS1PR03MB1386483AB29118A814227B2FC74D0@PS1PR03MB1386.apcprd03.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
      <div class="moz-signature">
        <p>Hello There, <br>
        </p>
        <p>I have VM called Win 11 and I create snapshot called
          "Snapshot1". Then I create python file to restore the VM
          through python script. I got error I can'y understand what is
          it. I search on internet  since three day I don't found 
          solution . I tried many example But I got the same error. The
          error is <br>
        </p>
        <p><br>
        </p>
        <p>"</p>
        <div><span style="color: rgb(255, 0, 0);">AttributeError: Failed
            to find attribute restoreSnapshot in win 8.1</span><br>
        </div>
        "
        <p><br>
        </p>
        <p>My python script is : \</p>
        <p><br>
        </p>
        <p><br>
        </p>
        <div>import virtualbox<br>
          import time<br>
          from virtualbox.library import LockType<br>
          vbox = virtualbox.VirtualBox()<br>
          session = virtualbox.Session()<br>
          vm = vbox.find_machine('win 8.1')<br>
          vm.lock_machine(session, LockType.shared)<br>
          console = session.console;<br>
          machine = session.machine<br>
          <br>
          <br>
          snapShot = vm.find_snapshot("snapshot 1");<br>
          <br>
          snapShotProgress = machine.restore_snapshot(snapShot);<br>
          snapShotProgress.WaitForCompletion(300000);<br>
          <br>
          session.unlock_machine()<br>
        </div>
      </div>
    </blockquote>
    <br>
    This is impossible... can't be your full script. You have stuff like
    find_machine, lock_machine, find_snapshot and what not all over the
    place, and that's not how our API methods are called. Do you have
    some wrapper code which you censored out of the script? Need to know
    what you're really doing.<br>
    <br>
    You could also try doing this with vboxshell.py, which is a big
    piece of code (not necessarily pretty, but it can serve as
    inspiration for how to use a significant portion of the API).<br>
    <br>
    <blockquote type="cite"
cite="mid:PS1PR03MB1386483AB29118A814227B2FC74D0@PS1PR03MB1386.apcprd03.prod.outlook.com">
      <div class="moz-signature">
        <div>
          Can Any help me and explain to me which is the problem. I
          snapshot is created and the Vm is run correctly. but I cannot
          restore the snapshot through python.
          <br>
        </div>
      </div>
    </blockquote>
    <br>
    We really need to be certain what your script is doing, because so
    far it's not making any sense. This should fail straight at "vm =
    vbox.find_machine('win 8.1')".<br>
    <br>
    Klaus<br>
  </body>
</html>