说明:上篇文章《U 盘(优盘)安装 Proxmox VE 图文教程》,主要对如何通过U盘来安装PVE做了一个简单的了解,在我们安装完成后登陆的时候如果不是订阅用户默认会提示一个讨人烦的信息:没有有效的订阅You do not have a valid subscription for this server. Please visit www.proxmox.com to get a list of available options.
用的是免费版的,所以每次都弹窗是真的挺烦的
解决方法:
手动修改文件/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
修改之前记得先备份一下root@kvm2:/usr/share/javascript/proxmox-widget-toolkit# cp proxmoxlib.js proxmoxlib.js.bak
root@kvm2:/usr/share/javascript/proxmox-widget-toolkit# ls
proxmoxlib.js proxmoxlib.js.bak
root@kvm2:/usr/share/javascript/proxmox-widget-toolkit# vim proxmoxlib.js
然后找到if (data.status !== 'Active') {
修改为if (false) {
然后保存,重启网页服务systemctl restart pveproxy
如果没有反应,SSH进去ystemctl status pveproxy 查看服务是不是没有成功启动,
root@PVE:~# systemctl status pveproxy
● pveproxy.service - PVE API Proxy Server
Loaded: loaded (/lib/systemd/system/pveproxy.service; enabled; vendor pres>
Active: deactivating (stop-sigterm) since Mon 2022-11-07 14:20:37 CST; 1mi>
Process: 1010 ExecStartPre=/usr/bin/pvecm updatecerts --silent (code=exited>
Process: 1028 ExecStart=/usr/bin/pveproxy start (code=exited, status=0/SUCC>
Process: 29618 ExecStop=/usr/bin/pveproxy stop (code=exited, status=0/SUCCE>
Main PID: 1029 (code=exited, status=0/SUCCESS)
Tasks: 1 (limit: 19082)
Memory: 136.6M
CPU: 1min 2.127s
CGroup: /system.slice/pveproxy.service
└─29636 pveproxy worker (shutdown)
Nov 07 14:20:37 PVE systemd[1]: Stopping PVE API Proxy Server...
Nov 07 14:20:38 PVE pveproxy[1029]: received signal TERM
Nov 07 14:20:38 PVE pveproxy[1029]: server closing
Nov 07 14:20:38 PVE pveproxy[26256]: worker exit
Nov 07 14:20:38 PVE pveproxy[27715]: worker exit
Nov 07 14:20:38 PVE pveproxy[26850]: worker exit
Nov 07 14:20:38 PVE pveproxy[1029]: worker 26256 finished
Nov 07 14:20:38 PVE pveproxy[1029]: worker 27715 finished
Nov 07 14:20:38 PVE pveproxy[1029]: worker 26850 finished
Nov 07 14:20:38 PVE pveproxy[1029]: server stopped
没有再手动启动 ystemctl start pveproxy
root@GZBW-PVE:~# systemctl start pveproxy
再查看是否启动正常:
root@PVE:~# systemctl status pveproxy
● pveproxy.service - PVE API Proxy Server
Loaded: loaded (/lib/systemd/system/pveproxy.service; enabled; vendor pres>
Active: active (running) since Mon 2022-11-07 14:22:11 CST; 3s ago
Process: 29854 ExecStartPre=/usr/bin/pvecm updatecerts --silent (code=exite>
Process: 29856 ExecStart=/usr/bin/pveproxy start (code=exited, status=0/SUC>
Main PID: 29857 (pveproxy)
Tasks: 4 (limit: 19082)
Memory: 133.6M
CPU: 1.309s
CGroup: /system.slice/pveproxy.service
├─29857 pveproxy
├─29858 pveproxy worker
├─29859 pveproxy worker
└─29860 pveproxy worker
Nov 07 14:22:09 PVE systemd[1]: Starting PVE API Proxy Server...
Nov 07 14:22:11 PVE pveproxy[29857]: starting server
Nov 07 14:22:11 PVE pveproxy[29857]: starting 3 worker(s)
Nov 07 14:22:11 PVE pveproxy[29857]: worker 29858 started
Nov 07 14:22:11 PVE pveproxy[29857]: worker 29859 started
Nov 07 14:22:11 PVE pveproxy[29857]: worker 29860 started
Nov 07 14:22:11 PVE systemd[1]: Started PVE API Proxy Server.
然后CTRL+F5强制刷新网页,或清理一下浏览器的缓存就好了!
其实上面的步骤也可以理解为:将/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js文件中的data.status !== 'Active'替换为false。既然是这样,那么我们可直接使用SED命令来搞定:sed -i.bak "s/data.status !== 'Active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js && systemctl restart pveproxy
执行完成后,清理一下浏览器的缓存就可以了。
本文链接:https://www.kinber.cn/post/2848.html 转载需授权!
推荐本站淘宝优惠价购买喜欢的宝贝: