📄 xen v3_0 用户手册.htm
字号:
style="COLOR: rgb(51,51,255)">(通过源码包安装)</SPAN></A> </H1>
<P>This section describes how to obtain, build and install Xen from source.
<BR><SPAN style="COLOR: rgb(51,51,255)">这一节主要介绍如何获取源码包并进行编译和安装;</SPAN></P>
<H2><A name=SECTION02141000000000000000>2.4.1 Obtaining the Source<SPAN
style="COLOR: rgb(51,51,255)">(获取源码包)</SPAN></A> </H2>
<P>The Xen source tree is available as either a compressed source tarball or as
a clone of our master Mercurial repository. </P>
<DL>
<DT><STRONG>Obtaining the Source Tarball<SPAN
style="COLOR: rgb(51,51,255)">(获取源码包)</SPAN><BR
style="COLOR: rgb(51,51,255)"></STRONG>
<DD><BR>Stable versions and daily snapshots of the Xen source tree are
available from the Xen download page:
<DT> <SPAN
style="COLOR: rgb(51,51,255)">稳定版和开发版的每日快照下载页: </SPAN><BR></DT></DL>
<DL>
<DD>
<BLOCKQUOTE><TT><TT>http://www.xensource.com/downloads/</TT></TT>
</BLOCKQUOTE>
<DT><STRONG>Obtaining the source via Mercurial<SPAN
style="COLOR: rgb(51,51,255)">(通过</SPAN></STRONG><STRONG
style="COLOR: rgb(51,51,255)">Mercurial获取源代码)</STRONG>
<DD><BR>The source tree may also be obtained via the public Mercurial
repository at:<SPAN style="COLOR: rgb(255,0,0)"></SPAN>
<DD><SPAN style="COLOR: rgb(51,51,255)">可以使用公共 Mercurial库从以下地址获取代码树:</SPAN>
<BLOCKQUOTE><TT>http://xenbits.xensource.com</TT> </BLOCKQUOTE>See the
instructions and the Getting Started Guide referenced at<SPAN
style="COLOR: rgb(51,51,255)">(获取介绍和指导手册)</SPAN>:
<BLOCKQUOTE><TT>http://www.xensource.com/downloads/</TT> </BLOCKQUOTE></DD></DL>
<P></P>
<H2><A name=SECTION02142000000000000000>2.4.2 Building from Source<SPAN
style="COLOR: rgb(51,51,255)">(从源码包编译安装)</SPAN></A> </H2>
<P>The top-level Xen Makefile includes a target ``world'' that will do the
following: </P>
<UL>
<LI>Build Xen
<LI><SPAN style="COLOR: rgb(51,51,255)">编译Xen</SPAN>
<LI>Build the control tools, including xend
<LI><SPAN style="COLOR: rgb(51,51,255)">编译控制工具,包括xend</SPAN>
<LI>Download (if necessary) and unpack the Linux 2.6 source code, and patch it
for use with Xen.
<LI><SPAN style="COLOR: rgb(51,51,255)">下载Linux 2.6内核源码,并且为内核打补丁</SPAN><BR>
<LI>Build a Linux kernel to use in domain 0 and a smaller unprivileged
kernel, which can be used for unprivileged virtual machines.
<LI><SPAN style="COLOR: rgb(51,51,255)">编译一个 Linux的内核,主要是用于domain 0
,并且是一个比较小的无特权的内核。它能用于无特权的虚拟机;</SPAN><BR></LI></UL>
<P>After the build has completed you should have a top-level directory called
<TT>dist/</TT> in which all resulting targets will be placed. Of particular
interest are the two XenLinux kernel images, one with a ``-xen0'' extension
which contains hardware device drivers and drivers for Xen's virtual devices,
and one with a ``-xenU'' extension that just contains the virtual ones. These
are found in <TT>dist/install/boot/</TT> along with the image for Xen itself and
the configuration files used during the build.<BR></P>
<P><SPAN
style="COLOR: rgb(51,51,255)">内核编译完成后,您应该有一个顶级目录dist/,所有的编译好的包将放在这里。总共有两个内核,一个是文件名带有"_xen0"的,它包括硬件设备驱动和Xen虚拟设备。另一个内核文件扩展名带有"_xenU"的,这个内核包括虚拟设备。这些文件连同Xen本身及编译过程中所需要的配置文件位于
dist/install/boot目录中</SPAN><BR></P>
<P>To customize the set of kernels built you need to edit the top-level
Makefile. Look for the line:<BR></P><SPAN
style="COLOR: rgb(51,51,255)">为了自定义内核配置,您需要编辑顶级目录的 Makefile 。看起来象下面的一行;</SPAN> <PRE>KERNELS ?= linux-2.6-xen0 linux-2.6-xenU<BR></PRE>
<P>You can edit this line to include any set of operating system kernels which
have configurations in the top-level <TT>buildconfigs/</TT> directory.<BR><SPAN
style="COLOR: rgb(51,51,255)">您可以把这行加入到操作系统本身拥有的内核配置文件中,此文件位于 buildconfigs<SPAN
style="COLOR: rgb(255,0,0)">/</SPAN>目录;</SPAN><BR></P>
<H2><A name=SECTION02143000000000000000>2.4.3 Custom Kernels自义义内核</A> </H2>
<P>If you wish to build a customized XenLinux kernel (e.g. to support additional
devices or enable distribution-required features), you can use the standard
Linux configuration mechanisms, specifying that the architecture being built for
is <TT>xen</TT>, e.g:<BR><SPAN style="COLOR: rgb(51,51,255)">如果您想自定义编译XenLinuxmw
内核(比如支持附加设备或打开发行版的一些特性或功能),您可以用标准的Linux内核配置文件</SPAN><BR></P><PRE># cd linux-2.6.12-xen0<BR># make ARCH=xen xconfig<BR># cd ..<BR># make<BR></PRE>
<P>You can also copy an existing Linux configuration (<TT>.config</TT>) into
e.g. <TT>linux-2.6.12-xen0</TT> and execute:<BR><SPAN
style="COLOR: rgb(51,51,255)">您也可以复制已有的Linux发行版的内核配置文件。比如Linux-
2.6.12-xen0,然后执行:</SPAN><BR style="COLOR: rgb(51,51,255)"></P><PRE># make ARCH=xen oldconfig<BR></PRE>
<P>You may be prompted with some Xen-specific options. We advise accepting the
defaults for these options.<BR><SPAN
style="COLOR: rgb(51,51,255)">也可以启用一些Xen的特殊选项。我们建议您用默认的选项。</SPAN><BR></P>
<P>Note that the only difference between the two types of Linux kernels that are
built is the configuration file used for each. The ``U'' suffixed (unprivileged)
versions don't contain any of the physical hardware device drivers, leading to a
30% reduction in size; hence you may prefer these for your non-privileged
domains. The ``0'' suffixed privileged versions can be used to boot the system,
as well as in driver domains and unprivileged domains.<BR></P>
<P><SPAN
style="COLOR: rgb(51,51,255)">注意,编译出来的两个内核是不同的。文件名中带有U的,是无特权内核,这个是用来引导被虚拟的操作系统而用的,它不包括物理硬件的驱动等。而文件名中带有0的包括物理硬件的驱动,它才是被用于引导真实操作系统的内核。 </SPAN><BR></P>
<H2><A name=SECTION02144000000000000000>2.4.4 Installing Generated
Binaries <SPAN style="COLOR: rgb(51,51,255)">(安装已经编译好的二进制内核)</SPAN></A> </H2>
<P>The files produced by the build process are stored under the
<TT>dist/install/</TT> directory. To install them in their default locations,
do:<BR><SPAN style="COLOR: rgb(51,51,255)">当编译好内核后,他们被存放在
dist/install/目录中。我们通过如下的命令来安装:</SPAN><BR></P><PRE># make install<BR></PRE>
<P>Alternatively, users with special installation requirements may wish to
install them manually by copying the files to their appropriate
destinations.<BR></P><SPAN
style="COLOR: rgb(51,51,255)">用户可以根据自己的需要做以手动复制到相应的目录,这一过程是可选的。</SPAN>
<P>The <TT>dist/install/boot</TT> directory will also contain the config files
used for building the XenLinux kernels, and also versions of Xen and XenLinux
kernels that contain debug symbols such as (<TT>xen-syms-3.0.0</TT> and
<TT>vmlinux-syms-2.6.12.6-xen0</TT>) which are essential for interpreting crash
dumps. Retain these files as the developers may wish to see them if you post on
the mailing list.</P>
<P><SPAN style="COLOR: rgb(51,51,255)">在目录 /dist/install/boot目录中,包<SPAN
style="COLOR: rgb(51,51,255)">含</SPAN>编译 XenLinux内核的配置文件config
,也包含XenLinux内核的debug链接文件,比如(</SPAN><TT
style="COLOR: rgb(51,51,255)">xen-syms-3.0.0</TT><SPAN
style="COLOR: rgb(51,51,255)"> 和</SPAN><TT
style="COLOR: rgb(51,51,255)">vmlinux-syms-2.6.12.6 -xen0)</TT><SPAN
style="COLOR: rgb(51,51,255)">,当系统崩溃时,他们还是有必要的,因为做为开发者,他们需要这些崩溃纪录,您可以<SPAN
style="COLOR: rgb(255,0,0)">通过</SPAN>邮件列表发送给开发者。</SPAN> </P>
<H1><A name=SECTION02150000000000000000></A><A name=s:configure></A><BR>2.5
Configuration<SPAN style="COLOR: rgb(51,51,255)">(配置)</SPAN> </H1>
<P>Once you have built and installed the Xen distribution, it is simple to
prepare the machine for booting and running Xen.<BR><SPAN
style="COLOR: rgb(51,51,255)">如果您编译并安装好了Xen的发行版,您要做一些准备工作,以让机器引导时运行Xen。</SPAN><BR></P>
<H2><A name=SECTION02151000000000000000>2.5.1 GRUB Configuration<SPAN
style="COLOR: rgb(51,51,255)">(GRUB的配置)</SPAN></A> </H2>
<P>An entry should be added to <TT>grub.conf</TT> (often found under
<TT>/boot/</TT> or <TT>/boot/grub/</TT>) to allow Xen / XenLinux to boot. This
file is sometimes called <TT>menu.lst</TT>, depending on your distribution. The
entry should look something like the following:</P>
<P><SPAN
style="COLOR: rgb(51,51,255)">编译好内核后,您应该修改grub.conf文件(这个文件大多是位于/boot或/boot/grub目录中),目的是允许</SPAN><SPAN
style="COLOR: rgb(255,0,0)">引导 </SPAN><SPAN
style="COLOR: rgb(51,51,255)">Xen/XenLinux。 grub.conf有时也被称为menul.st
。在grub.conf或menu.lst中应该加入类似下面的一段:</SPAN><BR></P><PRE>title Xen 3.0 / XenLinux 2.6<BR> kernel /boot/xen-3.0.gz dom0_mem=262144<BR> module /boot/vmlinuz-2.6-xen0 root=/dev/sda4 ro console=tty0<BR></PRE>
<P>The kernel line tells GRUB where to find Xen itself and what boot parameters
should be passed to it (in this case, setting the domain 0 memory
allocation in kilobytes and the settings for the serial port). For more details
on the various Xen boot parameters see Section <A
href="http://www.linuxsir.org/main/doc/Xen3man/user.html#s:xboot">10.3</A>. </P>
<P><SPAN style="COLOR: rgb(51,51,255)"><SPAN
style="COLOR: rgb(51,51,255)">kernel
一行告诉GRUB引导时能找到Xen,以及使用哪些引导参数</SPAN>(在这里,能设置domain
0所占用物理内存大小,其单位是kb,也能设置所占用的串口)。详细请参阅Xen 引导参数章节 </SPAN><A
style="COLOR: rgb(51,51,255)"
href="http://www.linuxsir.org/main/doc/Xen3man/user.html#s:xboot">10.3</A><SPAN
style="COLOR: rgb(51,51,255)"> 。</SPAN><BR></P>
<P>The module line of the configuration describes the location of the XenLinux
kernel that Xen should start and the parameters that should be passed to it.
These are standard Linux parameters, identifying the root device and specifying
it be initially mounted read only and instructing that console output be sent to
the screen. Some distributions such as SuSE do not require the <TT>ro</TT>
parameter. </P>
<P><SPAN style="COLOR: rgb(51,51,255)">module
这行是描述XenLinux内核所处的位置,这些是Linux的标准参数,比如定义root设备,指定挂载时初始化是只读,并且将控制台输出发送到屏幕上。一些发行版并不需要
ro参数,比如SuSE。</SPAN><BR>To use an initrd, add another <TT>module</TT> line to the
configuration, like:<BR><SPAN
style="COLOR: rgb(51,51,255)">要使用initrd,还需要在配置文件中添加一 module行,行如:</SPAN><BR
style="COLOR: rgb(255,0,0)"></P><PRE> module /boot/my_initrd.gz<BR></PRE>
<P>When installing a new kernel, it is recommended that you do not delete
existing menu options from <TT>menu.lst</TT>, as you may wish to boot your old
Linux kernel in future, particularly if you have problems.<BR></P>
<P style="COLOR: rgb(51,51,255)"><SPAN
style="COLOR: rgb(51,51,255)">安装新的内核时,我们建议您不要删除GRUB启动菜单定义文件
grub.conf或menu.lst中的关于老内核的引导项,当用新内核引导时可能遇到问题,或者需要老内核引导时,您可以用老内核启动系统。</SPAN><BR></P>
<H2><A name=SECTION02152000000000000000>2.5.2 Serial Console
(optional)(串口控制台.可选)</A> </H2>
<P>Serial console access allows you to manage, monitor, and interact with your
system over a serial console. This can allow access from another nearby system
via a null-modem (``LapLink'') cable or remotely via a serial
concentrator.<BR><SPAN style="COLOR: rgb(51,51,255)">串口控制台允许您管理、监视,
和和您的系统相互通信通过一个串口控制台。它能提供从别的附近的系统通过一个null- modem("LapLink") cable
或经由远程串口集线器访问登录。</SPAN><BR></P>
<P>You system's BIOS, bootloader (GRUB), Xen, Linux, and login access must each
be individually configured for serial console access. It is <I>not</I> strictly
necessary to have each component fully functional, but it can be quite
useful.<BR><SPAN style="COLOR: rgb(51,51,255)">您系统的BIOS,系统引导管理器(GRUB),Xen,
Linux,以及登录许可必须单独分别为串口控制台登录提供有效的配置。它没有必要完全拥有所有的功能和部件,但它的确是比较有用的。</SPAN><BR></P>
<P><BR></P>
<P>For general information on serial console configuration under Linux, refer to
the ``Remote Serial Console HOWTO'' at The Linux Documentation Project: <A
href="http://www.tldp.org/" name=tex2html5>http://www.tldp.org/</A><BR><SPAN
style="COLOR: rgb(51,51,255)">对于在Linux中,关于串口控制台配置的一般信息,请参考“Remote Serial Console
HOWTO",此文件计划位于</SPAN><A style="COLOR: rgb(51,51,255)"
href="http://www.tldp.org/" name=tex2html5>http://www.tldp.org/</A> </P>
<H3><A name=SECTION02152100000000000000>2.5.2.1 Serial Console BIOS
configuration<SPAN style="COLOR: rgb(51,51,255)">(串口控制台 BIOS的配置)</SPAN></A>
</H3>
<P>Enabling system serial console output neither enables nor disables serial
capabilities in GRUB, Xen, or Linux, but may make remote management of your
system more convenient by displaying POST and other boot messages over serial
port and allowing remote BIOS configuration. </P>
<P>Refer to your hardware vendor's documentation for capabilities and procedures
to enable BIOS serial redirection. </P>
<H3><A name=SECTION02152200000000000000>2.5.2.2 Serial Console GRUB
configuration<SPAN style="COLOR: rgb(51,51,255)">(串口控制台 GRUB的配置)</SPAN></A>
</H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -