无法安装具有直通 NIC 的虚拟机。有解决方法吗?

无法安装具有直通 NIC 的虚拟机。有解决方法吗?

我可以安装带有直通 NIC 的 VM 吗?我已完成所有必需步骤。我启用了 iommu,/etc/default/grub并运行了显示 iommu 组的脚本。以下是输出:

    IOMMU Group 0:
    00:00.0 Host bridge [0600]: Intel Corporation 4 Series Chipset DRAM Controller [8086:2e10] (rev 03)
IOMMU Group 1:
    00:01.0 PCI bridge [0604]: Intel Corporation 4 Series Chipset PCI Express Root Port [8086:2e11] (rev 03)
IOMMU Group 2:
    00:19.0 Ethernet controller [0200]: Intel Corporation 82567LM-3 Gigabit Network Connection [8086:10de] (rev 02)
IOMMU Group 3:
    00:1a.0 USB controller [0c03]: Intel Corporation 82801JD/DO (ICH10 Family) USB UHCI Controller #4 [8086:3a67] (rev 02)
    00:1a.1 USB controller [0c03]: Intel Corporation 82801JD/DO (ICH10 Family) USB UHCI Controller #5 [8086:3a68] (rev 02)
    00:1a.2 USB controller [0c03]: Intel Corporation 82801JD/DO (ICH10 Family) USB UHCI Controller #6 [8086:3a69] (rev 02)
    00:1a.7 USB controller [0c03]: Intel Corporation 82801JD/DO (ICH10 Family) USB2 EHCI Controller #2 [8086:3a6c] (rev 02)
IOMMU Group 4:
    00:1b.0 Audio device [0403]: Intel Corporation 82801JD/DO (ICH10 Family) HD Audio Controller [8086:3a6e] (rev 02)
IOMMU Group 5:
    00:1c.0 PCI bridge [0604]: Intel Corporation 82801JD/DO (ICH10 Family) PCI Express Port 1 [8086:3a70] (rev 02)
    00:1c.1 PCI bridge [0604]: Intel Corporation 82801JD/DO (ICH10 Family) PCI Express Port 2 [8086:3a72] (rev 02)
IOMMU Group 6:
    00:1d.0 USB controller [0c03]: Intel Corporation 82801JD/DO (ICH10 Family) USB UHCI Controller #1 [8086:3a64] (rev 02)
    00:1d.1 USB controller [0c03]: Intel Corporation 82801JD/DO (ICH10 Family) USB UHCI Controller #2 [8086:3a65] (rev 02)
    00:1d.2 USB controller [0c03]: Intel Corporation 82801JD/DO (ICH10 Family) USB UHCI Controller #3 [8086:3a66] (rev 02)
    00:1d.7 USB controller [0c03]: Intel Corporation 82801JD/DO (ICH10 Family) USB2 EHCI Controller #1 [8086:3a6a] (rev 02)
IOMMU Group 7:
    00:1e.0 PCI bridge [0604]: Intel Corporation 82801 PCI Bridge [8086:244e] (rev a2)
IOMMU Group 8:
    00:1f.0 ISA bridge [0601]: Intel Corporation 82801JDO (ICH10DO) LPC Interface Controller [8086:3a14] (rev 02)
    00:1f.2 IDE interface [0101]: Intel Corporation 82801JD/DO (ICH10 Family) 4-port SATA IDE Controller [8086:3a00] (rev 02)
    00:1f.3 SMBus [0c05]: Intel Corporation 82801JD/DO (ICH10 Family) SMBus Controller [8086:3a60] (rev 02)
    00:1f.5 IDE interface [0101]: Intel Corporation 82801JD/DO (ICH10 Family) 2-port SATA IDE Controller [8086:3a06] (rev 02)

我想要直通第 2 组中的 NIC。

当我安装机器时,出现以下错误:

Unable to complete install: 'internal error: process exited while connecting to monitor: 2021-01-03T10:05:44.217358Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2021-01-03T10:05:44.219914Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2021-01-03T10:05:44.224019Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2021-01-03T10:05:44.224095Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2021-01-03T10:05:44.245679Z qemu-system-x86_64: -device vfio-pci,host=0000:00:19.0,id=hostdev0,bus=pci.0,addr=0x6: vfio 0000:00:19.0: failed to setup container for group 2: Failed to set iommu for container: Operation not permitted'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2089, in _do_async_install
    guest.installer_instance.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 542, in start_install
    domain = self._create_guest(
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 491, in _create_guest
    domain = self.conn.createXML(install_xml or final_xml, 0)
  File "/usr/lib/python3/dist-packages/libvirt.py", line 4034, in createXML
    if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2021-01-03T10:05:44.217358Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2021-01-03T10:05:44.219914Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2021-01-03T10:05:44.224019Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2021-01-03T10:05:44.224095Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
2021-01-03T10:05:44.245679Z qemu-system-x86_64: -device vfio-pci,host=0000:00:19.0,id=hostdev0,bus=pci.0,addr=0x6: vfio 0000:00:19.0: failed to setup container for group 2: Failed to set iommu for container: Operation not permitted

答案1

我通过编辑/etc/default/grub和添加以下内容解决了该问题

vfio_iommu_type1.allow_unsafe_interrupts=1

相关内容