PVE直通核显输出显示Win + macOS Monterey - DELL 7050 MFF 笔记

!!无需提取VBIOS步骤

DELL 7050 MFF: i3 7100 / 16G / 512G NVME


自备软件,只要是5.13内核,7.1 / 7.2 / 7.3都通过测试,5.15 / 5.19内核无法输出显示

proxmox-ve_7.1-2.iso

virtio-win-0.1.225-2.iso


#删除企业源和中文社区源

root@pve:~#rm -rf /etc/apt/sources.list.d/pve-enterprise.list


#下载秘钥

wget http://download.proxmox.com/debian/proxmox-release-bullseye.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg


#修改为阿里云源

cat >/etc/apt/sources.list<<'EOF'
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
EOF


更新升级最新包

apt-get update && apt-get dist-upgrade -y


硬件直通相关

#修改grub文件,注释备份原纪录
vi /etc/default/grub
#GRUB_CMDLINE_LINUX_DEFAULT="quiet"

#1.直通SATA控制器&USB或其他直通(开启iommu硬件分组):
#intel平台
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"

#amd CPU平台
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on"

#2.直通显卡输出显示
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt video=efifb:off,vesafb:off"


添加驱动黑名单,禁止PVE使用核显功能

echo "blacklist snd_hda_intel
blacklist snd_hda_codec_hdmi
blacklist i915" >> /etc/modprobe.d/pve-blacklist.conf


#提取显卡id添加到直通组

lspci -nn
00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers [8086:590f] (rev 06)
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 630 [8086:5912] (rev 04)
00:14.0 USB controller [0c03]: Intel Corporation 200 Series/Z370 Chipset Family USB 3.0 xHCI Controller [8086:a2af]
00:14.2 Signal processing controller [1180]: Intel Corporation 200 Series PCH Thermal Subsystem [8086:a2b1]
00:15.0 Signal processing controller [1180]: Intel Corporation 200 Series PCH Serial IO I2C Controller #0 [8086:a2e0]
00:16.0 Communication controller [0780]: Intel Corporation 200 Series PCH CSME HECI #1 [8086:a2ba]
00:17.0 SATA controller [0106]: Intel Corporation 200 Series PCH SATA controller [AHCI mode] [8086:a282]
00:1b.0 PCI bridge [0604]: Intel Corporation 200 Series PCH PCI Express Root Port #17 [8086:a2e7] (rev f0)
00:1f.0 ISA bridge [0601]: Intel Corporation 200 Series PCH LPC Controller (Q270) [8086:a2c6]
00:1f.2 Memory controller [0580]: Intel Corporation 200 Series/Z370 Chipset Family Power Management Controller [8086:a2a1]
00:1f.3 Audio device [0403]: Intel Corporation 200 Series PCH HD Audio [8086:a2f0]
00:1f.4 SMBus [0c05]: Intel Corporation 200 Series/Z370 Chipset Family SMBus Controller [8086:a2a3]
00:1f.6 Ethernet controller [0200]: Intel Corporation Ethernet Connection (5) I219-LM [8086:15e3]
01:00.0 Non-Volatile memory controller [0108]: Sandisk Corp Device [15b7:5019] (rev 01)

#核显路径通常都是00:02.0
lspci -n -s 00:02.0
00:02.0 0300: 8086:5912 (rev 04)

#提取到的id为8086:5912
echo "options vfio-pci ids=8086:5912" > /etc/modprobe.d/vfio.conf


#加载相应的内核模块

echo vfio >> /etc/modules
echo vfio_iommu_type1 >> /etc/modules
echo vfio_pci >> /etc/modules
echo vfio_virqfd >> /etc/modules


最后把上述的工作全部更新并重启

update-grub && update-initramfs -u && reboot


#检查模块是否正常加载

lsmod | grep vfio
vfio_pci               57344  2
vfio_virqfd            16384  1 vfio_pci
irqbypass              16384  12 vfio_pci,kvm
vfio_iommu_type1       40960  1
vfio                   36864  7 vfio_iommu_type1,vfio_pci


创建Win VM过程使用i440fx机型,硬盘建议使用SATA启用SSD或者VirtIO Block,另外自行直通USB键鼠用于输出显示进行系统安装

手工进入修改VM的配置文件,100是VM的ID号

vi /etc/pve/nodes/pve/qemu-server/100.conf


核显输出显示关键是是1、3行,其余保留默认:

args: -set device.hostpci0.x-igd-gms=1
cpu: host
hostpci0: 0000:00:02.0,legacy-igd=1
vga: none


自行上传系统Win的ISO进行挂载,启动VM进行系统安装


macOS Monterey 部分待补充

评论

  • *
  • *
精彩评论
  • Niangi
    回复
    2023-06-03 16:09:00

    Thank you for this article.
    Have you succeeded for the display by HDMI for Mac Os?
    感谢您的这篇文章。
    Mac Os 的 HDMI 显示成功了吗?
    Thanks