免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2437 | 回复: 1
打印 上一主题 下一主题

[NetBSD] 关于NETBSD下搭建domU ( [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-06-28 11:24 |只看该作者 |倒序浏览
dom0搭建成功,可是dom始终不成功,用xm console xx始终没有反应,看不到新搭建的domU的控制台,不知道怎么回事。

下面是我的搭建过程。

1.下载:xen kernal 和xentool

pkg_add -v xenkernel41
pkg_add -v xentools41
pkg_add -v e2fsprogs


2.添加自动启动
# vi /etc/rc.conf
添加以下三行到最后
xend=yes
xenbackendd=yes
xendomains=yes

3.把上面安装的 Xen Hypervisor (xen.gz) 拷贝到根目录下 /:

# cp /usr/pkg/xen3-kernel/xen.gz /

4.下载你dom0 kernal 并解压

# cd /
# wget http://ftp.us.netbsd.org/pub/NetBSD/NetBSD-5.1.2/amd64/ \
binary/kernel/netbsd-XEN3_DOM0.gz
# gunzip netbsd-XEN3_DOM0.gz


5.配置 NetBSD 开机引导

# vi /boot.cfg
...
menu=NetBSD/XEN:load /netbsd-XEN3_DOM0;multiboot /xen.gz dom0_mem=64M
installboot -v -o timeout=5 /dev/rwd0a /usr/mdec/bootxx_ffsv1


6.重启系统,并选择NetBSD/XEN,进入系统个,运行xm list,显示如下,dom0安装成功

netbsd-2# xm list
Name                                        ID   Mem VCPUs      State   Time(s)
Domain-0                                     0    64     1     r-----      9.6

论坛徽章:
0
2 [报告]
发表于 2012-06-28 11:25 |只看该作者
6.开始搭建domU, 创建domU配置文件,/usr/pkg/etc/xen/nbsd
内容如下:
#  -*- mode: python; -*-
#============================================================================
# Python defaults setup for 'xm create'.
# Edit this file to reflect the configuration of your system.
#============================================================================

#----------------------------------------------------------------------------
# Kernel image file. This kernel will be loaded in the new domain.
kernel = "/home/bouyer/netbsd-XEN3_DOMU"
#kernel = "/home/bouyer/netbsd-INSTALL_XEN3_DOMU"

# Memory allocation (in megabytes) for the new domain.
memory = 64

# A handy name for your new domain. This will appear in 'xm list',
# and you can use this as parameters for xm in place of the domain
# number. All domains must have different names.
#
name = "nbsd"

# The number of virtual CPUs this domain has.
#
vcpus = 1

#----------------------------------------------------------------------------
# Define network interfaces for the new domain.

# Number of network interfaces (must be at least 1). Default is 1.
nics = 1

# Define MAC and/or bridge for the network interfaces.
#
# The MAC address specified in ``mac'' is the one used for the interface
# in the new domain. The interface in domain0 will use this address XOR'd
# with 00:00:00:01:00:00 (i.e. aa:00:00:51:02:f0 in our example). Random
# MACs are assigned if not given.
#
# ``bridge'' is a required parameter, which will be passed to the
# vif-script called by xend( when a new domain is created to configure
# the new xvif interface in domain0.
#
# In this example, the xvif is added to bridge0, which should have been
# set up prior to the new domain being created -- either in the
# ``network'' script or using a /etc/ifconfig.bridge0 file.
#
vif = [ 'mac=aa:00:00:50:02:f0, 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:
#
#        phyEV,VDEV,MODE
#
# where DEV is the device, VDEV is the device name the domain will see,
# and MODE is r for read-only, w for read-write.  You can also create
# file-backed domains using disk entries of the form:
#
#        fileATH,VDEV,MODE
#
# where PATH is the path to the file used as the virtual disk, and VDEV
# and MODE have the same meaning as for ``phy'' devices.
#
# VDEV doesn't really matter for a NetBSD guest OS (it's just used as an index),
# but it does for Linux.
# Worse, the device has to exist in /dev/ of domain0, because xm will
# try to stat() it. This means that in order to load a Linux guest OS
# from a NetBSD domain0, you'll have to create /dev/hda1, /dev/hda2, ...
# on domain0, with the major/minor from Linux
# Alternatively it's possible to specify the device number in hex,
# e.g. 0x301 for /dev/hda1, 0x302 for /dev/hda2, etc ...

disk = [ 'phy:/dev/wd0e,0x1,w' ]
#disk = [ 'file:/var/xen/nbsd-disk,0x01,w' ]
#disk = [ 'file:/var/xen/nbsd-disk,0x301,w' ]

#----------------------------------------------------------------------------
# Set the kernel command line for the new domain.

# Set root device. This one does matter for NetBSD
root = "xbd0"
# extra parameters passed to the kernel
# this is where you can set boot flags like -s, -a, etc ...
#extra = ""

#----------------------------------------------------------------------------
# Set according to whether you want the domain restarted when it exits.
# The default is False.
#autorestart = True

# end of nbsd config file ====================================================

7.创建domU   命令:xm create -c /usr/pkg/etc/xen/nbsd。
输出如下:

netbsd-2# xm create -c /usr/pkg/etc/xen/nbsd
Using config file "/usr/pkg/etc/xen/nbsd".
Warning: The nics option is deprecated.  Please use an empty vif entry instead:

  vif = [ '' ]

Started domain nbsd (id=1)
                          Loaded initial symtab at 0xffffffff80b47484, strtab at 0xffffffff80b94ca8, # entries 13136
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 5.1.2 (INSTALL_XEN3_DOMU) #0: Thu Feb  2 12:08:23 UTC 2012
        builds@b7.netbsd.org:/home/builds/ab/netbsd-5-1-2-RELEASE/amd64/201202021012Z-obj/home/builds/ab/netbsd-5-1-2-RELEASE/src/sys/arch/amd64/compile/INSTALL_XEN3_DOMU
total memory = 65536 KB
avail memory = 50772 KB
mainbus0 (root)
hypervisor0 at mainbus0: Xen version 4.1
vcpu0 at hypervisor0: Intel 686-class, 2825MHz, id 0x1067a
xenbus0 at hypervisor0: Xen Virtual Bus Interface
xencons0 at hypervisor0: Xen Virtual Console Driver
xencons0: using event channel 2
xbd0 at xenbus0 id 1: Xen Virtual Block Device Interface
xennet0 at xenbus0 id 0: Xen Virtual Network Interface
xennet0: MAC address aa:00:00:50:02:f0

然后不动了?怎么搞的啊?  键盘输入没反应,这是不是表示DomU创建成功了? 然后怎么才能安装操作系统呢?我想在domU上安装个netBSD,怎么安装,怎么进入DomU的 控制台?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP