如何在 python 中使用 VixVM_RunProgramInGuest vix 库?

How can use VixVM_RunProgramInGuest vix library in python?

您好,我想在 python 中为 vm_ware 工作站中的 运行 应用程序使用 RunProgramInGuest 函数,但我不能,因为我不知道引用。 我想要该功能的简单代码,在此先感谢。

您可能会发现 vix 很有用(可以在@https://github.com/naim94a/vixpip install vix 找到)。这个库以安全的方式 (RAII) 包装了 VIX API 并且是面向对象的。

import vix

host = vix.VixHost()
host.connect()

vm = host.open_vm("C:\Virtual Machines\MyVM.vmx")
vm.login(username="GuestUserName", password="GuestPassword")

vm.proc_run("C:\GuestExecutable.exe")

当然,如果您想自己包装调用,可以在此处找到官方文档:https://www.vmware.com/support/developer/vix-api/vix115_reference/index2.html