PVE all in one保姆级教程:Windows10,飞牛fnOS, iKuai+iStoreOS, 核显SR-IOV, 黑群晖, TrueNAS

image

一、PVE系统安装

1. 准备工作:下载与写盘

PVE系统下载:

  • 官方源:Proxmox VE官网(选择种子下载通常更快)官网下载

WinPE工具(可选,用于硬盘清理):

写盘工具推荐:

  • Ventoy(强烈推荐):只需将ISO文件拷贝至U盘即可启动,无需反复格式化

  • 其他选项:Rufus、balenaEtcher

操作建议: 准备16GB以上U盘,使用Ventoy写盘后,将PVE系统ISO文件拷贝入内。

2. BIOS/UEFI关键设置

正确的BIOS设置是PVE成功安装与运行的基石:

  • Intel平台:开启VT(虚拟化技术)、VT-D(直接I/O虚拟化)

  • AMD平台:开启SVM(安全虚拟机)、IOMMU(输入输出内存管理单元)

  • 通用设置

    • 启用Above 4G Decoding

    • 启用SR-IOV(如果支持)

    • 启用硬盘热插拔

    • 配置来电自启动

    • 开启网络唤醒(如需要)

    • 优先使用UEFI引导,关闭CSM兼容模式(特别是使用DG1等纯UEFI显卡时)

3. 安装PVE系统

启动安装程序后,按图形界面指引操作。关键网络配置示例如下:

  • PVE管理IP:10.0.0.254/24(请根据实际网络规划调整)

  • 网关:10.0.0.1

  • DNS:10.0.0.1

安装完成后:

  • 访问地址:https://10.0.0.254:8006

  • 默认用户:root

  • 密码:安装过程中设置的密码

注意:访问PVE管理界面的电脑需在同一网段。

4. 系统优化与调整

存储扩容(可选)

移除local-lvm以释放空间(可能影响快照功能):

lvremove pve/data
# 确认后输入 y
lvextend -l +100%FREE -r pve/root

随后在Web界面中:数据中心 → 存储 → 移除local-lvm,再编辑local存储,勾选所有内容类型。

去除订阅提示

根据PVE版本执行相应命令:

PVE 6.3-7.x:

sed -Ezi.bak "s/(Ext.Msg.show\(\{\s+title: gettext\('No valid sub)/void\(\{ \/\/\1/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service

PVE 8.x:

sed -i.backup -z "s/res === null || res === undefined || \!res || res\n\t\t\t.data.status.toLowerCase() \!== 'active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy.service

开启硬件直通功能

1. 修改内核参数:

# Intel CPU
sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT/c\GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt pcie_acs_override=downstream"' /etc/default/grub

# AMD CPU  
sed -i '/^GRUB_CMDLINE_LINUX_DEFAULT/c\GRUB_CMDLINE_LINUX_DEFAULT="quiet amd_iommu=on iommu=pt pcie_acs_override=downstream"' /etc/default/grub

2. 加载VFIO模块:

echo -e "vfio\nvfio_iommu_type1\nvfio_pci\nvfio_virqfd" | tee -a /etc/modules

3. 应用配置并重启:

update-grub
update-initramfs -u -k all
reboot

4. 验证直通:

dmesg | grep iommu  # 检查IOMMU是否启用
lspci               # 查看可直通设备列表

二、虚拟路由系统部署

1. 爱快(iKuai)主路由安装

  1. 下载iKuai镜像并创建虚拟机

  2. 直通网卡,正确配置WAN/LAN口

  3. 设置网关:10.0.0.1(主路由IP)

  4. DNS推荐:223.5.5.5(阿里)和 119.29.29.29(腾讯)

  5. 默认凭证:用户名admin,密码admin

网络测试:

ping baidu.com

2. iStoreOS/OpenWrt旁路由部署

iStoreOS基于OpenWrt开发,提供更友好的用户界面。

安装步骤:

  1. 下载iStoreOS镜像

  2. 将img文件导入PVE存储:

qm importdisk <虚拟机ID> <img文件路径> local
# 示例:qm importdisk 101 /var/lib/vz/template/iso/istoreos.img local
  1. 快速设置:

quickstart
  1. 配置旁路由网关:10.0.0.1(指向主路由IP)

  2. 默认凭证:用户名root,密码password

插件资源:

三、系统维护与优化

PVE软件源替换

