centos 安装qemu-kvm 虚拟安装centos和windows


centos 安装qemu-kvm 虚拟安装centos和windows
查找相关文章:centos

更新系统

yum update

关闭selinux

setenforce 0

开始安装

yum -y install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client
yum -y groupinstall virtualization-client virtualization-platform virtualization-tools

重启libvirtd

service libvirtd restart

service  libvirtd status

安装vnc图形界面

yum -y install nano tigervnc-server firefox; \
yum -y groupinstall "Chinese Support" "Desktop";\

rpm -ivh http://www.dayanmei.com/software/adobe-release-x86_64-1.0-1.noarch.rpm; \
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux; \
yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl -y; \
echo 'echo "nameserver 8.8.8.8" >> /etc/resolv.conf; ' >> /etc/rc.local; \
echo 'VNCSERVERS="1:root"' >> /etc/sysconfig/vncservers; \
echo 'VNCSERVERARGS[1]="-geometry 1000x700"' >> /etc/sysconfig/vncservers; \
chkconfig vncserver on --level 345; \
vncpasswd;

使用vncviewer登录服务器

下载iso

https://www.centos.org/download/mirrors/

http://isoredirect.centos.org/centos/6/isos/x86_64/

http://download.nus.edu.sg/mirror/centos/6.7/isos/x86_64/CentOS-6.7-x86_64-minimal.iso

http://repos.lax.quadranet.com/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-minimal.iso


启动virtual machine manager开始安装系统


设置网络桥接

chkconfig network on
service network restart
yum -y erase NetworkManager
cp -p /etc/sysconfig/network-scripts/ifcfg-{eth0,br0}
sed -i -e'/HWADDR/d' -e'/UUID/d' -e's/eth0/br0/' -e's/Ethernet/Bridge/' \
/etc/sysconfig/network-scripts/ifcfg-br0
echo DELAY=0 >> /etc/sysconfig/network-scripts/ifcfg-br0
echo 'BOOTPROTO="none"' >> /etc/sysconfig/network-scripts/ifcfg-eth0
echo BRIDGE=br0 >> /etc/sysconfig/network-scripts/ifcfg-eth0
service network restart
brctl show