2006年11月2日にNetBSD 3.1(NetBSD/i386 3.1)がリリースされました。
そのNetBSD 3.1はXen 2.0, Xen 3.0, Xen-HVMが利用できるようになっています。
今回はNetBSD/Xenの基礎編として、NetBSD 3.1のXen 2.0.7環境のゲストOS(ゲストドメイン:ドメインU)としてVine Linux 3.1を実行させる手順を紹介します。
※Xen 2.0自体はNetBSD 3.0(2005年12月23日リリース)からサポートされていましたがNetBSD 3.1で一層安定したXen動作になっています。
尚、今回紹介するのは別マシンにインストールされていたVine Linux 3.1のHDDをNetBSD 3.1マシンにスレーブ接続させて利用する方式です。
1.前提条件
前提条件は以下の通りです。
Installation finished. No error reported. This is the contents of the device map /grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install'. (fd0) /dev/rfd0a (hd0) /dev/rwd0d |
system : NetBSD host : netbsd31 release : 3.1 version : NetBSD 3.1 (XEN2_DOM0) #0: Tue Oct 31 04:52:25 UTC 2006 ...以下略 machine : i386 cores : 1 hyperthreads_per_core : 1 cpu_mhz : 2000 memory : 768 free_memory : 247
2.4.30-xen0/ 2.4.30-xenU/ 2.6.11.12-xen0/ 2.6.11.12-xenU/
# -*- mode: python; -*- #============================================================================ # Python configuration setup for 'xm create'. # This script sets the parameters used when a domain is created using 'xm create'. # You use a separate script for each domain you want to create, or # you can set the parameters for the domain on the xm command line. #============================================================================ #---------------------------------------------------------------------------- # Kernel image file. kernel = "/root/vmlinuz-2.6.11.12-xenU" # Optional ramdisk. #ramdisk = "/boot/initrd.gz" # The domain build function. Default is 'linux'. #builder='linux' # Initial memory allocation (in megabytes) for the new domain. memory = 220 # A name for your domain. All domains must have different names. name = "dom1" # Which CPU to start domain on? #cpu = -1 # leave to Xen to pick #---------------------------------------------------------------------------- # Define network interfaces. # Number of network interfaces. Default is 1. nics=1 # Optionally define mac and/or bridge for the network interfaces. # Random MACs are assigned if not given. vif = [ 'mac=00:16:3e:00:00:11, bridge=bridge0' ] #---------------------------------------------------------------------------- # Define the disk devices you want the domain to have access to, and # what you want them accessible as. # Each disk entry is of the form phy:UNAME,DEV,MODE # where UNAME is the device, DEV is the device name the domain will see, # and MODE is r for read-only, w for read-write. disk = [ 'phy:wd1e,hda1,w', 'phy:wd1f,hda2,w' ] #---------------------------------------------------------------------------- # Set the kernel command line for the new domain. # You only need to define the IP parameters and hostname if the domain's # IP config doesn't, e.g. in ifcfg-eth0 or via DHCP. # You can use 'extra' to set the runlevel and custom environment # variables used by custom rc scripts (e.g. VMID=, usr= ). # Set if you want dhcp to allocate the IP address. #dhcp="dhcp" # Set netmask. #netmask= # Set default gateway. #gateway= # Set the hostname. #hostname= "vm%d" % vmid # Set root device. root = "/dev/hda1 ro" # Root device for nfs. #root = "/dev/nfs" # The nfs server. #nfs_server = '169.254.1.0' # Root directory on the nfs server. #nfs_root = '/full/path/to/root/directory' # Sets runlevel 5. extra = "5" #---------------------------------------------------------------------------- # Set according to whether you want the domain restarted when it exits. # The default is 'onreboot', which restarts the domain when it shuts down # with exit code reboot. # Other values are 'always', and 'never'. #restart = 'onreboot' #============================================================================ |
(1)- (2)- (3)- (4)仮想フレームバッファデバイス、日本語入力パッケージ(Anthy,uim,uimアプレット)のインストール (5)VNCサーバの導入と自動起動設定 (6)gdm設定ファイルの変更 (7)- (8)フォントサーバ設定ファイルの変更 (9)日本語入力環境の変更 |
# ps -ax|grep xen 336 ? S 0:00.67 /usr/pkg/bin/python2.4 /usr/pkg/sbin/xend start # xm list Name Id Mem(MB) CPU State Time(s) Console Domain-0 0 500 0 r---- 24.1
d: 832000 0 unused 0 0
kernel = "/root/freebsd53/kernel" memory = 64 name = "freebsd53" vif = [ 'mac=aa:00:00:00:00:11, bridge=bridge0' ] disk = [ 'phy:/dev/vnd0d,vnd0d,w' ] extra = "4" extra = ",vfs.root.mountfrom=ufs:/dev/xbd0a" extra += ",boot_verbose=yes" extra += ",boot_gdb=yes" |