java面试题网站:www.javaoffers.com
linux 安装kvm
首先安装cpu检测
1: sudo apt-get install cpu-checker
查看cpu内核
2: egrep -c '(vmx|svm)' /proc/cpuinfo
检测是否支持 kvm
3: kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
开始安装(忽略重复):
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils ia32-libs-multiarch
sudo apt install qemu-kvm libvirt-bin bridge-utils virtinst virt-manager
启动:
sudo virt-manager
启动容器时报错: error opening spice console ,spice client gtk missing
解决:
sudo apt-get install spice-client-gtk python-spice-client-gtk gir1.2-spice-client-gtk-3.0
如果出现下面错误: 没有可安装候选,说明我们的软件源中没有这些软件
解决方案: 添加软件源
找到你自己软件源目录,我的是/etc/apt/sources.list.d
在该目录下新建一个kvm.list ,内容如下:
# 默认注释了源码仓库,如有需要可自行取消注释
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# 预发布软件源,不建议启用
# deb https://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
然后 更新一下缓存
sudo apt update
再次执行命令:
sudo apt-get install spice-client-gtk python-spice-client-gtk gir1.2-spice-client-gtk-3.0
亲测安装成功