ubuntu安装kvm及配置网桥

安装kvm

  1. 安装KVM
sudo apt install qemu qemu-kvm libvirt-bin bridge-utils virt-manager
  1. 将libvirtd添加自启动
sudo systemctl start libvirtd.service
sudo systemctl enable libvirtd.service

配置网桥

编辑 /etc/netplan/下的.yaml文件
vim /etc/netplan/01-network-manager-all.yaml

network:
  version: 2
  ethernets:
    eno1:
     dhcp4: no
     dhcp6: no
  bridges:
   kvmbr0:
    interfaces: [eno1]
    dhcp4: no
    addresses: [172.16.20.134/24]
    gateway4: 172.16.20.1
    nameservers:
     addresses: [172.16.252.2]

ubuntu安装kvm及配置网桥_第1张图片

  1. 重启网卡
    netplan apply

你可能感兴趣的:(linux)