Xen

FedoraXenQuickstart - Fedora Xen å

Ϥˡ Xen ѲǽʤΤ Fedora Core 4 ǤΤǤդܤˤĤƤ http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html 䤿ϰǤǤϤʤ(ᤤ˰ 3.0 ꡼ޤ) Xen ι¤ˤĤ򤹤Ƥޤ礦ΤȤư򤷤ʤ⤢ޤǻ䤿ζ̣椭դ¸ߤǤ˰㤤ޤ󡣤ޤXen ϸ NetBSD/xen FreeBSD 5.0 ports Xen 2.0.x ١ȤΤưޤ

Xen ư뤿Υåȥå׺ȤϤñʤΤǤǤ Fedora ȯƥ Xen ñΤΥ OS Ȥƥåȥåפ뤿γפҤ٤ޤ

xen ¹Ԥˤϡxen ѥå˲äxen0 xenU ͥ롦ѥåɬѤȤʤޤäưʲξ郎ɬפǤ

  • Python - Twisted ե졼
  • grub ֡ȥȤѤ뤳*1
  • ɸΥåȥå׻*2ˤơ256 MB ٤Υ(RAM)

ơޤ xen kernel-xen ѥå򥤥󥹥ȡ뤷ʤƤϤޤ󡣰٥󥹥ȡ뤷Ƥޤ xen0 ͥư뤿 grub.conf εҤ񤭴Ǥ줫 xen0 ͥǥ֡Ȥ褦ФƵưޤ*3

Ƶư grub dom0 ͥ*4ưƤ줫顢xen ǡεưȥɥᥤɤ߹ޤޤ

service xend start
xm list

ɥᥤ󤬲ƯƤ뤫ɤǧۤɤǤơ줫饷ץ Fedora ƥιۤ򤷤Ƥߤޤ礦ޤϤˡkernel-xenU ѥåΥ󥹥ȡԤʤƤϤޤʤˤȡɥᥤϥ OS γ˥֤ͥʤƤϤʤΤǤˡˡFedora 򥤥󥹥ȡ뤹뤿δפȤʤեޤʲǤ 1 GB ΥեƤޤ

dd if=/dev/zero of=/root/fedora.img bs=1M count=1 seek=1024

줫顢Υ᡼եФ ext3 ե륷ƥۤޤ

mke2fs -F -j /root/fedora.img

줫鿷ե륷ƥ೬ؤŪǧ뤿ˡ /mnt ذŪ˥ޥȤޤ

mount -o loop /root/fedora.img /mnt

ǴŪʺȤϽޤxen ư뤿ˡ㴳ɸȤϰۤʤäŪʥե볬إƥ򥻥åȥåפ뤳Ȥˤʤޤyum Ȥä chroot 󥹥ȡԤǤˡƤϰʲ̤Ǥ

a) initrd ѤƤʤ /dev ۲ɬѤȤǥХΡɤޤ

for i in console null zero ; do MAKEDEV -d /mnt/dev -x $i ; done

b) /etc/fstab ĴޤΤ褦ñʵҤưޤ

/dev/sda1               /                       ext3    defaults 1 1
none                    /dev/pts                devpts  gid=5,mode=620 0 0
none                    /dev/shm                tmpfs   defaults 0 0
none                    /proc                   proc    defaults 0 0
none                    /sys                    sysfs   defaults 0 0

μϥޥȤ줿 /mnt /proc ޤgrupadd ޥɤˤϥХ뤿Ǥshadow-utils-4.0.7-7 ǤϽѤߤǤ

mkdir /mnt/proc
mount -t proc none /mnt/proc

ơ chroot 줿 /mnt ؤɤΤ褦ʴܥƥǤ⥤󥹥ȡ뤹뤳ȤǤ褦ˤʤޤ⤷ʥߥ顼ȤѤͤƤΤǤ顢 yum.conf ɤơѤߥ顼Ȥξ˽񤭴Ƥ줫顢ɤΤ褦ʥ롼׷򥤥󥹥ȡ뤹뤫Ʋ Base Base ؤ Core ȤȤˡ⤢ޤ񤷤Ǥ Ϥ뤳Ȥ侩ޤΤ褦˼¹Ԥޤ

yum -c http://people.redhat.com/~katzj/yum-xen.conf --installroot=/mnt -y groupinstall Base

󥹥ȡˤ¿λ֤ޤҡꤪۻҤ򿩤٤ƤƤ :-)

աSELinux ɬ̵ˤƤƤSELinux ưλȤߤ˱ơȤ chroot ĶǤäƤ⸷ʤ˥ѥФ¡ʥƥƥȡˤŬѤ뤿ᡢ󥹥ȡ˻پڤܤޤ

Ƥӥ󥽡ä줿ȤϽǤ/mnt ˺Ǿ¤Υ󥹥ȡԤޤ*5

xen Υ OS initrd Ȥ鷺˵ư뤿ᡢguest OS Ǥ SELinux ̵ˤ٤Ǥ/mnt/etc/selinux/config եԽ SELINUX ιܤ permissive disabled ѹƤΥۥȤ SELinux ̵ˤƤΤǤСʲΤ褦ˤǤޤ

cp /etc/selinux/config /mnt/etc/selinux/config

¾򽪤ե륷ƥ򥢥ޥȤޤ

umount /mnt/proc
umount /mnt

Ȥեκ򽪤顢ʳ˿ʤळȤǤޤʬΥޥˤ /etc/xen/rawhide ʲΤ褦ԽƤȤƤñʤΤǤ

