Ubuntu16.04中安装KVM

基本的 Ubuntu 操作系统装好之后,安装 KVM 需要的包

1、在此之前先确认是否CPU支持虚拟化

 执行命令:   egrep -o '(vmx|svm)' /proc/cpuinfo

如何有返回值则说明支持,例如返回带有vmx的值

2、配置国内镜像源,否则会出现各种无法安装的问题(遇到很多稀奇古怪的问题)

现在用的是阿里源, cd  /etc/apt 修改sources.list文件中的内容

deb http: //mirrors .aliyun.com /ubuntu/ xenial main restricted universe multiverse 
deb http: //mirrors .aliyun.com /ubuntu/ xenial-security main restricted universe multiverse 
deb http: //mirrors .aliyun.com /ubuntu/ xenial-updates main restricted universe multiverse 
deb http: //mirrors .aliyun.com /ubuntu/ xenial-backports main restricted universe multiverse 
##测试版源 
deb http: //mirrors .aliyun.com /ubuntu/ xenial-proposed main restricted universe multiverse 
# 源码 
deb-src http: //mirrors .aliyun.com /ubuntu/ xenial main restricted universe multiverse 
deb-src http: //mirrors .aliyun.com /ubuntu/ xenial-security main restricted universe multiverse 
deb-src http: //mirrors .aliyun.com /ubuntu/ xenial-updates main restricted universe multiverse 
deb-src http: //mirrors .aliyun.com /ubuntu/ xenial-backports main restricted universe multiverse 
##测试版源 
deb-src http: //mirrors .aliyun.com /ubuntu/ xenial-proposed main restricted universe multiverse 
# Canonical 合作伙伴和附加 
deb http: //archive .canonical.com /ubuntu/ xenial partner 
deb http: //extras .ubuntu.com /ubuntu/ xenial main

修改后sudo apt-get update


3、 安装KVM及相关依赖包

sudo apt-get install qemu-kvm
sudo apt-get install qemu
sudo apt-get install virt-manager
sudo apt-get install virt-viewer
sudo apt-get install libvirt-bin

sudo apt-get install bridge-utils

4、

 确认 Libvirtd 服务已经启动

# service libvirt-bin status

libvirt-bin start/running, process 1478

5、启动KVM验证

Ubuntu16.04中安装KVM_第1张图片

Ubuntu16.04中安装KVM_第2张图片

完成KVM安装



你可能感兴趣的:(openStack)