Xen

#yum install xen kerne-xen

#vi /boot/grub/grub.conf

default=1     //修改为0,即默认引导带xen内核的系统

#reboot

 

#uname -a

Linux localhost.localdomain 2.6.18-194.el5xen  //内核已经添加xen后缀

#yum install virt-manager

#yum install  virt-viewer

建立安装树,即安装源文件

 # yum install httpd

 

 

 

[root@localhost ~]# mkdir /var/www/html/centos

[root@localhost ~]# mount /dev/cdrom /var/www/html/centos/

mount: block device /dev/cdrom is write-protected, mounting read-only

[root@localhost ~]# df -h

Filesystem            Size  Used Avail Use% Mounted on

/dev/sda1             7.6G  3.7G  3.5G  52% /

/dev/sda2             3.9G   73M  3.7G   2% /tmp

none                  872M   72K  872M   1% /var/lib/xenstored

/dev/hdc              4.1G  4.1G     0 100% /media

/dev/hdc              4.1G  4.1G     0 100% /var/www/html/centos

[root@localhost ~]# service httpd start

 

 

#virt-install -n vm03  -f /vpc/vm03.img -s 1 -r 512 nographics -l http://192.168.33.111/centos -x ks=http://192.168.33.111/ks.cfg

 xm -h

虚拟机clone

virt-clone -h

virt-clone -o vm01 -n vm04 -f /vpc/vm04.img

克隆许多台,可以编写shell

 

为虚拟机增加硬盘

编辑硬盘文件

编辑虚拟机文件

 

virbr0 = NAT

xenbr0 =bridge

 xm console vmxx

xm create vmxx

本文出自 “superman” 博客,谢绝转载!

你可能感兴趣的:(xen)