允许来宾操作系统直接访问图形适配器
现代硬件辅助桌面虚拟化产品(如 VMWare Workstation 或 VirtualBox)通常为来宾操作系统提供功能有限的虚拟图形适配器。
是否可以切换适配器,即为来宾操作系统提供对真实图形适配器的直接访问,并将虚拟图形适配器分配给主机操作系统?有没有什么软件有这个功能?如果没有,是否可以开发这样的系统?假设我们只有一个来宾操作系统。
Modern hardware-assisted desktop virtualization products (like VMWare Workstation or VirtualBox) normally provide the guest OS with a virtual graphics adapter that has a limited functionality.
Is it possible to switch the adapters, i.e provide guest OS with direct access to the real graphics adapter, and assign a virtual graphics adapter to the host OS? Is there any software that has this functionality? If not, is it possible to develop such system? Let's assume we only have a single guest OS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用Xen 4(目前不稳定分支)实现的VGA直通应该很快就可以实现:
引用Xen 常见问题解答:
“Xen 4.0.0 是第一个支持 VGA 图形适配器直通 Xen HVM(完全虚拟化)来宾的版本。这意味着您可以给HVM 来宾完全直接控制图形适配器,从而可以在虚拟机中实现高性能全 3D 和视频加速"
"Xen VGA 直通需要 IOMMU (Intel VT-d) 支持主板芯片组,来自主板 BIOS 和 Xen。”
请注意,目前只有少数主板支持 IOMMU。请参阅常见问题解答以获取更多信息。
It should be possible soon with using VGA passthrough as implemented by Xen 4 (unstable branch for now):
Quoting the Xen FAQ:
"Xen 4.0.0 is the first version to support VGA graphics adapter passthrough to Xen HVM (fully virtualized) guests. This means you can give HVM guest full and direct control of the graphics adapter, making it possible to have high performance full 3D and video acceleration in a virtual machine"
"Xen VGA passthrough requires IOMMU (Intel VT-d) support from the motherboard chipset, from the motherboard BIOS and from Xen."
Note that only a few motherboard support IOMMU for now. See the FAQ for more info.
I/O 硬件虚拟化(特别是针对显卡)是使用名为 IOMMU 的技术实现的。
AMD 发布了 HyperTransport 架构中 IOMMU 技术的规范。 Intel 发布了 IOMMU 技术规范,称为 Virtualization Technology for Directed I/O,缩写为 VT-d。
通过虚拟化,来宾操作系统可以使用并非专门为虚拟化设计的硬件。 IOMMU 的一个示例是 AGP 和 PCI Express 显卡使用的图形地址重映射表 (GART)。更高性能的硬件如显卡使用DMA直接访问内存;在虚拟环境中,所有内存地址都会由虚拟机软件重新映射,这会导致 DMA 设备发生故障。 IOMMU 处理此重新映射,允许在来宾操作系统中使用本机设备驱动程序。
大多数虚拟化软件支持 OpenGL 硬件加速,其中一些提供 实验性 Direct3D 加速例如VMWare。 VMware、Citrix、VirtualBox等产品提供硬件加速
I/O hardware Virtualization especially for graphics card is made using technology called IOMMU.
AMD has published a specification for IOMMU technology in the HyperTransport architecture. Intel has published a specification for IOMMU technology as Virtualization Technology for Directed I/O, abbreviated VT-d.
With virtualization, guest operating systems can use hardware that is not specifically made for virtualization. An example for IOMMU is Graphics Address Remapping Table (GART) used by AGP and PCI Express graphics cards. Higher performance hardware such as graphics cards use DMA to access memory directly; in a virtual environment all the memory addresses are remapped by the virtual machine software, which causes DMA devices to fail. The IOMMU handles this remapping, allowing for the native device drivers to be used in a guest operating system.
Most of the Virtualization softwares supports hardware acceleration for OpenGL and some of them provides experimental Direct3D acceleration such as VMWare. Products from VMware, Citrix and VirtualBox etc. provides hardware accelaration
什么处理器?
这就是 I/O 虚拟化背后的想法(Intel 的实现称为 VT-d)。您需要 CPU 支持来允许来宾直接访问视频硬件,同时阻止其占用其他资源(例如磁盘系统)。
What processor?
This is the idea behind I/O virtualization (Intel's implementation is called VT-d). You need CPU support to allow the guest direct access to the video hardware while blocking it from stomping on other resources, such as the disk system.