ubuntu 20.04 安装KVM

on Ubuntu 20.04 Server

cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime

# 安装kvm相关命令
apt install virtinst libvirt-daemon-system bridge-utils cloud-utils libguestfs-tools virt-top

# nmcli 指令创建系统桥接网卡(这种方式适合使用NetworkManager托管网络的系统)
nmcli con add type bridge con-name br0 ifname br0 autoconnect yes
nmcli con add type bridge-slave ifname eno1 master br0
nmcli con modify br0 bridge.stp no
nmcli con modify br0 ipv4.method manual ipv4.addresses "192.168.999.999/24" ipv4.gateway "192.168.999.254" ipv4.dns "192.168.999.250"
nmcli con show
nmcli con up br0
nmcli connection down "Wired connection 1"
nmcli con down br0
nmcli con delete br0

# 通过 netplan 配置文件创建系统桥接网卡
cat >br0.xml <br0.xml <
br0



EOF
virsh net-define br0.xml 
virsh net-autostart br0
virsh net-start br0

你可能感兴趣的:(ubuntu 20.04 安装KVM)