Togoc 发表于 2023-2-9 12:09

PVE自用 All In One 有关配置

本帖最后由 Togoc 于 2023-2-14 13:50 编辑



自用 All In One +有关配置说明:      1. 仅针对自己设备的一些配置      ---
static/image/hrline/2.gifstatic/image/hrline/2.gif
(一).PVE 虚拟机安装及配置

可以用一些工具pve-tools等进行修改,需要先下载上传,简单实用熟练了也挺方便的:( 不敢太依赖这些插件,有些时候卡住了也不懂什么情况:心理洁癖 ):
pvetools:https://github.com/ivanhao/pvetools
pve多余内核清理:https://github.com/afrojewelz/pvekclean

1、打开PVE节点的shell,输入命令:
nano /etc/default/grub
找到:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"改为:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"若需要核显虚拟化则改为:GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt i915.enable_gvt=1"有关核显虚拟化具体参考: PVE7教程【篇一】硬件虚拟化 显卡直通与GVT-g
2、在PVE的shell中输入:
nano /etc/modules在文件下面添加新内容vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
kvmgt # 核显虚拟化不需要注释掉有关核显虚拟化具体参考: PVE7教程【篇一】硬件虚拟化 显卡直通与GVT-g

3、最后更新配置信息并重启PVE主机
update-grub
update-initramfs -u -k all
reboot
额外一些配置代码
修改源相关deb http://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian/ buster main contrib non-free
deb http://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian/ buster-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian-security/ buster/updates main contrib non-free
添加启动盘
qm importdisk 100 /var/lib/vz/template/iso/ds918.img local-lvm
添加硬盘直通
1. 查找本机硬盘
ls/dev/disk/by-id/
2. 直通硬盘
qm set 100 -sata2/dev/disk/by-id/ata-WDC_WD42EJRX-89BFNY0_WD-WX42DB165FAY3. usb设备
qm set 101 -usb0 host=1d6b:00024. smb:方便上传虚拟机备份
apt install -y sambanano /etc/samba/smb.conf添加以下代码:目录按自己需求

   comment = dump file
   path =/var/lib/vz/dump
   guest ok = no
   browseable = yes
   write list = root

   comment = dump file
   path = /var/lib/vz/template/iso
   guest ok = no
   browseable = yes
   write list = root添加smb用户,按要求输入两次密码,按需配置
smbpasswd -a root

service smbd restart 没有问题就可以使用了



static/image/hrline/2.gifstatic/image/hrline/2.gifstatic/image/hrline/2.gifstatic/image/hrline/2.gif

(二).安装 黑群晖 及配置

**本人精通有关虚拟机安装,篇幅问题,网上也有很多就不记录了,仅记录部分优化内容**如果是esxi安装会有一些奇怪问题,比如 video station 无法解码,其他没有深究

    1. 引导下载:https://wp.gxnas.com 该链接有很多武功秘籍且不需要自宫即可入门
2. 添加启动盘   *自行修改相关参数, 网卡不要选virtio,上传不稳定(自己测试)
qm importdisk 100 /var/lib/vz/template/iso/ds918.img local-lvm
3. 套件及相关配置
--- 套件来源:
6.x
https://spk.imnks.com/7.x
https://spk7.imnks.com/
--- Docker:

修改源:Aliyun 镜像*自己申请呀,不要抄了
**** Hidden Message *****

jellyfin测试硬解用
docker run -d--net=host--device /dev/dri/renderD128:/dev/dri/renderD128 --device /dev/dri/card0:/dev/dri/card0 --name="jellyfin-nastool" nyanmisaka/jellyfin:latest
TMB刮削api,自己申请啊**** Hidden Message *****
Aria2安装
docker run -d \
    --name aria2-pro \
    --restart unless-stopped \
    --log-opt max-size=1m \
    -e PUID=$UID \
    -e PGID=$GID \
    -e UMASK_SET=022 \
    -e RPC_SECRET=123456 \
    -e RPC_PORT=6800 \
    -p 6800:6800 \
    -e LISTEN_PORT=6888 \
    -p 6888:6888 \
    -p 6888:6888/udp \
    -v /volume1/sandisk/aria2-config:/config \
    -v /volume2/4tdisk/aria2:/downloads \
    p3terx/aria2-pro

