debian安装kvm

1. 确认cpu是否支持虚拟化

cat /proc/cpuinfo |grep

确认信息,其中,intel应包含vmx,amd包含svm

2. 安装软件

apt-get install qemu-kvm libvirt-clients libvirt-daemon-system virtinst

virtinst:命令行工具

3. 安装网桥

apt install bridge-utils
  • 创建网桥配置
    /etc/network/interface.d/新增br0

静态IP

## static ip config file for br0 ##
auto br0
iface br0 inet static
address 192.168.2.23
broadcast 192.168.2.255
netmask 255.255.255.0
gateway 192.168.2.254
# If the resolvconf package is installed, you should not edit
# the resolv.conf configuration file manually. Set name server here
#dns-nameservers 192.168.2.254
# If you have muliple interfaces such as eth0 and eth1
# bridge_ports eth0 eth1
bridge_ports eno1
bridge_stp off # disable Spanning Tree Protocol
bridge_waitport 0 # no delay before a port becomes available
bridge_fd 0 # no forwarding delay

DHCP

## DHCP ip config file for br0 ##
auto br0
     
# Bridge setup
iface br0 inet dhcp
bridge_ports eno1
  • 修改/etc/network/interface.d/interface
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
     
source /etc/network/interfaces.d/*
     
# The loopback network interface
auto lo
iface lo inet loopback

修改完成之后重启网络

  • 参考链接

    https://wiki.debian.org/KVM

你可能感兴趣的:(debian安装kvm)