技術的雑談-FedoraCore4でxenを使ってみる
環境
使用OS:Linux Fedora Core4(2005/9/20頃ダウンロードしたCD-ROM版)
ほぼノーマルなインストール。但し、XWindowの不具合はupdateしてある。
目的
- Xen環境を立ち上げる
rpmから
http://fedoraproject.org/wiki/FedoraXenQuickstart などを参考に
yum instll xen yum install kernel-xen0 kernel-xenU
したんですが、立ち上がりません!!
\ \/ /___ _ __ |___ / / _ \ __| | _____ _____| | \ // _ \ '_ \ |_ \| | | |__ / _` |/ _ \ \ / / _ \ | / \ __/ | | | ___) | |_| |__| (_| | __/\ V / __/ | /_/\_\___|_| |_| |____(_)___/ \__,_|\___| \_/ \___|_| http://www.cl.cam.ac.uk/netos/xen University of Cambridge Computer Laboratory Xen version 3.0-devel (bhcompile@build.redhat.com) (gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)) Tue Aug 23 14:57:59 EDT 2005 Latest ChangeSet: (XEN) Physical RAM map: (XEN) 0000000000000000 - 000000000009fc00 (usable) (XEN) 000000000009fc00 - 00000000000a0000 (reserved) (XEN) 00000000000f0000 - 0000000000100000 (reserved) (XEN) 0000000000100000 - 000000001f7f0000 (usable) (XEN) 000000001f7f0000 - 000000001f7f3000 (ACPI NVS) (XEN) 000000001f7f3000 - 000000001f800000 (ACPI data) (XEN) 00000000ffff0000 - 0000000100000000 (reserved) (XEN) System RAM: 503MB (515644kB) (XEN) Xen heap: 10MB (10656kB) (XEN) PAE disabled. (XEN) DMI 2.2 present. (XEN) Using APIC driver default (XEN) ACPI: RSDP (v000 VIA601 ) @ 0x000f72f0 (XEN) ACPI: RSDT (v001 VIA601 AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x1f7f3000 (XEN) ACPI: FADT (v001 VIA601 AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x1f7f3040 (XEN) ACPI: DSDT (v001 VIA601 AWRDACPI 0x00001000 MSFT 0x0100000c) @ 0x00000000 (XEN) Local APIC disabled by BIOS -- you can enable it with "lapic" (XEN) Initializing CPU#0 (XEN) Detected 930.692 MHz processor. (XEN) Using scheduler: Simple EDF Scheduler (sedf) (XEN) CPU: L1 I cache: 16K, L1 D cache: 16K (XEN) CPU: L2 cache: 256K (XEN) CPU0: Intel Pentium III (Coppermine) stepping 06 (XEN) SMP motherboard not detected. (XEN) Local APIC not detected. Using dummy APIC emulation. (XEN) Platform timer is 1.193MHz PIT (XEN) Brought up 1 CPUs (XEN) mtrr: v2.0 (20020519) (XEN) *** LOADING DOMAIN 0 *** (XEN) Xen-ELF header found: 'GUEST_OS=linux,GUEST_VER=2.6,XEN_VER=3.0,VIRT_BASE=0xC0000000,PAE=no,LOADER=generic' (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) Domain 0 allocation is too small for kernel image. (XEN) **************************************** (XEN) (XEN) Reboot in five seconds...
え?!?!……。(汗)
で、Googleしてみたら
「/boot/grub/grub.confにdom0_mem=xxxxの値を小さくしないと立ち上がらないかも」
なんて記述がやたらと出てくるのでそれを試してみたのですが、
どこにdom0_memを書けばいいのか書いてあるページが無い!!
ってことで、さらに検索しまくるとGento LinuxでXenしようとしているページにありました。
kernel /xen.gzの後にキロバイト単位でDomain 0にアサインしたいメモリー量を書くのが正しいらしい。
ふーむ。
でも、一向に直る気配なし。
(最初は上のブート失敗メッセージすらキャプチャーできなくて、デジカメでCRT撮影してたりしたんですが、dom0_memの後に続けてcom1=115200,8n1とか書くと、シリアルポートにもxenの起動メッセージが出ます。便利。)
で、散々こねくり回したのですが、良く良く見ると、
Xen version 3.0-devel ……
とか書いてあるじゃないですか!!!
タダでさえ怪しいマシンなんだから、もしかしたらXenが正しくメモリーを見つけられないのかも…。なんて思いましたので、yum経由でXenをInstallするのは諦めました。
一応2.0.x使いたいし…。
xen-2.0.7-install-x86_32.tgzからInstall
で、仕方ないので Xen本家からxen-2.0.7-install-x86_32.tgzを取ってきまして、インストールしてみました。
cd /usr/src mkdir xen cd xen wget 〜〜〜〜xen-2.0.7-install-x86_32.tgz <ダウンロード> tar xfz xen-2.0.7-install-x86_32.tgz cd xen-2.0-install ./install.sh
ってなもんで、一気にInstall完了。早い。
あとは、grub.confを手動で追記する。
こんな感じにしました。
title Xen 2.0 / XenLinux 2.6 root (hd0,0) kernel /xen-2.0.gz dom0_mem=131072 com1=115200,8n1 module /vmlinuz-2.6-xen0 root=/dev/VolGroup00/LogVol00 3 ro console=tty0 module /initrd-2.6.12-1.1456_FC4.img
これを一番最初のエントリーの前に追加して、default=0にします。
これで再起動をかけると……。
今度は成功しました!!
ちなみにXenで起動後のdmesgを記す。
Linux version 2.6.11.12-xen0 (xenod@freefall.cl.cam.ac.uk) (gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)) #1 Thu Aug 4 00:45:12 BST 2005 BIOS-provided physical RAM map: Xen: 0000000000000000 - 0000000008000000 (usable) 128MB LOWMEM available. On node 0 totalpages: 32768 DMA zone: 32768 pages, LIFO batch:8 Normal zone: 0 pages, LIFO batch:1 HighMem zone: 0 pages, LIFO batch:1 DMI 2.2 present. IRQ lockup detection disabled Allocating PCI resources starting at 08000000 (gap: 08000000:f8000000) Built 1 zonelists Kernel command line: root=/dev/VolGroup00/LogVol00 3 ro console=tty0 Initializing CPU#0 PID hash table entries: 1024 (order: 10, 16384 bytes) Xen reported: 930.720 MHz processor. Using tsc for high-res timesource Console: colour VGA+ 80x25 Dentry cache hash table entries: 32768 (order: 5, 131072 bytes) Inode-cache hash table entries: 16384 (order: 4, 65536 bytes) vmalloc area: c8800000-fbef9000, maxmem 34000000 Memory: 121344k/131072k available (2979k kernel code, 9628k reserved, 946k data, 324k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay loop... 1854.66 BogoMIPS (lpj=9273344) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) CPU: After generic identify, caps: 0383fbff 00000000 00000000 00000000 00000000 00000000 00000000 CPU: After vendor identify, caps: 0383fbff 00000000 00000000 00000000 00000000 00000000 00000000 CPU: L1 I cache: 16K, L1 D cache: 16K CPU: L2 cache: 256K CPU: After all inits, caps: 0383d3f1 00000000 00000000 00000040 00000000 00000000 00000000 CPU: Intel Pentium III (Coppermine) stepping 06 Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Checking 'hlt' instruction... disabled checking if image is initramfs... it is Freeing initrd memory: 3617k freed NET: Registered protocol family 16 PCI: Using configuration type Xen xen_mem: Initialising balloon driver. SCSI subsystem initialized usbcore: registered new driver hub PCI: Probing PCI hardware PCI: Probing PCI hardware (bus 00) PCI: Via IRQ fixup PCI: Probing PCI hardware (bus 01) PCI: Probing PCI hardware *************************************************************** IA-32 Microcode Update Driver: v1.14-xen <tigran@veritas.com> Initializing Cryptographic API *************************************************************** ** WARNING: Currently emulating unsupported memory accesses ** ** in /lib/tls libraries. The emulation is very ** ** slow. To ensure full performance you should ** ** execute the following as root: ** ** mv /lib/tls /lib/tls.disabled ** *************************************************************** *************************************************************** Continuing... serio: i8042 AUX port at 0x60,0x64 irq 12 serio: i8042 KBD port at 0x60,0x64 irq 1 io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize loop: loaded (max 8 devices) HP CISS Driver (v 2.6.4) Intel(R) PRO/1000 Network Driver - version 5.6.10.1-k2 Copyright (c) 1999-2004 Intel Corporation. pcnet32.c:v1.30i 06.28.2004 tsbogend@alpha.franken.de e100: Intel(R) PRO/100 Network Driver, 3.3.6-k2-NAPI e100: Copyright(c) 1999-2004 Intel Corporation PCI: Obtained IRQ 10 for device 0000:00:08.0 e100: eth0: e100_probe: addr 0xe8020000, irq 10, MAC addr 00:02:B3:33:73:3A 8139too Fast Ethernet driver 0.9.27 PCI: Obtained IRQ 11 for device 0000:00:09.0 eth1: RealTek RTL8139 at 0xec00, 00:30:18:83:68:01, IRQ 11 eth1: Identified 8139 chip type 'RTL-8100B/8139D' Xen virtual console successfully installed as ttyS Event-channel device installed. Initialising Xen netif backend Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx Probing IDE interface ide0... hda: ST313032A, ATA DISK drive Probing IDE interface ide1... hdc: Pioneer DVD-ROM ATAPIModel DVD-105S 011, ATAPI CD/DVD-ROM drive Probing IDE interface ide2... Probing IDE interface ide3... Probing IDE interface ide4... Probing IDE interface ide5... ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 ide1 at 0x170-0x177,0x376 on irq 15 hda: max request size: 128KiB hda: 25434228 sectors (13022 MB) w/512KiB Cache, CHS=25232/16/63 hda: cache flushes not supported hda: hda1 hda2 hdc: ATAPI DVD-ROM drive, 512kB Cache Uniform CD-ROM driver Revision: 3.20 Red Hat/Adaptec aacraid driver (1.1.2-lk2 Aug 4 2005) 3ware Storage Controller device driver for Linux v1.26.02.000. libata version 1.10 loaded. Fusion MPT base driver 3.01.18 Copyright (c) 1999-2004 LSI Logic Corporation Fusion MPT SCSI Host driver 3.01.18 ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI) USB Universal Host Controller Interface driver v2.2 PCI: Obtained IRQ 10 for device 0000:00:07.2 uhci_hcd 0000:00:07.2: UHCI Host Controller uhci_hcd 0000:00:07.2: irq 10, io base 0xd400 uhci_hcd 0000:00:07.2: new USB bus registered, assigned bus number 1 hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected PCI: Obtained IRQ 10 for device 0000:00:07.3 uhci_hcd 0000:00:07.3: UHCI Host Controller uhci_hcd 0000:00:07.3: irq 10, io base 0xd800 uhci_hcd 0000:00:07.3: new USB bus registered, assigned bus number 2 hub 2-0:1.0: USB hub found hub 2-0:1.0: 2 ports detected usbcore: registered new driver usbhid drivers/usb/input/hid-core.c: v2.0:USB HID core driver mice: PS/2 mouse device common for all mice input: AT Translated Set 2 keyboard on isa0060/serio0 input: ImExPS/2 Generic Explorer Mouse on isa0060/serio1 md: raid0 personality registered as nr 2 md: raid1 personality registered as nr 3 md: raid5 personality registered as nr 4 raid5: automatically using best checksumming function: pIII_sse pIII_sse : 1260.800 MB/sec raid5: using function: pIII_sse (1260.800 MB/sec) md: md driver 0.90.1 MAX_MD_DEVS=256, MD_SB_DISKS=27 device-mapper: 4.4.0-ioctl (2005-01-12) initialised: dm-devel@redhat.com NET: Registered protocol family 2 IP: routing cache hash table of 1024 buckets, 8Kbytes TCP established hash table entries: 8192 (order: 4, 65536 bytes) TCP bind hash table entries: 8192 (order: 3, 32768 bytes) TCP: Hash tables configured (established 8192 bind 8192) NET: Registered protocol family 1 NET: Registered protocol family 17 Bridge firewalling registered Freeing unused kernel memory: 324k freed dm_mod: version magic '2.6.12-1.1456_FC4 686 REGPARM 4KSTACKS gcc-4.0' should be '2.6.11.12-xen0 preempt PENTIUM4 gcc-3.3' jbd: version magic '2.6.12-1.1456_FC4 686 REGPARM 4KSTACKS gcc-4.0' should be '2.6.11.12-xen0 preempt PENTIUM4 gcc-3.3' ext3: version magic '2.6.12-1.1456_FC4 686 REGPARM 4KSTACKS gcc-4.0' should be '2.6.11.12-xen0 preempt PENTIUM4 gcc-3.3' dm_mirror: version magic '2.6.12-1.1456_FC4 686 REGPARM 4KSTACKS gcc-4.0' should be '2.6.11.12-xen0 preempt PENTIUM4 gcc-3.3' dm_zero: version magic '2.6.12-1.1456_FC4 686 REGPARM 4KSTACKS gcc-4.0' should be '2.6.11.12-xen0 preempt PENTIUM4 gcc-3.3' dm_snapshot: version magic '2.6.12-1.1456_FC4 686 REGPARM 4KSTACKS gcc-4.0' should be '2.6.11.12-xen0 preempt PENTIUM4 gcc-3.3' cdrom: open failed. kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. md: Autodetecting RAID arrays. md: autorun ... md: ... autorun DONE. cdrom: open failed. cdrom: open failed. EXT3 FS on dm-0, internal journal kjournald starting. Commit interval 5 seconds EXT3 FS on hda1, internal journal EXT3-fs: mounted filesystem with ordered data mode. Adding 524280k swap on /dev/VolGroup00/LogVol01. Priority:-1 extents:1 eth0: link up, 100Mbps, full-duplex, lpa 0x45E1 e100: eth1: e100_watchdog: link up, 100Mbps, full-duplex
また、シリアルコンソールの出力結果は、
__ __ ____ ___ _____ \ \/ /___ _ __ |___ \ / _ \|___ | \ // _ \ '_ \ __) || | | | / / / \ __/ | | | / __/ | |_| | / / /_/\_\___|_| |_| |_____(_)___(_)_/ http://www.cl.cam.ac.uk/netos/xen University of Cambridge Computer Laboratory Xen version 2.0.7 (xenod@cl.cam.ac.uk) (gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)) Thu Aug 4 00:37:06 BST 2005 Latest ChangeSet: Thu Aug 4 00:24:27 2005 973a2d3c7a63c17d318332b65cb3fc5f8d104cd3 (XEN) Physical RAM map: (XEN) 0000000000000000 - 000000000009fc00 (usable) (XEN) 000000000009fc00 - 00000000000a0000 (reserved) (XEN) 00000000000f0000 - 0000000000100000 (reserved) (XEN) 0000000000100000 - 000000001f7f0000 (usable) (XEN) 000000001f7f0000 - 000000001f7f3000 (ACPI NVS) (XEN) 000000001f7f3000 - 000000001f800000 (ACPI data) (XEN) 00000000ffff0000 - 0000000100000000 (reserved) (XEN) System RAM: 503MB (515644kB) (XEN) Xen heap: 10MB (10780kB) (XEN) CPU0: Before vendor init, caps: 0383f9ff 00000000 00000000, vendor = 0 (XEN) CPU caps: 0383f9ff 00000000 00000000 00000000 (XEN) ACPI: RSDP (v000 VIA601 ) @ 0x000f72f0 (XEN) ACPI: RSDT (v001 VIA601 AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x1f7f3000 (XEN) ACPI: FADT (v001 VIA601 AWRDACPI 0x42302e31 AWRD 0x00000000) @ 0x1f7f3040 (XEN) ACPI: DSDT (v001 VIA601 AWRDACPI 0x00001000 MSFT 0x0100000c) @ 0x00000000 (XEN) Using scheduler: Borrowed Virtual Time (bvt) (XEN) Initializing CPU#0 (XEN) Detected 930.701 MHz processor. (XEN) Local APIC disabled by BIOS -- reenabling. (XEN) Found and enabled local APIC! (XEN) CPU0: Before vendor init, caps: 0383fbff 00000000 00000000, vendor = 0 (XEN) CPU caps: 0383fbff 00000000 00000000 00000000 (XEN) CPU0 booted (XEN) SMP motherboard not detected. (XEN) enabled ExtINT on CPU#0 (XEN) ESR value before enabling vector: 00000000 (XEN) ESR value after enabling vector: 00000000 (XEN) Using local APIC timer interrupts. (XEN) Calibrating APIC timer for CPU0... (XEN) ..... CPU speed is 930.6925 MHz. (XEN) ..... Bus speed is 132.9559 MHz. (XEN) ..... bus_scale = 0x00008826 (XEN) Time init: (XEN) .... System Time: 12500380ns (XEN) .... cpu_freq: 00000000:37796148 (XEN) .... scale: 00000001:130FB125 (XEN) .... Wall Clock: 1128194006s 30000us (XEN) PCI: PCI BIOS revision 2.10 entry at 0xfb430, last bus=1 (XEN) PCI: Using configuration type 1 (XEN) PCI: Probing PCI hardware (XEN) PCI: Probing PCI hardware (bus 00) (XEN) PCI: Using IRQ router VIA [1106/0686] at 00:07.0 (XEN) PCI: Disabling Via external APIC routing (XEN) mtrr: v2.0 (20020519) (XEN) *** LOADING DOMAIN 0 *** (XEN) Xen-ELF header found: 'GUEST_OS=linux,GUEST_VER=2.6,XEN_VER=2.0,VIRT_BASE=0xC0000000,LOADER=generic,PT_MODE_WRITABLE' (XEN) PHYSICAL MEMORY ARRANGEMENT: (XEN) Kernel image: 00c00000->010328cc (XEN) Initrd image: 01033000->013bb400 (XEN) Dom0 alloc.: 01400000->09400000 (XEN) VIRTUAL MEMORY ARRANGEMENT: (XEN) Loaded kernel: c0100000->c0560ac4 (XEN) Init. ramdisk: c0561000->c08e9400 (XEN) Phys-Mach map: c08ea000->c090a000 (XEN) Page tables: c090a000->c090e000 (XEN) Start info: c090e000->c090f000 (XEN) Boot stack: c090f000->c0910000 (XEN) TOTAL: c0000000->c0c00000 (XEN) ENTRY ADDRESS: c0100000 (XEN) Scrubbing DOM0 RAM: ..done. (XEN) Initrd len 0x388400, start at 0xc0561000 (XEN) Scrubbing Free RAM: ......done. (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen).
ってな感じでした。
やっぱりさっきのはXen3.0-develでの不具合だったんでしょうか??謎。
あ、あと、
/lib/tlsのエミュレーションは遅いので、/lib/tlsを無効にしてね
みたいな記述があったので、
mv /lib/tls /lib/tls.disabled
して、tlsを無効にしました。
xendの立ち上げ
端末から、
xend start
を打ち込んでしばらくするとカーソルが帰ってきます。
これでxendが立ち上がったようです。
試しに、xm listを打ってドメインの一覧を見てみましょう。
[root@sub ~]# xm list Name Id Mem(MB) CPU State Time(s) Console Domain-0 0 123 0 r---- 126.3
ほうほう。立ち上がっているみたいです。
次のboot時に自動的にxendが立ち上がるようにしておきましょう。
でも、/etc/rc.d/init.dにはxendの起動スクリプトがあるみたいなので、
chkconfig --level 345 xend on
とやっておきました。
[root@sub init.d]# chkconfig --list xend xend 0:off 1:off 2:off 3:on 4:on 5:on 6:off
大丈夫なみたいです。
履歴
2005/10/1 -- 初版
技術的雑談へ戻る