重编译pve8.2.4 反虚拟机检测

项目来源

https://github.com/zhaodice/proxmox-ve-anti-detection

环境这次使用的是Proxmox VE 8.2.4,6月份最新版本

原作者的也可以使用,因为修改的东西太多,会导致scsi等virtIO和VGPU设备存在无法工作bug

修改源更新系统

1.删除企业订阅

rm /etc/apt/sources.list.d/pve-enterprise.list
rm /etc/apt/sources.list.d/ceph.list

2.更改国内源

nano /etc/apt/sources.list
deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware 
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware 
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free non-free-firmware 
deb https://mirrors.ustc.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware 
#pve源 
deb https://mirrors.ustc.edu.cn/proxmox/debian bookworm pve-no-subscription 
#ceph源 
deb https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy bookworm main 
#开发源,必须 
deb https://mirrors.ustc.edu.cn/proxmox/debian/devel bookworm main
nano /etc/apt/sources.list.d/pve-no-subscription.list 
deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bookworm pve-no-subscription

3.升级更新系统

apt update -y && apt dist-upgrade -y

拉取项目

1.拉取项目

apt install git -y
git clone git://git.proxmox.com/git/pve-qemu.git 
cd pve-qemu 

2.查看自己pve-qemu-kvm版本

这个版本和PVE的版本是不同的,我们需要编译的是pve-qemu-kvm包,比如我现在的PVE8.2.4的KVM包是9.0.0-3版本.

 dpkg -l|grep kvm

7.查看更新日志

git log

8.拉取项目

找到和自己版本一致的更新,比如此次示例是9.0.0-3。复制下来commit值。

切换到此版本

git reset --hard bb80c7f323c56abeba28a8ade73dedb3440f9c3a

9.安装Debian 开发的脚本工具集合

apt install devscripts 

10.生成并安装构建依赖,并安装

mk-build-deps --install

11.初始化和更新子模块

这一步需要能稳定访问大互联网,否则很难下载完整,编译时会出错.

git submodule update --init --recursive

重编译项目

1.下载补丁

可以下载作者的补丁,要跟据自己的需求编辑一下,作者的补丁打的太猛,会导致一些功能缺失,以及版本不一致,也会导致各种问题,作者的补丁仅仅作为参考。一定要自己编辑。进入网址 https://github.com/zhaodice/qemu-anti-detection/ 下载和自己版本接近的补丁, 跟据自己需求编辑,并重命名为 001-anti-detection.patch, 上传到目标机 root/pve-qemu/qemu 目录

2.编辑rules文件

nano debian/rules

找到# guest-agent is only required for guest systems 这一行

在上面增加内容 :


patch -p1 < 001-anti-detection.patch

# guest-agent is only required for guest systems
...

删除 –disable-downloads \ 这一行

patch -p1 < 001-anti-detection.patch
# guest-agent is only required for guest systems
./configure \
        --disable-downloads \
	--with-git-submodules=ignore \
	--docdir=/usr/share/doc/pve-qemu-kvm\
	--localstatedir=/var \
	--prefix=/usr \
....

3.编译

make

安装

如果一切顺利,此时在目录下会生成pve-qemu-kvm_9.0.0-3_amd64.deb文件,上传到目标机器安装。

dpkg -i --force-all pve-qemu-kvm_9.0.0-3_amd64.deb
1

评论0

显示验证码