注意: 使用DG1显卡直通硬解的用户请勿换源,可能导致驱动失效。

1. 备份原有源配置

cp /etc/apt/sources.list /etc/apt/sources.list_bak

2. 根据PVE版本配置国内源

PVE 7.x (Debian Bullseye):

# 清华源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bullseye pve-no-subscription

PVE 8.x (Debian Bookworm):

# 清华源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bookworm pve-no-subscription

中科大源同样可用,可根据网络状况选择。

3. 注释企业源,添加社区源

nano /etc/apt/sources.list.d/pve-enterprise.list
# 在行首添加 # 注释原内容,并添加:
deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bookworm pve-no-subscription

4. 修复可能的401错误

nano /etc/apt/sources.list.d/ceph.list
# 注释原内容,添加:
deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm no-subscription

5. 更新系统

apt update && apt dist-upgrade -y

PVE界面优化

显示CPU、NVMe、主板温度信息:

(curl -Lf -o /tmp/temp.sh https://raw.githubusercontent.com/a904055262/PVE-manager-status/main/showtempcpufreq.sh || curl -Lf -o /tmp/temp.sh https://mirror.ghproxy.com/https://raw.githubusercontent.com/a904055262/PVE-manager-status/main/showtempcpufreq.sh) && chmod +x /tmp/temp.sh && /tmp/temp.sh remod

四、高级功能:核显SR-IOV配置

SR-IOV允许单个物理网卡或显卡虚拟出多个独立虚拟功能,极大提升虚拟化效率。

安装SR-IOV支持

# 安装依赖
apt install build-* dkms git sysfsutils -y
apt install proxmox-headers-$(uname -r) proxmox-kernel-$(uname -r)

# 克隆代码库(如GitHub连接困难,可使用Gitee镜像)
git clone https://github.com/strongtz/i915-sriov-dkms.git
# 或:git clone https://gitee.com/ifwwww/i915-sriov-dkms

# 编译安装
cd i915-sriov-dkms
dkms add .
# 查看实际版本号并替换下方命令
dkms install -m i915-sriov-dkms -v <版本号> --force

配置SR-IOV参数

  1. 编辑grub配置:

nano /etc/default/grub

quiet后添加:i915.enable_guc=3 i915.max_vfs=7(7为最大虚拟功能数)

  1. 更新配置:

update-grub
update-initramfs -u
  1. 查看核显ID并配置虚拟功能:

lspci | grep VGA  # 记录设备ID
echo "devices/pci0000:00/0000:00:02.0/sriov_numvfs = 3" > /etc/sysfs.conf
  1. 重启并验证:

reboot
lspci | grep VGA  # 应显示多个VGA兼容控制器

卸载SR-IOV(如需要)

# 通过dkms卸载(替换为实际版本号)
dkms remove i915-sriov-dkms/2025.02.03
reboot

五、常用虚拟机系统安装

1. 飞牛NAS (fnOS)

官方资源: 飞牛私有云官网

SR-IOV核显直通特别说明:

  1. 初始安装时不添加核显

  2. 安装完成后手动安装Intel驱动:

sudo -i
wget https://blog.kkk.rs/upload/intel-i915.deb
dpkg -i intel-i915.deb
  1. 关机后添加SR-IOV虚拟核显(切勿直通主显卡)

  2. 验证硬解:通过CPU占用率和核显工具检测

核显监控工具:

apt install intel-gpu-tools -y
intel_gpu_top -d sriov  # 查看SR-IOV使用率

注意:飞牛NAS仍处公测阶段,系统更新后可能需要重新安装驱动。

2. 黑群晖 (DSM)

引导资源:

核显驱动验证:

sudo -i
ls -la /dev/dri        # 检查设备节点
lsmod | grep i915      # 检查驱动模块
dmesg | grep i915      # 检查固件加载

Jellyfin硬解方案:

docker pull nyanmisaka/jellyfin:latest

3. TrueNAS

官方资源: TrueNAS官网

4. Windows系统

推荐版本: 不忘初心Win10 LTSC
必备驱动: virtIO驱动ISO

安装提示:

  • 初始安装时不添加虚拟核显,不勾选主GPU

  • 系统安装完成后再添加显卡设备

  • Intel显卡驱动:英特尔显卡驱动下载页

© 版权声明
THE END
喜欢就支持一下吧
点赞2031 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容