1 |
yum -y groupinstall "X Window System" "Desktop" |
1 2 3 4 |
yum -y groupinstall "Virtualization" "Virtualization Client" yum -y install libvirt service libvirtd start #启动服务 chkconfig libvirtd on #设置开机启动 |
1 2 3 |
lsmod | grep kvm kvm kvm_intel #(此行没有显示是因为CMOS中没开启虚拟化,或者CPU不支持) |
1 2 3 4 5 |
[iyunv@localhost ~]# virsh -c qemu:///system list Id Name State ---------------------------------- |
1 |
yum -y install bridge-utils tunctl |
1 2 |
cp ifcfg-eth0 ifcfg-eth0.bak cp ifcfg-eth0 ifcfg-br0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#cat ifcfg-br0 DEVICE=br0 TYPE=Bridge BOOTPROTO=static IPADDR=192.168.0.251 NETMASK=255.255.255.0 GATEWAY=192.168.0.1 HWADDR=74:D4:35:20:68:51 ONBOOT=yes #cat ifcfg-eth0 DEVICE=eth0 ONBOOT=yes BRIDGE=br0 BOOTPROTO=none |
1 |
#service network restart |
1 2 3 4 5 6 7 8 |
#virt-install \ --name=v1 --ram=512 --vcpus=1 --cdrom=/media/CentOS_6.2_final.iso --os-type=rhel6 --disk /var/lib/libvirt/imgages/v1.img,size=8,bus=virtio,cache=writeback --network bridge=br0,model=virtio |
1 |
virt-clone -o vm_231 -n vm_232 -f /data/vm_232.img |