sethmlarson / virtualbox-python

Complete implementation of VirtualBox's COM API with a Pythonic interface.
https://pypi.org/project/virtualbox
Apache License 2.0
354 stars 75 forks source link

restoreSnapshot trouble #49

Closed ghost closed 7 years ago

ghost commented 8 years ago

Hi, I'm having a hard time restoring a machine from a snapshot. This is one of the many things that I've tried, and this has gotten me the closest:

`import virtualbox

vm = virtualbox.VirtualBox().find_machine('test') vm.restoreSnapshot()`

but then I get the error: AttributeError: 'IMachine' object has no attribute 'restoreSnapshot'

and by reading this page on the documentation (https://www.virtualbox.org/sdkref/interface_i_machine.html#a5b696740ceccb14750718e2648d6928c) it seems as though iMachine does have an attribute of restoreSnapshot. Any ideas?

sethmlarson commented 7 years ago

You can't use it directly on a machine, you have to use it from a session. Check out MachinePool in pool.py for an example.