📄 xen v3_0 用户手册.htm
字号:
<P>Enabling GRUB serial console output neither enables nor disables Xen or Linux
serial capabilities, but may made remote management of your system more
convenient by displaying GRUB prompts, menus, and actions over serial port and
allowing remote GRUB management. </P>
<P>Adding the following two lines to your GRUB configuration file, typically
either <TT>/boot/grub/menu.lst</TT> or <TT>/boot/grub/grub.conf</TT> depending
on your distro, will enable GRUB serial output. </P><PRE> serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1<BR> terminal --timeout=10 serial console<BR></PRE>
<P>Note that when both the serial port and the local monitor and keyboard are
enabled, the text ``<I>Press any key to continue</I>'' will appear at both.
Pressing a key on one device will cause GRUB to display to that device. The
other device will see no output. If no key is pressed before the timeout period
expires, the system will boot to the default GRUB boot entry. </P>
<P>Please refer to the GRUB documentation for further information. </P>
<H3><A name=SECTION02152300000000000000>2.5.2.3 Serial Console Xen
configuration<SPAN style="COLOR: rgb(51,51,255)">(串口控制台 Xen的配置)</SPAN></A> </H3>
<P>Enabling Xen serial console output neither enables nor disables Linux kernel
output or logging in to Linux over serial port. It does however allow you to
monitor and log the Xen boot process via serial console and can be very useful
in debugging. </P>
<P>In order to configure Xen serial console output, it is necessary to add a
boot option to your GRUB config; e.g. replace the previous example kernel line
with: </P><PRE> kernel /boot/xen.gz dom0_mem=131072 com1=115200,8n1<BR></PRE>
<P>This configures Xen to output on COM1 at 115,200 baud, 8 data bits, no parity
and 1 stop bit. Modify these parameters for your environment. See
Section <A
href="http://www.linuxsir.org/main/doc/Xen3man/user.html#s:xboot">10.3</A> for
an explanation of all boot parameters. </P>
<P>One can also configure XenLinux to share the serial console; to achieve this
append ``<TT>console=ttyS0</TT>'' to your module line. </P>
<H3><A name=SECTION02152400000000000000>2.5.2.4 Serial Console Linux
configuration<SPAN style="COLOR: rgb(51,51,255)">(串口控制台 Linux的配置)</SPAN></A>
</H3>
<P>Enabling Linux serial console output at boot neither enables nor disables
logging in to Linux over serial port. It does however allow you to monitor and
log the Linux boot process via serial console and can be very useful in
debugging. </P>
<P>To enable Linux output at boot time, add the parameter <TT>console=ttyS0</TT>
(or ttyS1, ttyS2, etc.) to your kernel GRUB line. Under Xen, this might be: </P><PRE> module /vmlinuz-2.6-xen0 ro root=/dev/VolGroup00/LogVol00 \<BR> console=ttyS0, 115200<BR></PRE>to
enable output over ttyS0 at 115200 baud.
<H3><A name=SECTION02152500000000000000>2.5.2.5 Serial Console Login
configuration<SPAN style="COLOR: rgb(51,51,255)">(串口控制台登录配置)</SPAN></A> </H3>
<P>Logging in to Linux via serial console, under Xen or otherwise, requires
specifying a login prompt be started on the serial port. To permit root logins
over serial console, the serial port must be added to <TT>/etc/securetty</TT>.
</P>
<P>To automatically start a login prompt over the serial port, add the line:
</P>
<BLOCKQUOTE><FONT size=-1><TT>c:2345:respawn:/sbin/mingetty ttyS0</TT></FONT>
</BLOCKQUOTE>to <TT>/etc/inittab</TT>. Run <TT>init q</TT> to force a reload of
your inttab and start getty.
<P>To enable root logins, add <TT>ttyS0</TT> to <TT>/etc/securetty</TT> if not
already present. </P>
<P>Your distribution may use an alternate getty; options include getty, mgetty
and agetty. Consult your distribution's documentation for further information.
</P>
<H2><A name=SECTION02153000000000000000>2.5.3 TLS Libraries <SPAN
style="COLOR: rgb(51,51,255)">(TLS库)</SPAN></A> </H2>
<P>Users of the XenLinux 2.6 kernel should disable Thread Local Storage (TLS)
(e.g. by doing a <TT>mv /lib/tls /lib/tls.disabled</TT>) before attempting to
boot a XenLinux kernel<A
href="http://www.linuxsir.org/main/doc/Xen3man/#foot743"
name=tex2html6><SUP>2.4</SUP></A>. You can always reenable TLS by restoring the
directory to its original location (i.e. <TT>mv /lib/tls.disabled
/lib/tls</TT>). <SPAN style="COLOR: rgb(255,0,0)"><BR><SPAN
style="COLOR: rgb(51,51,255)">如果您使用 XenLinux 2.6 内核,在用它引导前需要禁用掉 Thread
Local Storage (TLS)</SPAN></SPAN><FONT style="COLOR: rgb(51,51,255)"
size=-1>(线程局部存储)(例如运行 </FONT><TT style="COLOR: rgb(51,51,255)">/lib/tls
/lib/tls.disabled). 当需要TLS时, 可以通过恢复其目录重新启用(即 </TT><TT
style="COLOR: rgb(51,51,255)">mv /lib/tls.disabled /lib/tls</TT><SPAN
style="COLOR: rgb(51,51,255)">).</SPAN> </P>
<P>The reason for this is that the current TLS implementation uses segmentation
in a way that is not permissible under Xen. If TLS is not disabled, an emulation
mode is used within Xen which reduces performance substantially. To ensure full
performance you should install a `Xen-friendly' (nosegneg) version of the
library. <SPAN style="COLOR: rgb(255,0,0)"><BR><SPAN
style="COLOR: rgb(51,51,255)">这是由于当前的TLS应用程序使用了在Xen下不允许的段方法. 如果禁用TLS,
Xen中使用的一个仿真模式将会实际性能有所削弱. 如果要避免这种现象, 您需要安装一个`Xen-friendly'(nosegneg)
版的共享库.</SPAN></SPAN> </P>
<H1><A name=SECTION02160000000000000000>2.6 Booting Xen<SPAN
style="COLOR: rgb(51,51,255)">(引导Xen)</SPAN></A> </H1>
<P>It should now be possible to restart the system and use Xen. Reboot and
choose the new Xen option when the Grub screen appears.<BR><SPAN
style="COLOR: rgb(51,51,255)"><SPAN style="COLOR: rgb(51,51,255)">现在可以使用 Xen
重新引导操作系统了.
(</SPAN>因为我们前面已经谈了编译、安装Xen,译注),重新启动后,我们要在GRUB的启动菜单上选择带有Xen支持的选择,这样我就可以启动有Xen支持的操作系统了。</SPAN><BR></P>
<P>What follows should look much like a conventional Linux boot. The first
portion of the output comes from Xen itself, supplying low level information
about itself and the underlying hardware. The last portion of the output comes
from XenLinux.<BR><SPAN style="COLOR: rgb(51,51,255)">用支持Xen的内核启动,看起来有点象
Linux常规引导。第一部份输出的是Xen本身的信息,这些信息是关于Xen自身和底层的硬件的信息。最后的输出是来自于XenLinux。</SPAN><BR></P>
<P>You may see some error messages during the XenLinux boot. These are not
necessarily anything to worry about--they may result from kernel configuration
differences between your XenLinux kernel and the one you usually use.<BR></P>
<P
style="COLOR: rgb(51,51,255)">当XenLinux引导时,您能查看一些错误的信息。对于这些信息没有必要为他们担心,这是因为您的XenLinux和您原来用的没有带有Xen支持的那个之间不同配置而引起的。<BR></P>
<P>When the boot completes, you should be able to log into your system as usual.
If you are unable to log in, you should still be able to reboot with your normal
Linux kernel by selecting it at the GRUB prompt.<BR></P>
<P style="COLOR: rgb(51,51,255)"><SPAN
style="COLOR: rgb(51,51,255)">当引导完成后,您应该可以登录您的操作系统了。如果不能登录,应该用您的普通内核(也就是原来没有Xen的那个内核--译者注)来引导。然后进行一些问题排查。</SPAN><BR></P>
<H1><A name=SECTION02200000000000000000>3. Booting a Xen System(引导Xen操作系统)</A>
</H1>
<P>Booting the system into Xen will bring you up into the privileged management
domain, Domain0. At that point you are ready to create guest domains and
``boot'' them using the <TT>xm create</TT> command.</P>
<P style="COLOR: rgb(51,51,255)">引导系统进入Xen将要带你进入一个特权的 domain
管理,Domain0。在这时,您可以创建客户domain,并通过xm create
命令来引导他们。(其实每个被虚拟的操作系统,都会产生一个Domain。一般说来,每个Domain就是一个虚拟的操作系统。当用支持Xen的内核启动时,系统会自动创建一个拥有超级权限的Domain0,这个Domain0负责管理硬件和为虚拟操作系统提供虚拟硬件环境。<BR>北南 加注 From
LinuxSir.Org)<BR></P>
<H1><A name=SECTION02210000000000000000>3.1 Booting Domain0(从Domain0开始引导)</A>
</H1>
<P>After installation and configuration is complete, reboot the system and and
choose the new Xen option when the Grub screen appears.<BR><SPAN
style="COLOR: rgb(51,51,255)">当我们安装和配置完成,并重新引导系统,就可以在GRUB的启动菜单上选择有支持Xen的启动项来启动系统。</SPAN><BR></P>
<P>What follows should look much like a conventional Linux boot. The first
portion of the output comes from Xen itself, supplying low level information
about itself and the underlying hardware. The last portion of the output comes
from XenLinux.<BR></P>
<P><SPAN
style="COLOR: rgb(51,51,255)">用Xen支持的内核启动,看起来有点象Linux常规引导。第一部份输出的是Xen本身的信息,这些信息是关于Xen自身和底层的硬件的信息。最后的输出是来自于XenLinux。</SPAN><BR></P>
<P>When the boot completes, you should be able to log into your system as usual.
If you are unable to log in, you should still be able to reboot with your normal
Linux kernel by selecting it at the GRUB prompt.<BR></P>
<P
style="COLOR: rgb(51,51,255)">当引导完成后,您应该可以登录您的操作系统了。如果不能登录,应该使用普通内核(也就是原来没有Xen的那个内核--译者注)来引导。然后进行一些问题排查。
</P>
<P>The first step in creating a new domain is to prepare a root filesystem for
it to boot. Typically, this might be stored in a normal partition, an LVM or
other volume manager partition, a disk file or on an NFS server. A simple way to
do this is simply to boot from your standard OS install CD and install the
distribution into another partition on your hard drive.<BR></P>
<P style="COLOR: rgb(51,51,255)"><SPAN
style="COLOR: rgb(51,51,255)">创建一个新的Domain的首先要准备一个
root文件系统,这个文件系统可以是一个物理分区,一个LVM或其它的逻辑卷分区,映像文件,或在一个NFS
服务器上</SPAN>。最简单的是通过操作系统的安装盘把操作系统安装进另一个物理分区。<BR></P>
<P style="COLOR: rgb(51,51,255)"><SPAN
style="FONT-WEIGHT: bold">(注:这句话的意思是,用Xen虚拟的操作系统,可以安装在一个物理分区上,也可以安装在LVM上,可以安装在一个映像文件上,也可以安装在NFS
服务器提供的nfs文件系统上。最简单的方法就是在硬盘上<SPAN
style="COLOR: rgb(51,51,255)">分</SPAN>一个物理分区,安装好操作系统,然后再来通过Xen来虚拟。他在这里所说的创建您的
Domain 就是虚拟新的操作系统。——译者注)。</SPAN><BR></P>
<P>To start the xend control daemon, type<BR><SPAN
style="COLOR: rgb(51,51,255)">启动xend守护进程,请输入如下命令:</SPAN><BR></P>
<BLOCKQUOTE><CODE># xend start</CODE> </BLOCKQUOTE>
<P>If you wish the daemon to start automatically, see the instructions in
Section <A
href="http://www.linuxsir.org/main/doc/Xen3man/user.html#s:xend">4.1</A>. Once
the daemon is running, you can use the <TT>xm</TT> tool to monitor and maintain
the domains running on your system. This chapter provides only a brief tutorial.
We provide full details of the <TT>xm</TT> tool in the next chapter.<BR></P>
<P><SPAN style="COLOR: rgb(51,51,255)">如果您想让xend服务器守护程序开机自动运行,请参考 </SPAN><A
style="COLOR: rgb(51,51,255)"
href="http://www.linuxsir.org/main/doc/Xen3man/user.html#s:xend">4.1</A><SPAN
style="COLOR: rgb(51,51,255)">。一旦xend 运行起来了,<SPAN
style="COLOR: rgb(51,51,255)">就可用xm工具</SPAN>来监视、管理、运行系统中的Domain。这一节提供的仅仅是概要。我们会在下一章节上提供xm工具的详细说明。</SPAN>
</P>
<H1><A name=SECTION02220000000000000000>3.2 Booting Guest Domains<SPAN
style="COLOR: rgb(51,51,255)">(引导客户Domain)</SPAN></A> </H1>
<P></P>
<H2><A name=SECTION02221000000000000000>3.2.1 Creating a Domain Configuration
File<SPAN style="COLOR: rgb(51,51,255)">(创建一个Domain配置文件)</SPAN></A> </H2>
<P>Before you can start an additional domain, you must create a configuration
file. We provide two example files which you can use as a starting
point:<BR><SPAN style="COLOR: rgb(51,51,255)">在启动一个虚拟的操作系统之前,<SPAN
style="COLOR: rgb(255,0,0)">您</SPAN>必须创建一个引导这个虚拟操作系统的配置文件 。我们提供了两个<SPAN
style="COLOR: rgb(51,51,255)">示例</SPAN>文件,这能做为您学习Xen虚拟操作系统的一个起点。</SPAN><BR></P>
<UL>
<LI><TT>/etc/xen/xmexample1</TT> is a simple template configuration file for
describing a single VM.
<LI>/etc/xen/xmexample1 <SPAN
style="COLOR: rgb(51,51,255)">是引导一个虚拟操作系统的配置文件示例;</SPAN><BR>
<LI><TT>/etc/xen/xmexample2</TT> file is a template description that is
intended to be reused for multiple virtual machines. Setting the value of the
<TT>vmid</TT> variable on the <TT>xm</TT> command line fills in parts of this
template.
<LI><TT>/etc/xen/xmexample2 <BIG><SPAN
style="COLOR: rgb(51,51,255)">是可以引导多个虚拟操作系统的配置文件;设置xmid的变量的值,这样就可以通过xm
指定vmid对虚拟的操作系统进行管理。</SPAN></BIG><BR></TT></LI></UL>
<P>There are also a number of other examples which you may find useful. Copy one
of these files and edit it as appropriate. Typical values you may wish to edit
include:<BR></P>
<P><SPAN style="COLOR: rgb(51,51,255)">还有其它一些有关
Domain的配置文件,您可以加以修改应用。下面是一些配置文件的参数,可能您会用到;</SPAN><BR></P>
<DL>
<DT><STRONG>kernel <SPAN
style="COLOR: rgb(51,51,255)">(内核)</SPAN><BR></STRONG>
<DD>Set
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -