本文最后更新于2021年11月9日,已超过900天没有更新,若内容或图片失效,请留言反馈。

虚拟服务器软件PVE踩坑记,包含PVE使用过程中遇到的一些问题和解决办法。

简介

PVE 是什么?且看官方的介绍

Proxmox Virtual Environment is an open source server virtualization management solution based on QEMU/KVM and LXC. You can manage virtual machines, containers, highly available clusters, storage and networks with an integrated, easy-to-use web interface or via CLI. Proxmox VE code is licensed under the GNU Affero General Public License, version 3.
看不懂?来段维基百科的介绍

Proxmox VE(英语:Proxmox Virtual Environment,通常简称为PVE),是一个开源的服务器虚拟化环境Linux发行版。Proxmox VE基于Debian,使用基于Ubuntu的定制内核,包含安装程序、网页控制台和命令行工具,并且向第三方工具提供了REST API,在Affero通用公共许可证第三版下发行。
这里面有两点非常重要。

  1. PVE基于Debian,所以你最好懂点Debian或Ubuntu的操作。
  2. PVE开放源代码,在Affero通用公共许可证第三版下发行,可以放心使用。

安装之后要做的事

网络上关于PVE的安装教程已经够多,这里就不重复造轮子了。

需要注意的是,安装完毕之后,记得重启一下,然后通过Web管理地址https://PVEIP:8006/登录。

这里需要注意以下几点:

  1. 管理地址使用的是https协议和8006端口。
  2. 管理账号为root,密码为安装时设定的密码。
  3. 也可以使用SSH登录,密码同上。

不要着急更新系统,先将软件更新源修改成国内的,这里推荐使用中科大的源。

中科大为Proxmox提供的更新地址为https://mirrors.ustc.edu.cn/proxmox/

如果你使用的是电信宽带,可以使用这个地址https://chinanet.mirrors.ustc.edu.cn/proxmox/

我们接着操作。

删除企业源

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

下载秘钥

wget https://mirrors.ustc.edu.cn/proxmox/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg

修改/ect/apt/目录下的source.list文件

替换为以下内容

deb http://mirrors.ustc.edu.cn/debian/ buster main non-free contrib
deb http://mirrors.ustc.edu.cn/debian/ buster-updates main non-free contrib
deb http://mirrors.ustc.edu.cn/debian/ buster-backports main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ buster main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ buster-updates main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian/ buster-backports main non-free contrib
deb http://mirrors.ustc.edu.cn/debian-security/ buster/updates main non-free contrib
deb-src http://mirrors.ustc.edu.cn/debian-security/ buster/updates main non-free contrib
deb https://chinanet.mirrors.ustc.edu.cn/proxmox/debian/pve buster pve-no-subscription

更新系统及所有包

执行

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

让Debian允许使用root账号登录

编辑/etc/ssh/sshd_config,找到PermitRootLogin,将整行修改为PermitRootLogin yes,如果没有,自行添加一行。

去除订阅提示

执行

sed -i "s/data.status !== 'Active'/false/g" /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js

清除浏览器缓存。

快速下载容器模板

在Web管理界面,通过点击local(pve)内容模板,可以看到PVE提供的容器模板。选中之后,点击「下载」即可将它下载到本地,但是速度却不容乐观。我们可以使用以下变通的方法,以在PVE中安装一个Debian 10为例。

在Shell中做以下操作。

  1. 进入容器模板目录,cd /var/lib/vz/template/cache/
  2. 下载容器模板,wget https://chinanet.mirrors.ustc.edu.cn/proxmox/images/system/debian-10.0-standard_10.0-1_amd64.tar.gz

完成之后,在浏览器中刷新一下刚刚打开的管理界面,已经可以看到刚才下载的Debian 10容器模板。

使用容器模板安装系统,不在本文讨论范围,请自行搜索相关文章。

标签: PVE, 服务器虚拟化, Debian

评论已关闭