VBox 的 Python 模块?
我想制作一些 python 脚本来使用 VirtualBox 创建一个“Appliance”。 但是,我在任何地方都找不到有关调用 VBoxService.exe 的任何文档。 嗯,我发现了一些可以在机器外部工作的东西,但没有发现可以在机器内部工作的东西。
有人对这个有了解吗? 如果有一个针对其他语言(例如 C)的库,我会很乐意接受,但 Python 会更受青睐。
I want to make some python scripts to create an "Appliance" with VirtualBox. However, I can't find any documentation anywhere on making calls to VBoxService.exe. Well, I've found stuff that works from OUTSIDE the Machine, but nothing from working from inside the machine.
Does anyone know anything about this? If there's a library for another language like C I'd be okay with it, though Python would be heavily preferred.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
考虑使用 libvirt。 VirtualBox 支持是前沿的(不是在任何版本中,甚至可能还没有在源代码控制中,但可以作为邮件列表上的一组补丁提供)——但是这个单一的 API,可用于 C、Python 和其他几种语言,让您可以控制在 Qemu/KVM、Xen、LXC(Linux 容器)、UML(用户模式 Linux)、OpenVZ 等中运行的虚拟机和映像。
我使用 libvirt 和 qemu/KVM 后端构建和管理虚拟设备(在自动 QA 环境中),它很好地满足了我的需求。
libvirt 可以配置为允许远程访问(例如从其中一台虚拟机内控制或查询 VBoxService 或 libvirtd,您似乎想要这样做 - 尽管我质疑其智慧和实用性),并提供许多身份验证和传输选项。
[警告:libvirt 主要针对类 Unix 操作系统; 它可以为 win32 构建,但是 YMMV]
Consider using libvirt. The VirtualBox support is bleeding-edge (not in any release, may not even be in source control yet, but is available as a set of patches on the mailing list) -- but this single API, available for C, Python and several other languages, lets you control virtual machines and images running in Qemu/KVM, Xen, LXC (Linux Containers), UML (User-Mode Linux), OpenVZ and others.
I build and administer virtual appliances (in an automated QA context) using libvirt with the qemu/KVM backend, and it meets my needs very well.
libvirt can be configured to allow remote access (such as controlling or querying VBoxService or libvirtd from within one of the VMs, which you appear to want to do -- though I question the wisdom and utility), with numerous authentication and transport options available.
[Caveat: libvirt principally targets Unixlike operating systems; it can be built for win32, but YMMV]