Install Xen
Yum install-y centos-release-xen Xen
Installing the Virtualization Management tool
Yum install libvirt python-virtinst libvirt-daemon-xen bridge-utils-y
Reboot, Xen kernel running
Virtual machine installation Environment build:
1. Configure the Bridging network
[email protected] xen]# cat xend-config.sxp |egrep-v ' (^#|^\ *$) '
(Xend-unix-server Yes)
(Xend-relocation-server No)
(Xend-relocation-hosts-allow ' ^localhost$ ^localhost\\.localdomain$ ')
(network-script/bin/true)
(Vif-script Vif-bridge)
(Dom0-min-mem 256)
(enable-dom0-ballooning Yes)
(Total_available_memory 0)
(Dom0-cpus 0)
(vncpasswd ")
Modified to:
[email protected] xen]# cat xend-config.sxp |egrep-v ' (^#|^\ *$) '
(Xend-unix-server Yes)
(Xend-relocation-server No)
(Xend-relocation-hosts-allow ' ^localhost$ ^localhost\\.localdomain$ ')
(Network-script ' Network-bridge bridge=xenbr1 ')
(network-script/bin/true)
(Vif-script Vif-bridge)
(Dom0-min-mem 256)
(enable-dom0-ballooning Yes)
(Total_available_memory 0)
(Dom0-cpus 0)
(vncpasswd ")
[Email protected] xen]#
2. Set Up server startup
Chkconfig LIBVIRTD on
Chkconfig Libvirt-guest on
Chkconfig libvirt-guests on
3. After reboot:
[Email protected] xen]# ifconfig
Lo Link encap:local Loopback
inet addr:127.0.0.1 mask:255.0.0.0
Inet6 addr::: 1/128 scope:host
Up LOOPBACK RUNNING mtu:65536 metric:1
RX packets:928 errors:0 dropped:0 overruns:0 frame:0
TX packets:928 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:36599055 (34.9 MiB) TX bytes:36599055 (34.9 MiB)
Peth0 Link encap:ethernet HWaddr 08:00:27:63:01:87
Inet6 ADDR:FE80::A00:27FF:FE63:187/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:11196 errors:0 dropped:0 overruns:0 frame:0
TX packets:6741 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9413252 (8.9 MiB) TX bytes:851189 (831.2 KiB)
vif2.0 Link encap:ethernet HWaddr FE:FF:FF:FF:FF:FF
Inet6 ADDR:FE80::FCFF:FFFF:FEFF:FFFF/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:25 errors:0 dropped:0 overruns:0 frame:0
TX packets:255 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:1028 (1.0 KiB) TX bytes:19605 (19.1 KiB)
Virbr0 Link encap:ethernet HWaddr a2:81:98:ec:a4:44
inet addr:192.168.122.1 bcast:192.168.122.255 mask:255.255.255.0
Up broadcast multicast mtu:1500 metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
XENBR1 Link encap:ethernet HWaddr 08:00:27:63:01:87
inet addr:192.168.16.253 bcast:0.0.0.0 mask:255.255.255.0
Inet6 ADDR:FE80::A00:27FF:FE63:187/64 Scope:link
Up broadcast RUNNING multicast mtu:1500 metric:1
RX packets:25135 errors:0 dropped:0 overruns:0 frame:0
TX packets:26826 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9837395 (9.3 MiB) TX bytes:305790710 (291.6 MiB)
4. Install the httpd and place the image under HTML
Yum Install httpd
Mkdir/var/www/html/iso
mount/dev/cdrom1/var/www/html/iso/
Service Iptables Stop
Service httpd Start
Mkdir/xen
Virt-install-n zyt_vm01-r--disk path=/xen/zyt_vm01.img,size=6-l http://192.168.16.253/iso
CP a virtual machine:
1. Create a Xen virtual machine configuration file
[email protected] xen]# cat xmexample1|egrep-v ' (^#|^\ *$) '
Kernel = "/boot/vmlinuz-2.6.10-xenu"
Memory = 64
Name = "ExampleDomain"
Vif = ["]
disk = [' Phy:hda1,hda1,w ']
root = "/dev/hda1 ro"
Extra = "4"
[email protected] xen]# cat xmexample1|egrep-v ' (^#|^\ *$) ' >zyt_vm02
[Email protected] xen]# VI zyt_vm02
[email protected] xen]# cat zyt_vm02
#kernel = "/boot/vmlinuz-2.6.10-xenu"
Memory = 512
Name = "ZYT_VM02"
Vif = [' BRIDGE=XENBR1 ']
disk = [' File:/xen/zyt_vm02.img,xvda,w ']
#root = "/dev/hda1 ro"
#extra = "4"
[Email protected] xen]#
2.CP Mirroring
[Email protected] ~]# cd/xen/
[email protected] xen]# LL
Total 1516148
-rwxr-xr-x. 1 root root 6442450944 Mar 6 05:01 zyt_vm01.img
[email protected] xen]# CP zyt_vm01.img ZYT_VM02.IMG
[Email protected] xen]#
3. Start a new virtual machine
XM Create-c zyt_vm02
4. Change the MAC address after entry, host name
This article is from the "relieved" blog, please be sure to keep this source http://yantaohncz.blog.51cto.com/727950/1618371
centos6.4 Installing Xen