2012年5月16日水曜日

Arch LinuxのXenでxlコマンドが利用できない件

ノートPC(X121e)にArchLinuxを入れてXen DOM0で遊んでいるのだが、xlコマンドがうまく動作せず、 Xen4.1の時点ではdeprecatedなxmコマンドをずっと使っていた。しかし乗り換えない訳にもいかないので 原因を探ってみた。

xenstored起動スクリプトの修正

まず一つ目の、xenstoredが起動しているにも関わらずxenstoredが動いてない(?)と怒られる問題。 単純にpidファイルのパスがArchとXenとで合っていなかっただけだった。 /etc/rc.d/xencommonsのxenstored起動部分を書き換えるだけでOK。

# xenstored --pid-file=/run/daemons/xenstored.pid $XENSTORED_ARGS
xenstored --pid-file=/var/run/xenstored.pid $XENSTORED_ARGS

停止時も考慮しないといけないよなぁ、と思ってdo_stop()を見てみたが、

printhl "WARNING: Not stopping xenstored, as it cannot be restarted."

そいつは一度起動したら止められないぜ!…ということらしい。

xl consoleの不具合

xlコマンドは実行できるようになったものの、何故かxl consoleで consoleに入れない。エラー内容も「失敗した」と出るだけ。 仕方がないのでstraceしてみたら…

execve("/usr/lib64/xen/bin/xenconsole", ["/usr/lib64/xen/bin/xenconsole", "4", "--num", "0", "--type", "pv"],
 [/* 15 vars */]) = -1 ENOENT (No such file or directory)

/usr/lib64ってなんですかー。 どうやら、xenconsoleバイナリの参照先が/usr/lib64決め打ちになっている模様。どこのディストリの名残りなのやら…。 とりあえずln -s /usr/lib /usr/lib64してあっさり解決。

miku@hachune% sudo xl create -c netbsd.cfg
パスワード:
Parsing config file netbsd.cfg
xc: error: panic: xc_dom_bzimageloader.c:556: xc_dom_probe_bzimage_kernel: kernel is not a
 bzImage: Invalid kernel
Daemon running with PID 6683
                            Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 
2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 6.0_BETA (HACHUNE_U) #0: Thu Apr 26 19:16:15 JST 2012
        miku@hachune.hachune.net:/tmp/netbsd/sys/arch/amd64/compile/HACHUNE_U
total memory = 512 MB
avail memory = 486 MB
mainbus0 (root)
hypervisor0 at mainbus0: Xen version 4.1.2
vcpu0 at hypervisor0: AMD E-450 APU with Radeon(tm) HD Graphics, id 0x500f20
xenbus0 at hypervisor0: Xen Virtual Bus Interface
xencons0 at hypervisor0: Xen Virtual Console Driver
xenbus: can't get state for device/suspend/event-channel (2)
xbd0 at xenbus0 id 0: Xen Virtual Block Device Interface
xennet0 at xenbus0 id 0: Xen Virtual Network Interface
xennet0: MAC address 00:16:3e:39:03:10
balloon0 at xenbus0 id 0: Xen Balloon driver
balloon0: current reservation: 524288 KiB
xennet0: using RX copy mode
xenbus: can't get state for device/suspend/event-channel (2)
balloon0: current reservation: 131072 pages => target: 131072 pages
ignore shutdown request: 
xenbus: can't get state for device/suspend/event-channel (2)
xenbus: can't get state for device/suspend/event-channel (2)
xenbus: can't get state for device/suspend/event-channel (2)
xenbus: can't get state for device/suspend/event-channel (2)
xenbus: can't get state for device/suspend/event-channel (2)
xenbus: can't get state for device/suspend/event-channel (2)
xenbus: can't get state for device/suspend/event-channel (2)
xenbus: can't get state for device/suspend/event-channel (2)
boot device: xbd0
root on xbd0a dumps on xbd0b
root file system type: ffs
Wed May 16 09:56:39 JST 2012
Starting root file system check:
/dev/rxbd0a: file system is clean; not checking
Starting file system checks:
Setting tty flags.
Setting sysctl variables:
ddb.onpanic: 1 -> 0
Starting network.
Hostname: netbsd.hachune.net
IPv6 mode: host
Configuring network interfaces: xennet0add net default: gateway 10.39.3.1
.
Adding interface aliases:.
Building databases: dev, utmp, utmpx.
Starting syslogd.
Mounting all filesystems...
Clearing temporary files.
Updating fontconfig cache: done.
Checking quotas: done.
Starting virecover.
Checking for core dump...
savecore: /dev/rxbd0b: Device not configured
May 16 09:56:46 netbsd savecore: /dev/rxbd0b: Device not configured
Starting local daemons:.
Updating motd.
Starting powerd.
Starting sshd.
Starting inetd.
Starting cron.
Wed May 16 09:56:53 JST 2012

NetBSD/amd64 (netbsd.hachune.net) (console)

login: miku
Password:
May 16 10:23:51 netbsd login: miku on tty console
Last login: Tue Apr 24 03:50:07 2012 on console
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 6.0_BETA (HACHUNE_U) #0: Thu Apr 26 19:16:15 JST 2012

Welcome to NetBSD!

This system is running a beta release of the NetBSD operating system, aimed
at stabilizing the next formal release.  It is close to formal release quality,
but may still contain bugs, even serious ones.  Please bear this in mind and
use the system with care.

You are encouraged to test this version as thoroughly as possible.  Should you
encounter any problem, please report it back to the development team using the
send-pr(1) utility (requires a working MTA).  If yours is not properly set up,
use the web interface at: http://www.NetBSD.org/support/send-pr.html

Thank you for helping us test and improve this beta NetBSD release.

netbsd$

DOMUがNetBSDだからかInvalid kernelとか出ていたり、いろいろとエラーメッセージが出ているが、 とりあえず動いているので気にしないことにする。

Xen Documentation
http://xen.org/support/generated.html

0 件のコメント:

コメントを投稿