PVE安装步骤
- 官网下载PVE
- 使用Etcher烧写镜像到U盘
- HDMI线连接到显示器,键盘鼠标连到mini PC,插入U盘,启动主机
- 按F7进入Bios,选择U盘安装
- 选择Graphical安装,配置IP地址,用户名密码,按照提示一步一步来
- 安装完成后将mini PC插入路由器,然后进入
<pve_ip_address>:8006进入PVE Web Manager,用户名为root,密码为刚才设置的密码
OpenWrt安装步骤
编译OpenWrt系统
-
编译就不多说了,使用GitHub进行云编译,这里记录一下
.configTargetSystem: - x86 Subtarget: - x86_64 TargetProfile: - Generic x86/64 TargetImages: - squashfs - Build GRUB images - Use Console Terminal (in addition to Serial) - GZip images LuCI: Themes: - luci-theme-agron Applications: - luci-app-accesscontrol - luci-app-adguardhome - luci-app-arpbind - luci-app-banip - luci-app-ddns - luci-app-filetransfer - luci-app-firewall - luci-app-frpc - luci-app-ksmbd - luci-app-nlbwmon - luci-app-opkg - luci-app-passwall - luci-app-samba - luci-app-sqm - luci-app-statistics - luci-app-upnp - luci-app-vnstat - luci-app-vsftpd - luci-app-wol - luci-app-zerotier Protocols: - luci-protocol-wireguard Network: IP Addresses and Names: - ddns-scripts-cloudflare - drill - tcpdump Utilities: - qrencode
创建虚拟机
-
编辑VM ID, Name,我填了
100和OpenWrt -
系统选择Do not use any media
-
Disks删除,暂时使用No Disks
-
核心数选择2 Cores
-
内存设置为1024M
-
创建完成后点击运行VM,我们就可以进入OpenWrt的命令行界面了,按照使用树莓派4B+安装OpenWrt用作旁路由 | Kunyang’s Blog修改IP地址
上传镜像
-
直接使用
scp将编译好的openwrt-x86-64-generic-squashfs-combined.img.gz上传,要上传到/var/lib/vz/template/iso/这个目录scp .\openwrt-x86-64-generic-squashfs-combined.img.gz [email protected]:/var/lib/vz/template/iso注意要使用
-combined.img.gz这个文件 -
解压文件
gzip -d openwrt-x86-64-generic-squashfs-combined.img.gz -
挂载为虚拟机的磁盘
qm importdisk <vm_id> openwrt-x86-64-generic-squashfs-combined.img local-lvm出现
successfully imported disk 'local-lvm:vm-100-disk-0'就是成功了 -
在Options → Boot Order将这块磁盘选中,并设置为第一启动顺序
-
完事儿之后可以把
.img文件删除
Debian安装步骤
- 可以直接在官网下载Debian镜像,进入PVE管理后台,在pve → local (pve) → ISO Images上传镜像(对应位置在
/var/lib/vz/template/iso/),安装完后不要删除这个镜像 - Disk Size我选了256GB,核心数选择了4核心,因为我的N100本身就是4核心,内存设置为了12GB
- 安装完之后的
.iso文件不能删除
PVE优化
使用了人人都在用的老虎大佬的脚本
wget -q -O /root/pve_source.tar.gz 'https://bbs.x86pi.cn/file/topic/2024-01-06/file/24f723efc6ab4913b1f99c97a1d1a472b2.gz' && tar zxvf /root/pve_source.tar.gz && /root/./pve_source
PVE关机
最后强调一下如果服务器想要关机的话一定要每个子系统都单独关机一次,直接把电源有可能会造成不可挽回的后果,毕竟PVE是虚拟的。如果害怕家里突然停电可以买个UPS电源
这篇文章参考了视频: