This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Step 1. 修改引導設定檔
(找到 GRUB_CMDLINE_LINUX_DEFAULT 行,依據 CPU 類型加入參數)
Intel CPU: intel_iommu=on iommu=pt
(範例:GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt")
AMD CPU: amd_iommu=on iommu=pt
(更新 Grub 引導並重啟速主機)
(重啟後,輸入 dmesg | grep -e DMAR -e IOMMU。若看到 IOMMU enabled 代表啟用成功)
Step 2. 載入 VFIO 核心模組
(在檔案末尾加上以下四行)
Step 3. 尋找控制器 ID (以 Thunderbolt 為例)
找出控制器的 PCI 位址與硬體 ID
PCI 位址:例如 00:0d.0
硬體 ID:例如 8086:9a1b
Step 4. 阻斷宿主機驅動
為了防止 PVE 宿主機搶先佔用控制器,必須強迫它使用 vfio-pci 驅動
(寫入以下內容)
(更新 initramfs 核心映像並重啟速主機)
(重啟後,輸入 lspci -nnk -s 00:0d.0。若看到 Kernel driver in use: vfio-pci 代表隔離成功)
Step 5. 將裝置新增至虛擬機
位置:硬體 > 新增 > PCI 裝置
原始裝置:選取控制器位址
[v] All Functions
[v] ROM-Bar
[v] PCI-Express
PVE 可能是使用 systemd-boot 而非 GRUB
(檢查檔案內是否有以下內容,如果沒有,則直接加在原本內容的尾端)
(讓核心參數生效)