echo -e '\n\nTypes: deb URIs: http://mirrors.ustc.edu.cn/debian/ Suites: trixie trixie-updates Components: main contrib non-free-firmware Enabled:true
Types: deb URIs: http://mirrors.ustc.edu.cn/debian-security/ Suites: trixie-security Components: main contrib non-free-firmware Enabled:true ' | tee -a /etc/apt/sources.list.d/debian.sources
检查
1
nano /etc/apt/sources.list.d/debian.sources
更换 pve 源
1 2 3 4 5 6
echo -e '\n\nTypes: deb URIs: https://mirrors.ustc.edu.cn/proxmox/debian/pve Suites: trixie Components: pve-no-subscription Enabled:true ' | tee -a /etc/apt/sources.list.d/pve-enterprise.sources
添加完成后在 webui 将 pve 默认的企业源禁用 (一定要禁用否则会有 401 报错)
更新软件包
1 2
apt update apt upgrade -y
CT 模板换源
在 pve 控制台执行
1
sed -i.bak 's|http://download.proxmox.com|https://mirrors.ustc.edu.cn/proxmox|g'/usr/share/perl5/PVE/APLInfo.pm
lxc.apparmor.profile: unconfined lxc.cgroup.devices.allow: a lxc.cap.drop:
启用核显
在 pve 控制台执行
1
nano /etc/pve/lxc/[CT_ID].conf
填入参数
1 2 3 4 5 6
lxc.cgroup2.devices.allow: c 226:0 rwm lxc.cgroup2.devices.allow: c 226:128 rwm lxc.cgroup2.devices.allow: c 29:0 rwm lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file lxc.apparmor.profile: unconfined
进入容器
检查是否直通成功
1 2 3
cd /dev/dri ls
换 Debian 源
1
nano /etc/apt/sources.list
注释原地址,粘贴下方源地址
1 2 3 4
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
保存
1 2 3
ctrl + x y 回车
更新
1 2
apt update apt upgrade -y
虚拟机设置
修改虚拟机配置
1
nano /etc/pve/qemu-server/[VM_ID].conf
硬盘直通
直通硬盘 查询硬盘识别码
1
ls -la /dev/disk/by-id/|grep -v dm|grep -v lvm|grep -v part