Intel CPU
shell里面輸入命令:
nano /etc/default/grub
在里面找到:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
然后修改為
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
在更新一下
update-grub
重啟一下
reboot
AMD CPU
shell里面輸入命令:
nano /etc/default/grub
在里面找到:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
然后修改為
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on""
重啟一下
reboot
補充內容
PVE直通還需要在/etc/modules文件下添加
vfio
vfio_iommu_type1
vfio_pcioptions
vfio_virqfd
這四行內容,並且執行update-initramfs -u -k all命令來更新initramfs.
如果上面這些都弄完了添加了PCI設備無法開啟虛擬機的話需要在/etc/modprobe.d/pve-blacklist.conf文件里面添加一行options vfio_iommu_type1 allow_unsafe_interrupts=1來啟用不安全的中斷。