PVE: 全称Proxmox Virtual Environment,开源的虚拟化管理平台。它基于Debian Linux操作系统,并集成了KVM和LXC两种虚拟化技术,可以帮助用户快速搭建和管理虚拟化环境。
一般linux发行版都内置了nano,vi编辑器,对新手而言nano更友好,vi的使用习惯不太一样。
如系统没内置自行安装一下。
CentOS 系统:
1 | yum install -y nano |
---|
Debian/Ubuntu 系统:
1 | apt-get install -y nano |
---|
nano编辑器语法简单介绍:
1 | nano <文件名或文件绝对路径> |
---|
打开文件,文件不存在则新建
1 2 3 | 示例: nano xx.conf nano /xxx/xxx/xx.conf |
---|
打开后即可直接编辑,上下左右方向键可直接移动光标,选中可以进行复制,编辑,粘贴等,注意pve浏览器管理台中shell只能通过鼠标右键复制粘贴,不支持ctrl+c/v。
底部有快捷键说明,^G 即为 Ctrl+G ,功能为显示帮助文本。
编辑修改后,保存ctrl+o
,退出ctrl+X
,如没有保存直接退出ctrl+x
时会弹出提示是否保存,按y或n进行保存退出或不保存退出。
浏览器进入pve管理后台,shell,命令行界面,
编辑文件:nano /etc/systemd/logind.conf
1 2 3 4 5 6 7 8 | **参数说明** #HandlePowerKey 按下电源键后的行为,默认power off #HandleSleepKey 按下挂起键后的行为,默认suspend #HandleHibernateKey按下休眠键后的行为,默认hibernate #HandleLidSwitch合上笔记本盖后的行为,默认suspend(改为ignore;即合盖不休眠)在原文件中,还要去掉前面的# |
---|
下面是修改后的pve源文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | # This file is part of systemd. # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # Entries in this file show the compile time defaults. # You can change settings by editing this file. # Defaults can be restored by simply deleting this file. # # See logind.conf(5) for details. [Login] #NAutoVTs=6 #ReserveVT=6 #KillUserProcesses=no #KillOnlyUsers= #KillExcludeUsers=root #InhibitDelayMaxSec=5 #UserStopDelaySec=10 #HandlePowerKey=poweroff #HandleSuspendKey=suspend #HandleHibernateKey=hibernate HandleLidSwitch=ignore #改这行 #HandleLidSwitch=suspend #HandleLidSwitchExternalPower=suspend #HandleLidSwitchDocked=ignore #HandleRebootKey=reboot #PowerKeyIgnoreInhibited=no #SuspendKeyIgnoreInhibited=no #HibernateKeyIgnoreInhibited=no #LidSwitchIgnoreInhibited=yes #RebootKeyIgnoreInhibited=no #HoldoffTimeoutSec=30s #IdleAction=ignore #IdleActionSec=30min #RuntimeDirectorySize=10% #RuntimeDirectoryInodes=400k #RemoveIPC=yes #InhibitorsMax=8192 #SessionsMax=8192 |
---|
pve每次重启后停留在 进入pve/高级选项/进入boot页等选项页,而不是直接进入系统的解决方法。
编辑GRUB配置文件并更新GRUB引导程序:
1 | nano /etc/default/grub |
---|
GRUB_TIMEOUT
选项,并将其值设置为0,以使系统在启动时自动选择默认内核并立即启动。例如:1 | GRUB_TIMEOUT=0 |
---|
1 | update-grub |
---|
1 | reboot |
---|
nano /etc/apt/sources.list
添加以下,同时注释原有的,在其前面加#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free #deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free #deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free #deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free #deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free |
---|
nano /etc/apt/sources.list.d/pve-enterprise.list
添加以下,同时注释原有的,在其前面加#
1 | deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bullseye pve-no-subscription |
---|
apt install apt-transport-https ca-certificates
将 /usr/share/perl5/PVE/APLInfo.pm 文件中默认的源地址 http://download.proxmox.com 替换为 https://mirrors.tuna.tsinghua.edu.cn/proxmox 即可。
可以使用如下命令修改:
1 2 3 | cp /usr/share/perl5/PVE/APLInfo.pm /usr/share/perl5/PVE/APLInfo.pm_back sed -i 's|http://download.proxmox.com|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm |
---|
针对 /usr/share/perl5/PVE/APLInfo.pm
文件的修改,重启后生效。
1 | systemctl restart pvedaemon.service |
---|
修改文件在这个路径:/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
可以通过ssh
用nano命令直接修改
1 | nano /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js |
---|
按ctrl+w或F6搜索“data.status”,将整个if条件改为false,注意需要保证这两快捷键不被其他软件占用,edge浏览器占用了ctrl+w(关闭当前串口)。
1 | if(false) |
---|
https://www.wanuse.com/2022/01/proxmox-ve.html https://blog.csdn.net/kuaile_0509/article/details/130273930 nano 使用教程