docker run -d \
    --name ariang \
    --log-opt max-size=1m \
    --restart unless-stopped \
    -p 6880:6880 \
    p3terx/ariang
frpc
docker run --restart=always --network host -d -v /etc/frp/frpc.ini:/etc/frp/frpc.ini --name frpc snowdreamtech/frpc加载本地镜像&镜像上传到docker hub
docker import openwrt.tar.gztogoc/openwrt混杂模式+运行
ip link set eth0 promisc on
docker network create -d macvlan --subnet=192.168.1.0/24 --gateway=192.168.1.1 -o parent=eth0 macnet
docker run--name openwrt -d --network macnet --privilegedtogoc/openwrt /sbin/init
4. 群晖 6.2.3 隐藏引导盘硬盘休眠* 其他版本没有测试过

参考链接:https://wp.gxnas.com/7527.html#toc_14


[*]关闭虚拟机
[*]启动引导选择 esxi/vmware 模式 * 重点
[*]开启ssh连接
[*]ssh 修改grub
修改grub代码cd /dev/
mkdir -p /tmp/abc
mount -t vfat synoboot1 /tmp/abc
cd /tmp/abc/grub

进入 grub 目录后,打开 grub 文件即可进行修改,修改前先查看sata控制器的情况
synoboot1 这个目录找不到 grub 文件,检查第二步引导


[*]运行 lspci -n | grep "0106"
检查sata控制器个数

[*]打开 grub 文件,找到 set sata_args='SataPortMap=414DiskIdxMap=071000 SasIdxMap=0' 这行进行修改*引导不同可能内容不同,可以添加
[*]修改完重启

这几个参数的意义和修改自己看链接,主要说一下个人的见解(感觉不完全对,看了网上很多说法,但是每个人的机器不一样有点萌萌的):

1. 判断引导盘所在的是哪个控制器
2. 通过修改 DiskIdxMap 把引导盘的控制器挤出去,例如:我知道引导盘在第二个控制器,对应”071000“的10,把它转成16进制就是16,对应第17个硬盘位置,DS918最多16个盘就不显示啦
3. SataPortMap=414 注意每一位要大于你实际控制器sata盘的数量,比如你直通sata控制器在第一位有4个孔位,如果你写2会导致sata控制器直通的盘显示不完整

参考链接:https://wp.gxnas.com/7527.html#toc_14
完全硬盘休眠,解决休眠后 唤醒问题
vi/etc.defaults/syslog-ng/patterndb.d/scemd.conf

destination d_scemd { file("/var/log/scemd.log"); };
改成:
destination d_scemd { file("/tmp/scemd.log"); };
5. 核显问题及补丁:https://wp.gxnas.com/7952.html

6. video station 转码 6.2.3参考:https://wp.gxnas.com/7561.html

7. 指定版本套件下载:https://archive.synology.cn/download

***其他备用代码***硬解检查代码
cat /sys/kernel/debug/dri/0/i915_frequency_info8. 群晖7.x 版本人脸识别可以搜索libsynophoto-plugin-model关键字查找相关教程

static/image/hrline/2.gifstatic/image/hrline/2.gifstatic/image/hrline/2.gifstatic/image/hrline/2.gif

(三).安装 openwrt-lxc 及配置
网上有很多教程重点说明的是lxc安装会导致zerotier网口出现问题,参考:https://www.bilibili.com/read/cv16236206/

1. 自行安装是在不行可以bai度搜索ProxmoxVE 7.0 LXC下搭建 关键字, 查看相关教程pct create 100 \
      local:vztmpl/openwrt.tar.gz \
      --rootfs local-lvm:2 \
      --ostype unmanaged \
      --hostname OpenWrt-esir \
      --arch amd64 \
      --cores 4 \
      --memory 1024 \
      --swap 0 \
      -net0 bridge=vmbr0,name=eth0

