Ubuntu下安装KVM

来源:互联网 发布:数据采集控制箱 编辑:程序博客网 时间:2024/06/15 18:29

安装KVM

$sudo update

$sudo apt-get install bridge-utils kvm libvirt-binvirt-manager

添加用户到libvirtd

$sudo adduser $userlibvirtd

$sudo reboot//不重启打开virt-manager会报错



$ sudo vim/etc/network/interfaces


# This file describes the network interfaces available onyour system

# and how to activate them. For more information, seeinterfaces(5).


# The loopback network interface

auto lo

iface lo inet loopback


auto eth0

iface eth0 inet manual



auto br0

iface br0 inet static

address 192.168.1.118

network 192.168.0.0

netmask 255.255.255.0

broadcast 192.168.0.255

gateway 192.168.1.1

dns-nameservers 8.8.8.8202.106.0.20

bridge_ports eth0

bridge_fd 9

bridge_hello 2

bridge_maxage 12

bridge_stp off

上面是配置静态ip的,如果动态ip就更简单了,添加如下即可

 

 

# This file describes the network interfaces available onyour system

# and how to activate them. For more information, seeinterfaces(5).


# The loopback network interface

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet manual

auto br0

iface br0 inet dhcp

bridge_ports eth0

bridge_stp off

bridge_fd 0

 

网卡配置完,最好重启一下,然后就用virtual-manager来创建虚拟机了





原创粉丝点击