title: Error restore virtual machine snapshot in Virtual Box
body: <p>I use VirtualBox and Virtual Box API Microsoft Com C++ for my project. 
  It’s VirtualBox 6.0.6 Software Developer Kit (SDK) and VirtualBox 6.0.6 platform packages.<br>
  I have a problem. I want to recover a snapshot system, that was created early, but the program shows errors.<br>
  My code with comments: </p>
  
  <pre><code>HRESULT rc; 
  
  IVirtualBoxClient *virtualBoxClient = nullptr; 
  IVirtualBox *virtualBox = nullptr; 
  IMachine *machine = nullptr; 
  ISession *session = nullptr; 
  IProgress *progress = nullptr; 
  ISnapshot* snapshot = nullptr; 
  
  BSTR sessiontype = SysAllocString(L"gui"); 
  BSTR machineName = SysAllocString(L"Win7x64"); 
  
  
  HRESULT rc = CoCreateInstance(CLSID_VirtualBoxClient, NULL, CLSCTX_INPROC_SERVER, IID_IVirtualBoxClient, (void**)&amp;virtualBoxClient); 
  
  rc = virtualBoxClient-&gt;get_VirtualBox(&amp;virtualBox); 
  
  // looking for a machine with a name Win7x64 
  rc = virtualBox-&gt;FindMachine(machineName, &amp;machine); 
  
  // create a session object 
  rc = CoCreateInstance(CLSID_Session, NULL, CLSCTX_INPROC_SERVER, IID_ISession, (void**)&amp;session); 
  if (!SUCCEEDED(rc)) 
  { 
  printf("Error creating Session instance! rc = 0x%x\n", rc); 
  break; 
  } 
  
  // block the machine 
  machine-&gt;LockMachine(session, LockType::LockType_Shared); 
  
  // the name of the snapshot system 
  BSTR snapshotUUID = SysAllocString(L"Win7_test_snapshot"); 
  // looking for a snapshot system 
  rc = machine-&gt;FindSnapshot(snapshotUUID, &amp;snapshot); 
  // recover snapshot. ERROR: variable rc - E_NOTIMPL Not implemented. 
  rc = machine-&gt;RestoreSnapshot(snapshot, &amp;progress); 
  
  printf("Starting VM, please wait ...\n"); 
  //waiting for the end of the operation. Abnormal termination- progress == nullptr ! 
  rc = progress-&gt;WaitForCompletion(-1); 
  // unlocking the machine 
  rc = session-&gt;UnlockMachine(); 
  if (!SUCCEEDED(rc)) 
  { 
  printf("Error restore state machine!\n"); 
  break; 
  }
  </code></pre>
  
  <p>Also, I  created a simple C # application, and got the exact same error there. What's the matter? This is mistake API ? I even changed the OS (virtual) many times:</p>
  
  <pre><code>  static void Main(string[] args)
      {
          VirtualBox.VirtualBox virtualBox = new VirtualBox.VirtualBox();
          IMachine vmMachine = virtualBox.FindMachine("Win7x64VB");
          Session session = new Session();
          vmMachine.LockMachine(session, LockType.LockType_Shared);
          IConsole console = session.Console;
  
          // Restore snapshot
          ISnapshot snapShot = vmMachine.FindSnapshot("Win7_snapshot1");
  
          IProgress snapShotProgress = vmMachine.RestoreSnapshot(snapShot);
          snapShotProgress.WaitForCompletion(300000);
  
          // unlock before launch VMProcess
          session.UnlockMachine();
  
          IProgress launchVmProgess = vmMachine.LaunchVMProcess(session, "gui", "None");
  
          launchVmProgess.WaitForCompletion(300000);
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/qcW4W.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qcW4W.jpg" alt="enter image description here"></a></p>
  
  <p>Can you help me, how to fix call method error “ RestoreSnapshot - E_NOTIMPL Not implemented” or how to restore a snapshot of the system correctly? Thank you.</p>
  
  <p>P.S.: I asked this question on the official forum, but no one helps me.</p>