nano /etc/pve/lxc/103.conf

# 按需修改

arch: amd64
cores: 2
hostname: OpenWrt
memory: 256
net0: name=eth0,bridge=vmbr0,hwaddr=62:36:E6:02:43:0A,type=veth
onboot: 1
ostype: unmanaged
protection: 1
rootfs: local-lvm:vm-103-disk-0,size=1G
swap: 0
lxc.include: /usr/share/lxc/config/openwrt.common.conf
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.hook.autodev: sh -c "modprobe tun; cd ${LXC_ROOTFS_MOUNT}/dev; mkdir net; mknod net/tun c 10 200; chmod 0666 net/tun"
2.旁路由设置

[*]进入openwrt主页,欣赏系统状态
[*]转到 网络=>接口=>LAN=>修改=>基本设置修改完 保存&应用

协议:                        静态地址
IPv4:                        192.168.1.2                # 这个是设置你的openwrt的地址
IPv4子网掩码:                255.255.255.0                # 照抄无意义的修饰代码
IPv4网关:                192.168.1.1                # 主路由器的ip地址
使用自定义DNS服务器:      192.168.1.1                # 主路由器的ip地址
IPv6后缀:                禁用

DHCP 服务器
忽略此接口:                ☑️                         # 记得勾起来


[*]高级设置 修改完 保存&应用
使用内置的Ipv6管理    不要勾

[*]桥接接口 不要勾   绑定到eth0 *这里要注意你是不是单网口 如果你直通了多个网口 你自己看着办吧
[*]一般到这里你的openwrt 就能通网了
[*]自定义防火墙 网络=>防火墙=>自定义规则
iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE

iptables -I FORWARD -i ztzlgmj7sf -j ACCEPT
iptables -I FORWARD -o ztzlgmj7sf -j ACCEPT
iptables -t nat -I POSTROUTING -o ztzlgmj7sf -j MASQUERADE
前面是旁路由 后面是zerotier


static/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.pngstatic/image/hrline/line7.png

以下为配置备用代码内容

--- frp内网穿透


*备用
mkdir frps
cd frps
wget https://code.aliyun.com/MvsCode/frps-onekey/raw/master/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install
--- cpufrequtils
apt-get install cpufrequtils解决只有powersave和performance模式:
nano /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT
后面添加
intel_pstate=disable

update-grub



lcx19871206 发表于 2023-2-9 12:26

一键不爽么?

lcx19871206 发表于 2023-2-9 12:27



Togoc 发表于 2023-2-9 12:29

lcx19871206 发表于 2023-2-9 12:26
一键不爽么?

感谢评论,我不太会发帖,后面补充

members 发表于 2023-2-9 12:43

感谢楼主分享

iceboys 发表于 2023-2-9 12:53

学习下,看看怎么玩

louwu 发表于 2023-2-9 16:46

学习下,看看怎么玩

jjxiaotang 发表于 2023-2-10 09:17


感谢楼主分享

kftjsdy 发表于 2023-2-10 14:22

本帖隐藏的内容需要积分高于 999999999 才可浏览:funk:

Togoc 发表于 2023-2-10 18:36

kftjsdy 发表于 2023-2-10 14:22
本帖隐藏的内容需要积分高于 999999999 才可浏览
哈哈,方便我自己使用,这些自己去申请就好了,隐藏的都是一些key

bad_men 发表于 2023-2-10 19:20

一直就想要all in one的机器,可黑群总是出问题

Togoc 发表于 2023-2-10 21:55

bad_men 发表于 2023-2-10 19:20
一直就想要all in one的机器,可黑群总是出问题

6.2.3目前我用起来比较稳,photos 好像有点问题,我不用就没管他了

sdxlchz 发表于 2023-3-22 15:00

谢谢分享

ronggq 发表于 2023-5-11 20:51

这个记录帖子不错!谢谢
页: [1]
查看完整版本: PVE自用 All In One 有关配置