Avatar

Organizations

8 results for Proxmoxve
  • PVE 节点的网络配置,在 WebUI 里只能设置为静态地址,想设置DHCP的话需要使用以下方法。

    方法一

    $ cp /etc/network/interfaces /etc/network/interfaces.new
    
    # /etc/network/interfaces.new
    ...
    # IPv4
    iface vmbr0 inet dhcp
            # address 192.168.1.66/24
            # gateway 192.168.1.1
            bridge-ports enp1s0
            bridge-stp off
            bridge-fd 0
    # IPv6
    iface vmbr0 inet6 dhcp
            request_prefix 1
    

    在 PVE 的 WebUI 里 “系统 > 网络” 处,刷新后点击“应用配置”即可生效,等待几分钟后即可获取到IPv6地址。

    方法二

    直接修改 /etc/network/interfaces 文件也可以,修改完获取新地址。

    $ systemctl restart networking
    

    查看新地址

    $ ip addr show vmbr0
    
    ipv6 DHCP proxmoxve Created Fri, 07 Feb 2025 09:44:39 +0800
  • Proxmox VE 官方提供的 Centos 7 模板是有问题的无法正常使用,现在给出解决方案。

    安装

    安装完成后,容器可以启动,但无法关闭、网络无法使用、控制台无法使用,这些都是我们要解决的问题。

    解决方法

    1. ssh登录进入PVE主机
    # 查看 CT 容器列表
    $ pct list
    # 进入 CT 容器
    $ pct enter <VMID>
    
    1. 打开网络
    # 启动网络,从DHCP拿IP地址
    $ ifup eth0
    
    1. 更新 yum 库
    $ curl -o /etc/yum.repos.d/jsynacek-systemd-backports-for-centos-7-epel-7.repo https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7/repo/epel-7/jsynacek-systemd-backports-for-centos-7-epel-7.repo
    $ yum update
    # 安装 sshd
    $ yum install -y openssh-server
    $ systemctl start sshd.service
    $ systemctl enable sshd.service
    
    1. 退出 CT 容器
    $ exit
    $ pct stop <VMID>
    
    1. 重新启动 CT 容器,一切正常—
    CT Container lxc centos 7 linux proxmoxve Created Wed, 31 Jan 2024 21:37:49 +0800
  • 查看系统内核

    $ uname -r
    

    kernel 4.9 及以上已支持 tcp_bbr,看内核版本是否大于等于4.9,否则要升级内核,或者安装bbr。

    bbr2 效果要好于 bbr,相当原理可查看参考文档

    配置拥塞算法

    # 查看可用的拥塞算法
    $ sysctl net.ipv4.tcp_available_congestion_control
    
    # 查看使用的拥塞算法
    $ sysctl net.ipv4.tcp_congestion_control
    
    # 设置拥塞算法
    $ sysctl -w net.core.default_qdisc=fq
    $ sysctl -w net.ipv4.tcp_congestion_control=bbr
    
    # 查看设置结果
    $ lsmod | grep bbr
    

    配置持久化

    $ echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
    $ echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
    $ sysctl -p
    

    参考文档

    tcp bbr proxmoxve Created Tue, 03 Oct 2023 13:04:09 +0800
  • 修改JS文件

    $ nano /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js
    

    6.0+ (380行)

    if (data.status !== 'Active') {
    

    替换为

    if (false) {
    

    重启服务

    $ systemctl restart pveproxy.service
    

    参考文档

    subscription proxmoxve Created Tue, 06 Jun 2023 20:20:04 +0800
  • 遇事不决,多读文档!

    虚拟机

    创建

    使用命令行创建 VM 非常方便,而且还可以使用各发行版的云镜像,快速创建速度又快,占用空间又小,非常方便。

    # 增加硬盘空间
    # 建议从模板创建虚拟机后,再增加虚拟机硬盘的空间,这样可以保持模板的大小
    qm disk resize <VM_ID> scsi0 +30G
    
    # 关闭
    qm stop <vmid>
    # 如果关闭失败
    qm list
    # 找到 vm 对应的 pid
    kill <pid>
    
    # 删除
    qm destroy <vmid> --destroy-unreferenced-disks 1 --purge 1 --skiplock 1
    
    # 强制删除
    rm -f /etc/pve/nodes/*/*/<vm_id>.conf
    # [修復Proxmox VE:無法刪除虛擬機器](https://blog.pulipuli.info/2014/08/proxmox-ve-fix-proxmox-ve-destroy.html#postcataproxmox-ve-fix-proxmox-ve-destroy.html0_anchor2)
    

    LXC容器

    # 关闭
    pct stop <vmid>
    pct list
    

    存储

    # 查看存储空间使用情况
    pvesm status
    
    # 查看存储内的文件
    pvesm list <storage>
    
    # 查看存储配置
    cat /etc/pve/storage.cfg
    
    # 给local存储添加存储类型
    pvesm set local --content snippets,rootdir,import,images,backup,vztmpl,iso
    # 注意!!!片段文件只能放在 /var/lib/vz/snippets/ 目录下,不支持子目录
    
    # 将local-lvm(LVM-Thin)合并到local
    # 移动虚拟机硬盘到local
    qm disk move <vmid> <disk> <storage> --format qcow2 --delete 1
    # 移动容器卷到local
    pct move-volume <vmid> <volume> <storage> --delete 1
    # 删除local-lvm存储
    lvremove pve/data
    # 空间合并到local
    lvextend -l +100%FREE -r pve/root
    # 在WebUI的“数据中心”-"存储"里,手动移除local-lvm
    
    CLI ProxmoxVE Created Tue, 27 Dec 2022 16:51:54 +0800
  • 特点:

    1. 小巧:基于musl libc 和 busybox,和 busybox一样小巧,最小的Docker镜像只有5MB。
    2. 安全:面向安全的轻量发行版
    3. 简单:提供APK包管理工具,软件的搜索、安装、删除、升级都非常方便。
    4. 适合容器使用:由于小巧、功能完备,非常适合作为容器的基础镜像。

    不同版本:

    • STANDARD:最小的可启动镜像,需要网络才能安装。带有Intel, AMD等CPU的微代码。
    • VIRTUAL:与STANDARD类似,但更小,更适合虚拟系统使用。
    • EXTENDED:包括最常用的软件包。适用于路由器和服务器。从RAM运行。扩展版本,带有更多软件包。
    • XEN:内置XEN Hypervisor支持。
    • NETBOOT:netboot的内核、initramfs和modloop。
    • RASPBERRY PI:带有树莓派内核的版本。
    • GENERIC ARM:带有ARM内核,带有uboot加载器。
    • MINI ROOT FILESYSTEM:最小系统版本,仅包含内核,只用于构建Docker镜像。

    1. 准备系统

    Alpine 有许多版本,其中 VIRTUAL 是专门针对虚拟环境优化过的,所以主要使用这个版本来安装。

    https://www.alpinelinux.org/downloads/

    2. 登录

    ...
    # 使用启动盘启动后,直接使用 root 登录系统
    localhost login: root
    

    3. 安装

    ...
    localhost:~# setup-alpine
    
    # 选择键盘布局
    # 这里两个都选 cn 或都不选
    ...
    Select keyboard layout: [none] cn
    ...
    Select variant (or 'abort'): cn
    
    # 设置主机名
    ...
    Enter system hostname (fully qualified form, e.g. 'foo.example.org') [localhost] home
    
    # 设置网络
    ...
    Which one do you want to initialize? (or '?' or 'done') [eth0] eth0
    
    Ip address for eth0? (or 'dhcp', 'none', '?') [dhcp] dhcp
    Do you want to do any manual network configuration? (y/n) [n] n
    # or 手动输入IP地址
    Ip address for eth0? (or 'dhcp', 'none', '?') [dhcp] 192.168.10.16/24
    Gateway? (or 'none') [none] 192.168.10.10
    Do you want to do any manual network configuration? (y/n) [n] n
    DNS domain name? (e.g 'bar.com') 
    DNS nameserver(s)? 114.114.114.114
    
    # 设置密码
    ...
    New password: 
    ...
    Retype password:
    
    # 设置时区
    # PRC 代理中国,也可以输入 Asia/,再输入 Shanghai
    ...
    Which timezone are you in? ('?' for list) [UTC] PRC
    
    # 设备代理
    ...
    HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] none
    
    # 设置更新源
    # f 是自动测试并选择最快的源,建议使用
    ...
    Enter mirror number (1-74) or URL to add (or r/f/e/done) [1] f
    
    # 
    Setup a user? (enter a lower-case loginname, or 'no') [no] no
    
    # 设置ssh服务
    Which ssh server? ('openssh', 'dropbear', or 'none') [openssh] openssh
    # 这里一定要输入 yes 
    # 许多教程都说 Alpine 默认没有远程登录,都上手动修改,其实是可以在安装时就设备好的
    Allow root ssh login? ('?' for help) [prohibit-password] yes
    Enter ssh key or URL for root (or 'none') [none] none
    
    # 设置磁盘
    ...
    Which disk(s) would you like to use? (or '?' for help or 'none') [none] sda
    ...
    How would you like to use it? ('sys', 'data', 'crypt', 'lvm' or '?' for help) [?] sys
    ...
    WARNING: Erase the aboue disk(s) and continue? (y/n) [n] y
    ...
    Installation is complete. Please reboot.
    # 到这里安装全部完成
    

    3.1. 自动安装

    # 准备应答文件
    

    4. 命令重启电脑

    home:~# reboot
    

    5. 关闭防火墙

    home:~# rc-service iptables stop
    home:~# rc-update del iptables
    
    vm qmue\kvm linux proxmoxve Alpine linux Created Sun, 19 Jun 2022 11:46:55 +0800
  • Proxmox系统安装后,日志报错

    rrdcached[4513]: handle_request_update: Could not read RRD file.
    pmxcfs[4527]: [status] notice: RRDC update error /var/lib/rrdcached/db/pve2-vm/85235: -1
    pmxcfs[4527]: [status] notice: RRD update error /var/lib/rrdcached/db/pve2-vm/85235: mmaping file '/var/lib/rrdcached/db/pve2-vm/85235': Invalid argument
    

    修复命令

    $ rm -r /var/lib/rrdcached/db
    $ systemctl restart rrdcached.service
    

    参考文档

    rrd proxmoxve Created Tue, 08 Feb 2022 10:42:35 +0800
  • 1. 升级系统软件包

    $ apt-get update
    $ apt-get dist-upgrade
    

    2. 安装 ifupdown2

    使用 ifupdown2 网络管理软件包,还可以实时重新加载网络配置,而无需重新启动。

    $ apt install ifupdown2
    

    3. 配置物理网卡

    使用 PVE 的 WEB 管理界面,设置物理网卡的配置。

    注意:一定要分配一个静态的IP地址,否则无法正常登录 PVE

    节点 > 系统 > 网络:

    • address:192.168.10.66/24
    • gateway:192.168.10.1

    保存后应用配置

    4. 配置虚拟网卡

    4.1 修改虚拟网卡配置

    使用 PVE 提供管理界面进行配置。 删除 vmbr0 设备的所有配置内容。

    编辑 /etc/network/interfaces

    $ nano /etc/network/interfaces
    

    加入

    source /etc/network/interfaces.d/*
    
    # network interface settings; autogenerated
    # Please do NOT modify this file directly, unless you know what
    # you're doing.
    #
    # If you want to manage parts of the network configuration manually,
    # please utilize the 'source' or 'source-directory' directives to do
    # so.
    # PVE will preserve these directives, but will NOT read its network
    # configuration from sourced files, so do not attempt to move any of
    # the PVE managed interfaces into external files!
    
    source /etc/network/interfaces.d/*
    
    auto lo
    iface lo inet loopback
    
    auto enp1s0
    iface enp1s0 inet static
            address 192.168.10.66/24
            gateway 192.168.10.1
    
    iface vmbr0 inet manual
            bridge-ports none
            bridge-stp off
            brideg-fd
    

    4.2 新建虚拟网卡配置

    创建新的虚拟网卡配置

    NAT proxmoxve Created Mon, 07 Feb 2022 14:07:32 +0800