跳到主要内容

pve

GPU 直通

  1. 打开主板 VT-D
  2. 设置 PVE 引导 IOMMU 开关,支持虚拟化
# 1. 
vi /etc/default/grub

# 开启底层的硬件直通功能
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt video=efifb:off,vesafb:off"


update-grub


vi /etc/modules

# 打开 pci 通道
vfio
vfio_iommu_type1
vfio_pci
vfio_virqfd
  1. 屏蔽 PVE 调用显卡
vi /etc/modprobe.d/blacklist.conf

# 添加以下内容
blacklist nouveau
options nouveau modeset=0
  1. 配置显卡 ID
vi /etc/modprobe.d/vfio.conf

# 添加以下内容
options vfio-pci ids=xxxx:xxxx,xxxx:xxxx


update-initramfs -u


reboot
  1. 虚拟机装显卡驱动

PVE 开启支持 ipv6

需要将accept_ra值改成2才能自动配置SLAAC ipv6地址:

vi /etc/sysctl.conf
# 最后边添加上如下代码

net.ipv6.conf.all.accept_ra=2
net.ipv6.conf.default.accept_ra=2
net.ipv6.conf.vmbr0.accept_ra=2
net.ipv6.conf.all.autoconf=1
net.ipv6.conf.default.autoconf=1
net.ipv6.conf.vmbr0.autoconf=1

安装 ddns-go 和 Nginx 子域名转发

安装 ddns-go

解压到/opt


mkdir -p /opt/ddns-go

cd /opt

wget https://github.com/jeessy2/ddns-go/releases/download/v6.6.5/ddns-go_6.6.5_linux_x86_64.tar.gz

tar -zxvf ddns-go_3.7.1_Linux_x86_64.tar.gz -C /opt/ddns-go

# 设置为系统服务
cd /opt/ddns-go

./ddns-go -s install
# 卸载服务请执行 ./ddns-go -s uninstall

访问http://[服务器ip]:9876, 配置多个域名

6899.fun
pve.6899.fun
nas.6899.fun
ddns.6899.fun

PVE 配置 Nginx

安装Nginx

apt install nginx

配置多个服务,通过子域名转发到不同服务,可以是不同ip

