文章目录
  1. 1. Proxmox VE 8.0 相关
    1. 1.1. 去掉未订阅的提示
    2. 1.2. 修改国内软件镜像源
    3. 1.3. 硬件直通

Proxmox VE 8.0 相关

去掉未订阅的提示

Proxmox VE 6.3 / 6.4 / 7.0 / 7.1 / 7.2 / 7.3 / 7.4 / 8.0

1
2
3
4
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

修改国内软件镜像源

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 将此文件的中的所有内容注释掉
nano /etc/apt/sources.list.d/pve-enterprise.list

# 下载中科大的GPG KEY
wget https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-release-bookworm.gpg -O /etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg

# 使用Proxmox非企业版源
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-no-subscription.list

# 将Debian官方源替换为中科大源
sed -i 's|^deb http://ftp.debian.org|deb https://mirrors.ustc.edu.cn|g' /etc/apt/sources.list
sed -i 's|^deb http://security.debian.org|deb https://mirrors.ustc.edu.cn/debian-security|g' /etc/apt/sources.list

# 替换Ceph源
echo "deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription" > /etc/apt/sources.list.d/ceph.list

# 替换CT镜像下载源
sed -i 's|http://download.proxmox.com|https://mirrors.ustc.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm

硬件直通

PVE开启硬件显卡直通功能

1
2
3
4
5
6
root@pve:~# vim /etc/default/grub
#开启IOMMU支持 Intel CPU
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on video=efifb:off"

#如果是AMD的CPU:
GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on video=efifb:off"

添加所需的系统模块(驱动):

1
2
3
4
5
vim /etc/modules
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd

接着添加模块(驱动)黑名单,即让GPU设备在下次系统启动之后不使用这些驱动,把设备腾出来给vfio驱动用:

1
2
3
4
# Intel核显:
echo "blacklist snd_hda_intel" >> /etc/modprobe.d/pve-blacklist.conf
echo "blacklist snd_hda_codec_hdmi" >> /etc/modprobe.d/pve-blacklist.conf
echo "blacklist i915" >> /etc/modprobe.d/pve-blacklist.conf

保存退出后更新服务

1
2
3
update-initramfs -u
update-grub
reboot

重启上来之后检查模块是否正常加载:

1
2
3
4
5
6
7
root@pve:~# lsmod | grep vfio
vfio_pci 16384 0
vfio_pci_core 94208 1 vfio_pci
irqbypass 16384 2 vfio_pci_core,kvm
vfio_iommu_type1 49152 0
vfio 57344 3 vfio_pci_core,vfio_iommu_type1,vfio_pci
iommufd 73728 1 vfio

查看显卡

1
2
3
root@pve:~# lspci -nn | grep Graphics
00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-N [UHD Graphics] [8086:46d1]
root@pve:~#

查看显卡ID,写入到配置中

1
2
3
4
5
root@pve:~# lspci -n -s 00:02
00:02.0 0300: 8086:46d1
root@pve:~#

echo "options vfio-pci ids=8086:46d1" > /etc/modprobe.d/vfio.conf
文章目录
  1. 1. Proxmox VE 8.0 相关
    1. 1.1. 去掉未订阅的提示
    2. 1.2. 修改国内软件镜像源
    3. 1.3. 硬件直通