kernel ="/boot/vmlinuz-2.6.12-1.1369_FC4xenU"
memory = 64
name = "rawhide"
nics = 1
disk = ['file:/root/fedora.img,sda1,w']
root = "/dev/sda1 ro"

ͥȤ xenU ѥåǥ󥹥ȡ뤷 /boot/vmlinuz-2.6.12-1.1369_FC4xenU Ѥޤ­ƤȡǥХ̾ sda1 ȵҤƤΤϡۤɾ嵭 /etc/fstab ǵҤݤΤΤǤ

ºݤ˥ɥᥤˤꡢdomain0 Ф xm balloon ȤäƥγƤԤޤޥ 'xm balloon 0 384' ¹Ԥ뤳Ȥˤäơdomain0 Τ RAM 384 MB Υ̤ݤޤºݤѥͤơdomain0 ˤϤɤ٤ΥΤɬפߤΤƤƤʬƤͤǤ礦

ơ 'xm create -c rawhide' ޥɤ¹ԤƿɥᥤޤǸ˥ɥᥤ󡦥ץץȤɽ뤫ɤǧroot ǥǤ뤫ɤ伫ͳ˥ޥɤȤ뤫ʤɳڤǤߤƤ

missing shell ʥ뤬̵˥顼ˤĤơ /etc/passwd եǥ /bin/bash ¾ΥˤȻꤷƤΤ˴ؤ餺顼Ȥʤ礬ޤ糵 SELinux ˤΤǤdomain 0 Ф̵ˤΤƱͤ˿ɥᥤ˱Ƥ SELinux ̵ˤƲ

ƥεư˼ưŪ˥ɥᥤƯˤϡxend xendomains ӥͭˤơxen ե /etc/xen/auto ǥ쥯ȥ֤ɬѤޤ

ʾ夬ʷơȤǤȤʤ٤ˤϤޤޤȤޤΥƥåפϤʤȤɤΤ褦 Xen ȴĶǼºݤ˥󥹥ȡԤȡե륷ƥǥͥư뤳Ȥ뤫ǤʤϤ⤦ޤǤɤ夤ƤΤǤʤϻפޤ :) ˡ

Troubleshooting - ȥ֥륷塼ƥ

xen Υƥ।󥹥ȡȤˤꡢdom0 ưǧȤʤ룲ĤΥե뤬ޤ/var/log/xend.log 'xm log' ¹ԤǵϿϤ졢ŪưˤĤƤξ󤬵Ͽޤˤ˵Ͽåʬûñʾ󤷤ϿƤޤ󡣰ʲν NetBSD/xen ͥ¹Ԥ褦ȤȤνϤǤ

[2005-06-27 02:23:02 xend] ERROR (SrvBase:163) op=create: Error creating domain:(0, 'Error')
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvBase.py", line 107, in _perform
    val = op_method(op, req)
  File "/usr/lib/python2.4/site-packages/xen/xend/server/SrvDomainDir.py", line 71, in op_create
    raise XendError("Error creating domain: " + str(ex))
XendError: Error creating domain: (0, 'Error')

⤦ĤΥե /var/log/xend-debug.log ǤΥեˤϾܺ٤ʾ󤬵ϿޤNetBSD/xen ͥư褦ȤȡΤ褦ʽϷ̤ˤʤޤ

ERROR: Will only load images built for Xen v3.0
ERROR: Actually saw: 'GUEST_OS=netbsd,GUEST_VER=2.0,XEN_VER=2.0,LOADER=generic,BSD_SYMTAB'
ERROR: Error constructing guest OS

åȥå˥顼Сxend.logxend-debug.log ɽξΥμˤʤǤ礦

X in domain 0

㴳ΥƥǤ domain 0 ˱ X Window ƥư褦ȤƤ vm86 ֤ domain 0 ΤΥݤ뤳Ȥʤ礬ޤΤ褦ʾ X ưˤϡvm86 ڤΥƤޤȤǤޤǤ¾ X Ƥޤ⤢ޤ

cd /usr/X11R6/lib/modules/linux/
mv libint10.a unused-libint10.a

ʸ
http://fedoraproject.org/wiki/FedoraXenQuickstart

*1 Xen ƥ Linux ͥɤ߹ޤ뤿ˤ grub ѤƤɬܾǤ
*2 ºݤˤϥ꤬ʤȤʤȤưϤޤ/boot/grub/grub.conf dom0_memory ǻꤵƤͤ򸺤餵ʤƤϤʤʤޤmkinitrd ˤä dom0 Τ 130000 ݤ褦ꤵƤޤ餹ȤǤޤɬפ˱䤷Ƥ⹽ޤˡǡXen ƥϺǤ 32 MB ΥɬפȤޤΥ˥ OS Ƥξ¸뤳Ȥˤʤޤ
*3 rhgb ߤ٥ 3 ڤؤɬѤޤ̤ڤǤX Window ư˻پ㤬Ȥ𤬤ޤ
*4 ưǧ 'uname -r' ޥɤ¹Ԥơͥ xen0 ޤޤƤ뤫ɤĴ٤ޤ
*5 ʣ RPM ѥåƤ褦˸礬ޤץȤεҤˤΤԤθǤchroot ĶǺ yum ¹ԤɬѤޤ

ȥå   Խ ʬ Хåå ź ʣ ̾ѹ   ñ측 ǽ   إ   ǽRSS
Last-modified: Mon, 08 Aug 2005 21:43:14 JST (6328d)