PVE8.2新装需要修改哪些设置

安装完PVE,使用前,还需要做些配置的修改才好用

1 设置vi编辑器

pve的vi编辑器默认配置超级难用,方向键变字母,退格键不能用,很耽误使用。需要做如下修改

vi /etc/vim/vimrc.tiny

set compatible更改为set nocompatible, 并新增set backspace=2,如下

set nocompatible
set backspace=2

这样设置完,vi就好使了

2 修改网络配置

如果安装过程中没有设置好IP地址和网关,是无法远程访问的,这个时候你需要手动变更网络设置。

  • 替换/etc/network/interfaces中的IP地址为你PVE连接的路由或交换机工作的一样网段的ip地址,如下

root@pve:~# sed -i  s/address.*$/address 192.168.1.13/24/  /etc/network/interfaces

  • 替换/etc/network/interfaces中的gateway地址为你PVE连接的路由或交换机工作的一样网段的网关地址,如下

root@pve:~# sed -i  s/gateway.*$/gateway 192.168.1.1/  /etc/network/interfaces

  • 修改/etc/hosts的ip地址为以上ip 地址,如192.168.1.13
  • 修改dns为公共的DNS, 如Google的8.8.8.8和8.8.4.4。 vi /etc/resolv.conf

search local.cn
nameserver 8.8.8.8
nameserver 8.8.4.4

  • reboot 或者重启网卡如下

systemctl restart networking

  • 用另外一个电脑通过浏览器远程访问pve, 地址: https://192.168.1.13:8006/

    PVE8.2新装需要修改哪些设置

3 消除每次登录的“No valid subscription” 弹窗

PVE是个很不错的开源虚拟化平台,每个人都可以免费地享用它,不过没有订阅企业版每次登录Web管理时都会出现一个“No Valid Subscription(无有效订阅)”的提示:“You do not have a valid subscription for this server. Please visit www.proxmox.com to get a list of available options.”。要点“确定”或关闭它才能继续访问。

PVE8.2新装需要修改哪些设置

要消除它也简单, 打开/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js,搜索“No valid subscription”,并修改它前面的if条件。如下

PVE8.2新装需要修改哪些设置

改成如下

PVE8.2新装需要修改哪些设置

修改完成后重启网页服务

systemctl restart pveproxy

若重新登录还有提示,请刷新网页再试试。

4 替换企业版软件源

执行更新软件包时报错

PVE8.2新装需要修改哪些设置

我们默认是用企业(商业)软件源,Proxmox VE 企业软件源需要有效的订阅才能访问。对于个人用户,我们需要添加免费软件源。

vi /etc/apt/sources.list.d/pve-enterprise.list

注释掉enterprise字样的企业软件源,添加免费软件源

#deb https://enterprise.proxmox.com/debian/pve bookworm pve-enterprise
deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription

vi /etc/apt/sources.list.d/ceph.list, 注释掉里面的内容

#deb https://enterprise.proxmox.com/debian/ceph-reef bookworm enterprise

更新完这两个文件,重试更新软件包就没有问题了

root@pve:/etc/apt/sources.list.d# apt update
Hit:1 http://ftp.debian.org/debian bookworm InRelease                                              
Get:2 http://security.debian.org bookworm-security InRelease [48.0 kB]                             
Get:3 http://ftp.debian.org/debian bookworm-updates InRelease [55.4 kB]    
Get:4 http://download.proxmox.com/debian/pve bookworm InRelease [2,768 B]                   
Get:5 http://download.proxmox.com/debian/pve bookworm/pve-no-subscription amd64 Packages [336 kB]        
Get:6 http://security.debian.org bookworm-security/main amd64 Packages [182 kB]
Get:7 http://security.debian.org bookworm-security/main Translation-en [110 kB]
Fetched 735 kB in 5s (163 kB/s)          
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
93 packages can be upgraded. Run  apt list --upgradable  to see them.

© 版权声明
THE END
如果内容对您有所帮助,就支持一下吧!
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容