系统:centos7.1
安装环境:桌面环境、kvm基础服务
一、关闭selinux
1
2
|
[root@localhost ~]
# setenforce 0
[root@localhost ~]
# sed -i 's/enforcing/disabled/g' /etc/selinux/config
|
二、关闭iptables
1
2
|
[root@localhost ~]
# systemctl stop firewalld
[root@localhost ~]
# systemctl disable firewalld
|
三、确认服务器cpu是否支持虚拟化
1
2
3
4
5
6
7
8
9
|
[root@localhost ~]
# grep -o 'vmx\|svm' /proc/cpuinf
vmx
vmx
vmx
vmx
vmx
vmx
vmx
vmx
|
四、安装桌面
1、已经安装的软件以及可以安装的软件
2、安装图形桌面
1
|
[root@localhost ~]
# yum -y groupinstall "X Window System" "GNOME Desktop"
|
3、安装vncserver
1
|
[root@localhost ~]
# yum -y install tigervnc-server
|
4、配置vnc
1
2
3
4
5
6
7
8
9
10
|
[root@localhost ~]
# vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth:
file
/root/
.Xauthority does not exist
New
'localhost.localdomain:1 (root)'
desktop is localhost.localdomain:1
Creating default startup script
/root/
.vnc
/xstartup
Starting applications specified
in
/root/
.vnc
/xstartup
Log
file
is
/root/
.vnc
/localhost
.localdomain:1.log
|
5、使用vnc连接测试
五、安装kvm
1、安装kvm依赖包
1
2
3
4
|
[root@localhost ~]
# yum -y install qemu-kvm libvirt virt-install bridge-utils virt-manager
[root@localhost ~]
# lsmod |grep
kvmkvm_intel 148081 0
kvm 461126 1 kvm_intel
|
2、启动libvirt服务
1
2
|
[root@localhost ~]
# systemctl start libvirtd
[root@localhost ~]
# systemctl enable libvirtd
|
这样就可以创建kvm虚拟机了
本文转自 wangpengtai 51CTO博客,原文链接:http://blog.51cto.com/wangpengtai/1953235,如需转载请自行联系原作者