XEN PV Guest的创建

需要先安装xen-tools
apt-get install xen-tools

使用xen-create-image命令创建虚拟机

xen-create-image --hostname=ubuntu1 --size=3Gb --memory=512mb --arch=i386 --kernel=/boot/vmlinuz-2.6.18.8-xen --initrd=/boot/initrd.img-2.6.18.8-xen0 --dist=hardy --swap=1gb --dhcp --role=udev --dir=/etc/xen --force

但总会出现类似下面的错误:

I: Retrieving Release
E: Failed getting release file http://ftp.us.debian.org/debian/dists/lenny/Release

Copying files from new installation to host.
Copying files from /tmp/jUrDxM_Km2/var/cache/apt/archives -> /var/cache/apt/archives
Done
Done
The installation of the new system has failed.

The system is missing the common file: /bin/ls
Done
System installation failed.  Aborting

这是因为镜像地址是不正确的:http://ftp.us.debian.org/debian/dists/lenny/Release

在/etc/xen-tools/xen-tools.conf中有mirror的备选值,当然也可以在xen-create-image命令中加入mirror参数。

通过mirror参数的值和dist参数的值拼成一个url。但配置文件中提供的说明却不一定正确,例如有关dist参数,以ubuntu为例:

在http://archive.ubuntu.com/ubuntu/dists/ 下,目前存在dapper、hardy、intrepid、jaunty、karmic、lucid等子目录,但配置文件中声称ubuntu系统仅支持edgy、feisty、dapper

 

故此处在实际使用的时候需要灵活处理。

 

xen-create-image会创建虚拟机镜像文件和配置文件。启动虚拟机仍需要使用xm create <配置文件>。

posted on 2010-09-09 10:50  Roger W  阅读(1166)  评论(2编辑  收藏  举报

导航