主板设置#
- 开启SVM模式
- 开启IOMMU
- 关闭 CSM Support
- 关闭 Secure Boot (安全启动)
修改IP#
/etc/network/interfaces
/etc/issue
/etc/hosts
直通显卡#
- 修改grub启动参数:改文件
/etc/default/grub
中GRUB_CMDLINE_LINUX_DEFAULT
配置:1
`GRUB_CMDLINE_LINUX_DEFAULT="quiet iommu=pt initcall_blacklist=sysfb_init amd_iommu=on drm.debug=0 kvm_amd.nested=1 kvm.ignore_msrs=1 kvm.report_ignored_msrs=0 pci=assign-busses pcie_acs_override=downstream,multifunction vfio_iommu_type1.allow_unsafe_interrupts=1"`
- 其中必须添加的:
iommu=pt
设置iommu为直通模式pass throughinitcall_blacklist=sysfb_init
屏蔽掉pve7.2的一个bugpcie_acs_override=downstream,multifunction
iommu分组补丁- 其他参数之前直通存在问题,修改的一些配置,具体含义未详细了解,去掉是否有影响本人未做尝试。
- 执行
update-grub
更新grub
- 其中必须添加的:
- 添加驱动黑名单:修改或新增配置文件
/etc/modprobe.d/blacklist.conf
, 添加内容:1 2
blacklist amdgpu blacklist snd_hda_intel
- 添加加载模块:修改或新增配置文件
/etc/modules
, 添加内容:1 2 3 4
vfio vfio_iommu_type1 vfio_pci vfio_virqfd
- 获取核显id并绑定核显设备
1 2
root@nas:/# lspci -D -nnk | grep VGA 0000:07:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [1002:1638] (rev c9)
- 记下命令显示的最前面的数字序号为IOMMU分组
0000:07:00.0
;后面中括弧中1002:1638
为设备id - 修改或新增配置文件
/etc/modprobe.d/vfio.conf
, 添加内容:1 2
options vfio-pci ids=1002:1638 options vfio-pci disable_idle_d3=1
- 其中
1002:1638
为核显设备id,如果已经存在其他直通设备,请使用,
进行分隔填写多个,如:options vfio-pci ids=14c3:7961,1002:1638
执行命令:update-initramfs -u -k all
重启机器:reboot
- 记下命令显示的最前面的数字序号为IOMMU分组
PVE使用AMD CPU 5600G 核显直通_pve 5600g核显直通-CSDN博客
直通硬盘#
|
|
安装黑群晖#
GitHub - RROrg/rr: Redpill Recovery (arpl-i18n)一键安装脚本:
curl -fsSL https://github.com/RROrg/rr/raw/refs/heads/main/scripts/pve.sh | bash
- 洗白
群辉释放80/443端口 关闭默认80 443端口 sudo -i # 切换到root用户 cd /usr/syno/share/nginx cp server.mustache server.mustache.bak # 备份原文件 sed -i “s/80/8880/g” server.mustache DSM.mustache WWWService.mustache sed -i “s/443/8443/g” server.mustache DSM.mustache WWWService.mustache`
PVE#
一键脚本(自行验证)#
- Mapleawaa/PVE-Tools-9
bash <(curl -sSL https://ghfast.top/github.com/Mapleawaa/PVE-Tools-9/blob/main/PVE-Tools.sh)
- xiangfeidexiaohuo/pve-diy
- bash -c “$(curl -fsSL https://raw.githubusercontent.com/xiangfeidexiaohuo/pve-diy/master/pve.sh)"
pve_source(支持pve8,未更新,功能自测)
|
|
pvetools(支持pve8,未更新,功能自测)1 2 3 4
export LC_ALL=en_US.UTF-8 apt update && apt -y install git && git clone https://github.com/ivanhao/pvetools.git cd pvetools ./pvetools.sh
风扇监控:安装完驱动后,在/etc/default/grub增加 acpi_enforce_resources=lax,最后update-grub
CT debian 初始化模板#
|
|
|
|
|
|
Docker#
frp
- 加密传输:新版已全局默认,单个为
transport.useEncryption = true
- 压缩传输:如果有前置Nginx,则去Nginx设置压缩,
transport.useCompression = true
- 加密传输:新版已全局默认,单个为
Traefik
- 加密Dashboard
echo $(htpasswd -nb your_username your_password) | sed -e s/\\$/\\$\\$/g
- 修改
traefik
的docker-compose.yml
,为其labels添加中间件配置:
- 加密Dashboard
labels:
… 其他标签保持不变 …#
— Basic Auth 中间件定义 —#
- “traefik.http.middlewares.my-auth.basicauth.users=your_username:$$apr1$$…” # 粘贴上一步生成的字符串
— 将中间件应用到 Dashboard —#
- “traefik.http.routers.dashboard.middlewares=my-auth”
3. 信任来自 FRP 管道的请求
```yaml
# 定义入口点 (EntryPoints),即流量的入口
entryPoints:
web:
address: ":80"
# --- 添加下面这部分 ---
forwardedHeaders:
# 信任所有来源的 X-Forwarded-* 头信息
# 在我们的架构中,只有可信的FRP管道会连接到这个端口,所以这样设置是安全的
insecure: true
- 暴露docker远程API Docker 启用 远程 API | 知识库
LXC端口转发#
echo 'net.ipv4.ip_forward = 1' | tee -a /etc/sysctl.d/99-tailscale.conf
echo 'net.ipv6.conf.all.forwarding = 1' | tee -a /etc/sysctl.d/99-tailscale.conf
sysctl -p /etc/sysctl.d/99-tailscale.conf
tailscale up --advertise-routes=192.168.2.0/24
apt install mesa-va-drivers radeontop vainfo
- LXC挂载NFS
|
|
- LXC挂载webdav
|
|
post.smzdm.com/p/al82p3eg/ 3. LXC frpc /usr/local/bin/ /etc/frp
LXC#
alpine安装fprc#
Alpine Linux如何安装FRP最新版 | 24K PLUS tee /etc/init.d/frpc «EOF #!/sbin/openrc-run name=“frp client” command="/usr/local/bin/frpc” command_args="-c /opt/frpc/frpc.toml" command_user=“nobody”
depend() { need net } EOF
sudo chmod +x /etc/init.d/frpc sudo rc-update add frpc default
sudo service frpc start sudo service frpc status
sudo service frpc stop sudo cp frps /usr/local/bin/frpc sudo service frpc start