Debian 安装Proxmox VE(PVE)虚拟化管理软件 虚拟机可视化管理

KKXZ 2024-04-23 AM 52℃ 0条

Proxmox VE(简称为PVE),是一个款开源虚拟化管理软件,和ESXI类似,简单的说就是用来开设和管理虚拟机的。
设置host

PVE官方要求,/etc/hosts需要做如下修改:

#首先设置hostname,根据实际情况自行修改,我这里设置为pve
hostnamectl set-hostname pve
#修改/etc/hosts,添加如下内容
127.0.0.1       localhost.localdomain localhost
192.168.15.77   pve.proxmox.com pve

192.168.15.77为你服务器公网IP,请自行修改
你的hostname设置为pve,那么必须设置域名为pve.proxmox.com,同理如果hostname设置为test,则为test.proxmox.com

添加PVE安装源

依次执行下面的命令:

echo "deb http://download.proxmox.com/debian/pve buster pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
wget http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg
chmod +r /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg
apt update && apt full-upgrade

安装PVE

#安装
apt -y install proxmox-ve postfix open-iscsi

根据提示选择,我这里选择的“NO”然后继续安装。

如果您不是安装的双系统,则可以删除os-prober软件包

apt remove os-prober

reboot重启服务器,使其加载PVE内核。重启成功后访问PVE WEB界面:https://IP:8006,注意是https协议,否则无法打开。用户名、密码就是服务器所使用的用户名/密码。

下载镜像

PVE系统镜像位置存放在/var/lib/vz/template/iso目录下,您只需要将.iso镜像下载或上传到这个目录下,然后通过PVE WEB管理界面进行安装。

图片

网卡配置(NAT4模式)

auto vmbr0
iface vmbr0 inet static
    address 100.100.20.1/28
    bridge-ports none
    bridge-stp off
    bridge-fd 0
    post-up   echo 1 > /proc/sys/net/ipv4/ip_forward
    post-up   iptables -t nat -A POSTROUTING -s '100.100.20.0/28' -o ens3 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '100.100.20.0/28' -o ens3 -j MASQUERADE

网卡配置(NAT4+NAT6)

auto vmbr1
iface vmbr1 inet static
    address 100.100.30.1
    netmask 255.255.255.240
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    post-up echo 1 > /proc/sys/net/ipv4/ip_forward
    post-up iptables -t nat -A POSTROUTING -s '100.100.30.0/28' -o ens3 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '100.100.30.0/28' -o ens3 -j MASQUERADE
    post-up   iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
    post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1

iface vmbr1 inet6 static
        address fd88::1/124
        post-up sysctl -w net.ipv6.conf.all.forwarding=1
        post-up ip6tables -t nat -A POSTROUTING -s fd88::/124 -o ens3 -j MASQUERADE
        post-down sysctl -w net.ipv6.conf.all.forwarding=0
        post-down ip6tables -t nat -D POSTROUTING -s fd88::/124 -o ens3 -j MASQUERADE
        post-up   ip6tables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
        post-down ip6tables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1

Debian10 源

deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free

deb http://deb.debian.org/debian/ buster-updates main contrib non-free
deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free

deb http://deb.debian.org/debian/ buster-backports main contrib non-free
deb-src http://deb.debian.org/debian/ buster-backports main contrib non-free

deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free

标签: none

非特殊说明,本博所有文章均为博主原创。

评论啦~