20250320已更新:最新保姆级PVE8安装教程!虚拟机PCIE设备及SR-IOV核显直通,最多分配7个虚拟化单独核显!最强虚拟机!
去除 PVE 的登录弹窗
Proxmox VE 6.3 / 6.4 / 7.0 / 7.1 / 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 去掉未订阅的提示
sed -i_orig "s/data.status === 'Active'/true/g" /usr/share/pve-manager/js/pvemanagerlib.js
sed -i_orig "s/if (res === null || res === undefined || \!res || res/if(/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
sed -i_orig "s/.data.status.toLowerCase() !== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
systemctl restart pveproxy
更换 PVE 源
可选,不换源也是可以的(推荐更换)
wget https://v2rayssr.com/tool/yuan.sh -O yuan.sh && chmod +x yuan.sh && ./yuan.sh
直通 PCIe 设备
目前的 PVE 版本,默认开启了 PCIE 直通。
检验 PCIE 直通结果
Shell 窗口输入 lspci ,回显如下(里面包含你所有的 PCIe 设备列表):
root@pve:~# lspci
0000:00:00.0 Host bridge: Intel Corporation Device 4640 (rev 02)
0000:00:01.0 PCI bridge: Intel Corporation 12th Gen Core Processor PCI Express x16 Controller #1 (rev 02)
0000:00:02.0 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
0000:00:06.0 System peripheral: Intel Corporation RST VMD Managed Controller
0000:00:0a.0 Signal processing controller: Intel Corporation Platform Monitoring Technology (rev 01)
0000:00:0e.0 RAID bus controller: Intel Corporation Volume Management Device NVMe RAID Controller
0000:00:14.0 USB controller: Intel Corporation Alder Lake-S PCH USB 3.2 Gen 2x2 XHCI Controller (rev 11)
0000:00:14.2 RAM memory: Intel Corporation Alder Lake-S PCH Shared SRAM (rev 11)
0000:00:15.0 Serial bus controller: Intel Corporation Alder Lake-S PCH Serial IO I2C Controller #0 (rev 11)
0000:00:15.1 Serial bus controller: Intel Corporation Alder Lake-S PCH Serial IO I2C Controller #1 (rev 11)
0000:00:15.2 Serial bus controller: Intel Corporation Alder Lake-S PCH Serial IO I2C Controller #2 (rev 11)
0000:00:16.0 Communication controller: Intel Corporation Alder Lake-S PCH HECI Controller #1 (rev 11)
0000:00:17.0 System peripheral: Intel Corporation RST VMD Managed Controller
0000:00:1a.0 System peripheral: Intel Corporation RST VMD Managed Controller
0000:00:1b.0 PCI bridge: Intel Corporation Device 7ac0 (rev 11)
新建虚拟机,参数随意,用于检测 PCIE 是否直通成功。
来到虚拟机的硬件界面,点击添加 PCI 设备,选择 原始设备,参看 PCIE 设备列表,查看网口是否被划分为单个设备。

以上,为直通成功,可以看到两张四口的网卡,被划分为了八个网口。
开启核显的 SR-IOV
GitHub – strongtz/i915-sriov-dkms:Linux i915驱动的dkms模块,支持SR-IOV
在以下的 SR – IOV 设置中,请开启 PVE 的外网访问(需要访问 GitHub ),博主是已经提前在 PVE 部署了 OpenWRT,用于旁路由。
具体命令如下,若是不太明白,推荐先观看 本期视频
# 2025-03-20 支持内核 6.8
# 保证 PVE 为科学网络
# 2025 03 20 测试情况:教程支持最新 PVE 8.3.1 内核版本:6.8.12-4-pve
# 更换源(可选,但是推荐更换)
wget https://v2rayssr.com/tool/yuan.sh -O yuan.sh && chmod +x yuan.sh && ./yuan.sh
# 更新源
apt update -y
# 后续避免升级内核
apt install build-* dkms git sysfsutils -y
apt install proxmox-headers-6.8 proxmox-kernel-6.8
# 下面的命令若是失效,请留意作者项目地址的更新地址 https://github.com/strongtz/i915-sriov-dkms
wget -O /tmp/i915-sriov-dkms_2025.02.03_amd64.deb "https://github.com/strongtz/i915-sriov-dkms/releases/download/2025.02.03/i915-sriov-dkms_2025.02.03_amd64.deb"
dpkg -i /tmp/i915-sriov-dkms_2025.02.03_amd64.deb
# i915.max_vfs=3 这个 3 是需要虚拟的核显数量,需要和下面命令中的 sriov_numvfs = 3 数量一致
sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT/c\GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on i915.enable_guc=3 i915.max_vfs=3 module_blacklist=xe"' /etc/default/grub
update-grub
update-initramfs -u -k all
lspci | grep VGA # 请记录当前的核显ID,修改下行的ID后执行下面的代码。
# 下面的 sriov_numvfs = 3 是虚拟的核显数量,需要和上面命令中的 i915.max_vfs=3 数量一致
echo "devices/pci0000:00/0000:00:02.0/sriov_numvfs = 3" > /etc/sysfs.conf
reboot
重启之后,在 SHELL 窗口输入 lspci | grep VGA ,回显如下所示,SR-IOV 开启成功,成功虚拟出了 7 个核显。
root@pve:~# lspci | grep VGA
0000:00:02.0 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
0000:00:02.1 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
0000:00:02.2 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
0000:00:02.3 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
0000:00:02.4 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
0000:00:02.5 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
0000:00:02.6 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
0000:00:02.7 VGA compatible controller: Intel Corporation AlderLake-S GT1 (rev 0c)
root@pve:~#

上图中的 26 — 32 为 SR-IOV 虚拟出来的 7 个核显。