Virtualization SDK Python path issue on Lion

Discussion in 'General Questions' started by Aditya, Sep 6, 2011.

  1. Aditya

    Aditya Bit poster

    Messages:
    4
    I installed the latest virtualization SDK on Lion & when I tried to use prlsdkapi (python) with Parallels Desktop, I get the following error:

    So I dug in to see where prlsdkapi was installed & found it isn site-packages, which was essentially a symlink to the original location:

    But that above path doesn't exist & I finally found the right location for it :

    But now when I try to rerun my test script, I get the following error:

    So I'm either referencing the wrong module or the module itself probably is not compatible with Lion. Any suggestions?

    --aditya
     
  2. LynnO

    LynnO Member

    Messages:
    28
    I've run into the same problem, although after installing the SDK, the ...Python/prlsdkapi folders are missing. What version of the SDK did you install? Have you made any progress on this?
     
  3. sandro

    sandro Parallels Developers

    Messages:
    512
    Hi guys.

    Please specify version of Parallels Virtualization SDK you use.
     
  4. LynnO

    LynnO Member

    Messages:
    28
  5. sandro

    sandro Parallels Developers

    Messages:
    512
  6. LynnO

    LynnO Member

    Messages:
    28
    That works, thanks! How should I have found that on the Parallels site?
     
  7. sandro

    sandro Parallels Developers

    Messages:
    512
    We apologize for these inconveniences and try to make this info more clear on our site. Good luck and have a good experience with our product intergration.
     
  8. LynnO

    LynnO Member

    Messages:
    28
    Would it be possible to get an example of how prlsdkapi.VmGuest.run_program is used? I am having trouble particularly with how to deal with handles in Python, such has how to create a new handle to a string.
     
  9. Aditya

    Aditya Bit poster

    Messages:
    4
    I was working on a script for automation purposes, but I figured it could be useful to someone else also. I have put my code here - https://github.com/aivaturi/parallels-vm-manager. It is a simple REST(ish) server which will make it easy to manage your VMs remotely. Use doxygen to generate the docs.
     
  10. Aditya

    Aditya Bit poster

    Messages:
    4
    The documentation is kinda convoluted. The C API reference docs are much better. Essentially, you have to first login to the VM guest. In this case, you have to call the Vm.login_in_guest() method first. And remember this is an asynchronous call so, this should get you the VmGuest object (e.g.):

    vm_guest = vm.login_in_guest('user', 'my_awesome_pass').wait().get_param()

    Then you can call other VmGuest methods on it.

    Edit: Forgot about string handles. Look at StringList object in the API. run_program method takes StringList as values for hArgsList & hEnvsList.
     
    Last edited: Sep 22, 2011

Share This Page