CentOS虚拟化实验环境搭建

为了准备RHCE考试,我把一台i7-2600k、16G内存、120Gssd的闲置主机刷成了CentOS7.下面是具体环境搭建的细节。


首先是系统的准备工作

su

yum update -y
yum install -y epel-release
yum makecache

yum install -y bash-completion network-tool sysfsutils 
yum install -y htop vim ctags curl wget mlocate lftp
curl https://raw.githubusercontent.com/wklken/vim-for-server/master/vimrc > ~/.vimrc

配置虚拟化环境

#安装kvm
yum -y install qemu-kvm libvirt virt-install bridge-utils
yum -y install libguestfs-tools virt-top

#启动虚拟化管理服务
systemctl start libvirtd
systemctl enable libvirtd

#开启kvm嵌套
echo "options kvm-intel nested=1" >> /etc/modprobe.d/kvm-intel.conf

#重新加载kvm模块
modprobe -r kvm_intel
modprobe kvm_intel

#关闭防火墙
systemctl stop firewalld
systemctl disable firewalld

#关闭selinux
vi /etc/selinux/config 
>SELINUX=disabled

reboot