[vbox-dev] Restore snapshot through pyhon "AttributeError: Failed to find attribute restoreSnapshot in win 8.1"

kaloon jone kaloon5555 at hotmail.com
Wed Oct 18 09:41:39 GMT 2017


Hello There,

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


"

AttributeError: Failed to find attribute restoreSnapshot in win 8.1
"


My python script is : \



import virtualbox
import time
from virtualbox.library import LockType
vbox = virtualbox.VirtualBox()
session = virtualbox.Session()
vm = vbox.find_machine('win 8.1')
vm.lock_machine(session, LockType.shared)
console = session.console;
machine = session.machine


snapShot = vm.find_snapshot("snapshot 1");

snapShotProgress = machine.restore_snapshot(snapShot);
snapShotProgress.WaitForCompletion(300000);

session.unlock_machine()


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.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20171018/01583584/attachment.html>


More information about the vbox-dev mailing list