vi /etc/nginx/conf.d/ddns.6899.fun.conf
server {
listen 80;
server_name ddns.6899.fun;
location / {
proxy_pass http://127.0.0.1:9876;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
vi /etc/nginx/conf.d/pve.6899.fun.conf
server {
listen 80;
server_name pve.6899.fun;
location / {
proxy_pass http://127.0.0.1:8006;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

nginx 引入

vi /etc/nginx/nginx.conf
include /etc/nginx/conf.d/*.conf;

重启 nginx

systemctl restart nginx

用路径转发会遇到一些前缀问题,如果是nas会出现迅雷里找不到资源,因为有些网站用了绝对路径,没有添加到前缀

目前笔记本的 NAS 稳定,所以在上面搭建了 DDNS-GO 、Nginx、翻墙

通过 lxc 安装 Tailscale 实现组网

安装 Nas

安装 OpenWRT

安装 win10 企业版,GPU 直通

PVE系统无法进入,重装恢复

在另一个磁盘重装PVE,安装过程会提示将旧的设置为 另一组

挂载旧磁盘,找回数据

root@pve:/# cd /dev/pve-OLD-6D0594DA/
root@pve:/dev/pve-OLD-6D0594DA# ls
root vm-100-disk-0 vm-104-disk-0 vm-105-disk-0 vm-106-disk-1
swap vm-102-disk-0 vm-104-disk-1 vm-106-disk-0 vm-106-disk-2

root@pve:/dev/pve-OLD-6D0594DA# lvscan
ACTIVE '/dev/pve/data' [185.04 GiB] inherit
ACTIVE '/dev/pve/swap' [8.00 GiB] inherit
ACTIVE '/dev/pve/root' [<84.27 GiB] inherit
ACTIVE '/dev/pve/vm-106-disk-0' [4.00 MiB] inherit
ACTIVE '/dev/pve/vm-102-disk-0' [10.00 GiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/data' [794.30 GiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/swap' [8.00 GiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/root' [96.00 GiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/vm-102-disk-0' [10.00 GiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/vm-104-disk-1' [200.00 GiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/vm-104-disk-0' [1.00 GiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/vm-105-disk-0' [124.00 MiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/vm-106-disk-0' [4.00 MiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/vm-106-disk-1' [300.00 GiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/vm-106-disk-2' [4.00 MiB] inherit
ACTIVE '/dev/pve-OLD-6D0594DA/vm-100-disk-0' [100.00 GiB] inherit
root@pve:/dev/pve-OLD-6D0594DA# mount /dev/pve-OLD-6D0594DA/root /mnt/pve-OLD-6D0594DA/root
root@pve:/dev/pve-OLD-6D0594DA# cd /mnt/pve-OLD-6D0594DA/root # 旧 pve root 文件所在,不知为何虚拟机配置文件不见了
root@pve:/dev/pve-OLD-6D0594DA# cd /mnt/pve-OLD-6D0594DA/root/var/lib/vz/template/iso/# 旧 pve 镜像文件所在

配置文件丢失,导入镜像尝试(未成功)

先导出为vmdk,再创建一个虚拟机,再导入到该虚拟机中

qemu-img convert -c -O vmdk .....

qm importdisk 10x ./vm-10x-0.vmdk local-lvm

log

运行以下命令后不停的在up and down

root@pve:~# ethtool -s enp4s0 speed 1000 root@pve:~# root@pve:~# ethtool -s enp4s0 speed 1000 duplex full autoneg offetheth ethtool (-s): invalid value 'offetheth' for parameter 'autoneg' root@pve:~# root@pve:~# root@pve:~# ethtool enp4s0 Settings for enp4s0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full 2500baseT/Full Supported pause frame use: Symmetric Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 1000baseT/Full Advertised pause frame use: Symmetric Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 1000Mb/s Duplex: Full Auto-negotiation: on Port: Twisted Pair PHYAD: 0 Transceiver: internal MDI-X: off (auto) Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000007 (7) drv probe link Link detected: yes root@pve:~#

Jul 26 00:17:01 pve CRON[5297]: pam_unix(cron:session): session closed for user root Jul 26 00:19:38 pve kernel: igc 0000:04:00.0 enp4s0: NIC Link is Down Jul 26 00:19:38 pve kernel: vmbr0: port 1(enp4s0) entered disabled state Jul 26 00:19:39 pve systemd-logind[849]: Power key pressed short.

root@pve:/opt/IntelEthernetAdapterCompleteDriverPack/APPS/BootUtil/Linux_x64/DRIVER# ./install Extracting archive...OK! Compiling the driver...OK! Skipping directory creation for driver installation as it already exists. Skipping removing QV driver - it does not exist... Copying iqvlinux.ko driver file to /lib/modules directory...OK! Driver installation verification...Installed! root@pve:/opt/IntelEthernetAdapterCompleteDriverPack/APPS/BootUtil/Linux_x64/DRIVER#

root@pve:/opt/IntelEthernetAdapterCompleteDriverPack/APPS/BootUtil/Linux_x64/DRIVER# ethtool -i enp4s0 driver: igc version: 6.8.8-2-pve firmware-version: 1073:8754 expansion-rom-version: bus-info: 0000:04:00.0 supports-statistics: yes supports-test: yes supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: yes root@pve:/opt/IntelEthernetAdapterCompleteDriverPack/APPS/BootUtil/Linux_x64/DRIVER# ethtool enp4s0 Settings for enp4s0: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full 2500baseT/Full Supported pause frame use: Symmetric Supports auto-negotiation: Yes Supported FEC modes: Not reported Advertised link modes: 10baseT/Full 100baseT/Full 1000baseT/Full 2500baseT/Full Advertised pause frame use: Symmetric Advertised auto-negotiation: Yes Advertised FEC modes: Not reported Speed: 100Mb/s Duplex: Full Auto-negotiation: on Port: Twisted Pair PHYAD: 0 Transceiver: internal MDI-X: off (auto) Supports Wake-on: pumbg Wake-on: g Current message level: 0x00000007 (7) drv probe link Link detected: yes root@pve:/opt/IntelEthernetAdapterCompleteDriverPack/APPS/BootUtil/Linux_x64/DRIVER#

Jul 27 13:23:46 pve kernel: Intel Pro Diagnostic Driver loading (v. 1.3.0.2) Jul 27 13:23:46 pve kernel: Intel Pro Diagnostic Driver exiting Jul 27 13:24:59 pve pveproxy[11698]: worker exit Jul 27 13:24:59 pve pveproxy[1234]: worker 11698 finished Jul 27 13:24:59 pve pveproxy[1234]: starting 1 worker(s)

nas log:

指定版本都下载不了,需要指向 latest

root@Awsoming_NAS:/opt/apisix-docker/example# docker-compose -p apisix-docker up -d Pulling apisix (apache/apisix:3.9.0-debian)... 3.9.0-debian: Pulling from apache/apisix c0edef2937fa: Pulling fs layer bc34b4813ff8: Pulling fs layer b6736b5d6cb4: Pulling fs layer 7e95b497f5c4: Waiting 2e2cf4f67661: Waiting 4f4fb700ef54: Waiting c5d03c80a3f0: Waiting 9c09588b2090: Waiting 2369095f3e32: Waiting ERROR: error pulling image configuration: Get "https://production.cloudflare.docker.com/registry-v2/docker/registry/v2/blobs/sha256/5e/5e90db4294cdced6ada97b5961326d8956ffb5fd3f80756d425ba90cf0b32b54/data?verify=1722421655-xbMQrfyYvIjsnVsb8P2C1hKGB9g%3D": dial tcp [2a03:2880:f10e:83:face:b00c:0:25de]:443: i/o timeout root@Awsoming_NAS:/opt/apisix-docker/example#