操作环境:CentOS7
#查看kvm模块的相关信息: [root@~ localhost]#modinfo kvm filename: /lib/modules/3.10.0-514.el7.x86_64/kernel/arch/x86/kvm/kvm.ko #安装kvm模块 [root@~ localhost]#modprobe kvm [root@~ localhost]#ls /dev/kvm -lh crw-------. 1 root root 10, 232 Jul 18 20:31 /dev/kvm [root@~ localhost]#lsmod|grep kvm kvm_intel 170181 0 kvm 554609 1 kvm_intel irqbypass 13503 1 kvm #查看硬件支持 [root@~ localhost]#grep -i -E '(vmx|svm|lm)' /proc/cpuinfo #模拟化工具qemu安装kvm: [root@~ localhost]#yum -y install qemu-kvm [root@~ localhost]#rpm -ql qemu-kvm /usr/libexec/qemu-kvm #无法访问qemu-kvm命令,创建软连接: [root@~ localhost]#ln -sv /usr/libexec/qemu-kvm /usr/sbin/ [root@~ localhost]#qemu- qemu-img qemu-io qemu-kvm qemu-nbd
#安装图形化管理界面包 [root@~ localhost]#yum -y install virt-manager #安装守护进程包 [root@~ localhost]#yum -y install libvirt-daemon-kvm [root@~ localhost]#systemctl start libvirtd.service #关闭 [root@~ localhost]#systemctl stop NetworkManager.service #创建桥接设备 [root@~ localhost]#virsh bridge ens33 bro [root@~ localhost]#ip a 3: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000 link/ether 00:0c:29:6c:aa:0c brd ff:ff:ff:ff:ff:ff inet 172.16.252.142/16 brd 172.16.255.255 #开启图形化虚拟主机管理界面 [root@~ localhost]#virt-manager