教程参考B站“张三侃弱电”PVE教程。
一、更换源
订阅源文件:
mv /etc/apt/sources.list /etc/apt/sources.list.bk
nano /etc/apt/sources.list
进入nano,“#” 注释掉旧的源,复制中科大源,Ctrl+O 保存、Y、Crlt+X退出、回车:
deb https://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
deb https://mirrors.ustc.edu.cn/debian bullseye-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security bullseye-security main contrib non-free
用下面cd命令进入订阅源目录:
cd /etc/apt/sources.list.d
rm命令删除旧订阅源文件
rm *.list
使用nano创建新的并进入订阅源文件
nano pve-no-subscription.list
复制下面订阅源写入订阅源文件
deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription
使用下面命令清理下系统冗余
apt clean && apt autoclean && apt autoremove --purge
更新同步订阅源和软件源:
apt update && apt dist-upgrade -y
输入reboot重启系统:
reboot
二、开通SATA直通
使用nano命令进入grub:
nano /etc/default/grub
将前面这行代码删除替换成下面新的代码(只针对intel处理器):
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
修改、替换为:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt i915.enable_guc=3 i915.max_vfs=7 video=efifb:off,vesafb:off"
Ctrl+O 保存、回车、Crlt+X退出、回车;再次输入nano命令:
nano /etc/modules
添加如下模块:
coretemp
nct6775
vfio
vfio_iommu_type1
vfio_pci
vfio
、vfio_iommu_type1
、vfio_pci
是GPU/PCI直通的核心模块,coretemp(Intel CPU温度监控)和nct6775(主板传感器驱动)属于硬件监控模块,与直通功能无直接关联。若需监控主机硬件状态可保留,否则可移除以简化配置。
同样 Ctrl+O 保存、回车、Crlt+X退出、回车;
更新内核:
update-initramfs -k all -u
重启系统完成:
reboot
三、添加桥接网络网口
因为我用的是华擎z390m的itx板,后面是双网口,板载一个802.11的Wi-Fi5模块。实际上刚安装的PVE虽然能识别到三个网口,能连接访问的只有两个物理网口,但是我们在做桥接网口时可以把三个网口都加上。
进入控制网页面板选择 “PVE” - “系统” - “网络”,会发现有个Linux桥接的网络,默认已经有一个了,下面我们需要添加剩余的桥接网络~
点击左上角创建-Linux Bridge,会弹出以下界面,如果你是双网口机器,在名称处输入vmbr1,桥接端口处输入第二个网口的enl0,然后选择右下创建,OK,双网口机器就已经完成。