Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 62232 Details for
Bug 70161
Ebuild to be used with the source and or binaries of Xen
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
xml source file for xen guide
xen.xml (text/plain), 14.28 KB, created by
Edward Middleton
on 2005-06-29 07:48:06 UTC
(
hide
)
Description:
xml source file for xen guide
Filename:
MIME Type:
Creator:
Edward Middleton
Created:
2005-06-29 07:48:06 UTC
Size:
14.28 KB
patch
obsolete
><?xml version="1.0" encoding="UTF-8"?> ><!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> ><!-- $Header$ --> > ><guide link="/doc/en/xen.xml" lang="en"> ><title>Gentoo Xen Linux Guide</title> ><author title="Author"> > <mail link="edwardmiddleton@k3.dion.ne.jp">Edward Middleton</mail> ></author> > ><abstract> >This guide describes how to install Xen Linux over an existing gentoo system >and how to create a second gentoo system to run in parallel with it. ></abstract> > ><!-- The content of this document is licensed under the CC-BY-SA license --> ><!-- See http://creativecommons.org/licenses/by-sa/2.5 --> ><license/> > ><version>1.0</version> ><date>2005-06-16</date> > ><chapter> ><title>Xen concepts</title> ><section> ><title>Introduction</title> ><body> ><p> >Xen is designed to allow you to run multiple operating systems simultaneously on >a single computer with <uri link="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/performance.html">performance</uri> close to that of a native operating system . ></p> ><p> >In order to understand how this is possible some concepts need to be >understood. ></p> ></body> ></section> ><section> ><title>Basic Problems</title> ><body> ><p> >In order to run two or more operating systems simultaneously on the same >machine two basic problems must be overcome. ></p> ><ul> > <li><b>Hardware isolation</b> - how to avoid two operating systems > accessing the same hardware at the same time.</li> > <li><b>Scheduling</b> - deciding how to allocate CPU time to an OS</li> ></ul> ><p> >Probably the most difficult of these problems is Hardware isolation. There > are two basic approaches to achieving <c>hardware isolation</c>, <c>hardware > emulation</c> and <c>hardware virtualization</c>. ></p> ></body> ></section> ><section> ><title>Emulation vs Virtualization</title> ><body> ><p> >Emulation involves presenting a fake representation of the hardware to the >operating system. Emulation can allow you to run programs completely >independently of the underlying hardware but it tends to be slow. ></p> ><p> >The other approach, Virtualization attempts to use the hardware directly and >arbitrate its access at the hardware level. This approach tends to be much >faster but requires hardware support which is not currently found in consumer >hardware. ></p> ><p> >Xen takes an approach called <c>para-virtualization</c> that has performance >similar to full virtualization, but that can be run on consumer level hardware. ></p> ></body> ></section> ><section> ><title>Para-virtualization</title> ><body> ><p> >Para-virtualization uses a software layer below the OS to arbitrate hardware >access and thus avoids the need for special hardware. OS's running under Xen >need to be modified so that for operations requiring arbitration, they access >the hypervisor rather then the hardware. ></p> ></body> ></section> ><section> ><title>Xen terminology</title> ><body> ><p> >In Xen OS instances (file system and associated kernel) are referred to as >domains. A domain that has direct access to hardware is referred to as a >privileged domain. In the default setup the base operating system (the one >everything is controlled from) is a privileged domain and all other domains >are unprivileged. ></p> ><note>The first privileged domain is referred to as <c>domain0</c> and is used >to control all other domains</note> ><note><c>domainN</c> is used to refer to unprivileged domains</note> ></body> ></section> ></chapter> ><chapter> ><title>Gentoo in domain0</title> ><section> ><title>emerging the base components</title> ><body> ><p> >firstly you need to emerge the hypervisor and kernel source. The ><c>app-emulation/xen</c> ebuild contains the hypervisor and a server for >communicating with the hypervisor. The <c>sys-kernel/xen-sources</c> contains >a Linux kernel modified to run under the Xen hypervisor. ></p> ><pre caption="emerge xen"> ># <i>emerge app-emulation/xen sys-kernel/xen-sources</i> ></pre> ><p> >you will need to configure your kernel for the hardware in your system. To do >this change to the Xen sources directory then run make menuconfig. ></p> ><pre caption="configure your kernel"> ># <i>cd /usr/src/linux-2.6.11.10-xen</i> ># <i>make menuconfig</i> ></pre> ><p> >This is the same as any other kernel except that there will be some extra >options for Xen related features. It is OK to remove drivers for hardware you >don't have but do not change any Xen options. ></p> > ><note>By default the required Xen settings are selected. You should only need >to change settings for you specific hardware</note> > ><p> >The following Xen settings are required for an <c>domain0</c> kernel. ></p> > ><pre caption="configure basic Xen options"> ><comment>(configure XEN settings)</comment> >XEN ---> > [*] Privileged Guest (domain 0) > [*] Block-device backend driver > [*] Network-device backend driver > [*] Block-device frontend driver > [*] Network-device frontend driver > [ ] Piplined transmitter (DANGEROUS) > [*] Scrub memory before freeing it to Xen > Processor Type (X86) ---> ></pre> > ><p> >Because we will be using LVM you need to have the <c>Device mapper support</c> >selected. you should also select the appropriate drivers for you hard drive. ></p> > ><pre caption="configure required devices"> ><comment>(configure LVM support)</comment> >Device Drivers ---> > Multi-device support (RAID and LVM) ---> > <*> Device mapper support > ><comment>(if you are using ide drives at minimium set the following)</comment> >Device Drivers ---> > ATA/ATAPI/MFM/RLL support ---> > <*> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support > > <*> Include IDE/ATA-2 DISK support > > <*> generic/default IDE chipset support > ></pre> > ><p> >You need to make sure the <c>/dev file system support</c> is not selected and >that all the file systems you are using are selected (i.e. ext3). You should >also make sure <c>Advanced partition selection</c> is selected ></p> > ><pre caption="select required filesystems"> ><comment>(insure the /dev file system is not selected</comment> >File systems ---> > Pseudo Filesystems ---> > [*] /proc file system support > <i>[ ] /dev file system support (OBSOLETE)</i> > [*] Virtual memory file system support (former shm fs) > ><comment>(Select one or more of the following options as needed by your system)</comment> >File system ---> > <*> Reiserfs support > <*> Ext3 journalling file system support > <*> JFS filesystem support > <*> Second extended fs support > <*> XFS filesystem support > ><comment>(At least this should selected)</comment> >File system ---> > Partition Types ---> > [*] Advanced partition selection ></pre> > ><p> >Now that your kernel is configured, it is time to compile and install it. Exit >the menuconfig and start the compilation process: ></p> > ><pre caption="compile your kernel"> ># <i>make && make modules_install</i> ></pre> > ><p> >When the kernel has finished compiling, copy the kernel image to /boot. ></p> > ><pre caption="Installing the kernel"> ># <i>cp vmlinux /boot/vmlinux-syms-2.6.11.10-xen</i> ># <i>cp vmlinuz /boot/vmlinuz-2.6.11.10-xen</i> ># <i>cp System.map /boot/System.map-2.6.11.10-xen</i> ># <i>cp .config /boot/config-2.6.11.10-xen</i> ></pre> > ><p> >you will need to modify <path>/boot/grub/grub.conf</path> so the the hypervisor >is run before the domain0 kernel is booted. ></p> > ><pre caption="Editing /boot/grub/grub.conf"> ># <i>nano /boot/grub/grub.conf</i> ></pre> > ><p> >add the following entry to the <path>/boot/grub/grub.conf</path> file. ></p> > ><pre caption="grub entry for xen"> >title=Xen 2.0.6 / XenLinux 2.6.11.10 ><comment># You need to set the root partition to your boot partition.</comment> >root (hd0,0) >kernel /xen.gz dom0_mem=131072 >module /vmlinuz-2.6.11.10-xen root=/dev/hda6 ></pre> > ><p> >You should now reboot your system and check that the privileged <c>domain0</c> >boots. ></p> > ></body> ></section> ></chapter> ><chapter> ><title>Gentoo in domainN</title> ><section> ><title>creating the root partition</title> ><body> > ><p> >It is now time to setup the unprivileged domains. You will need to start by >creating partitions for your new operating systems. ></p> > ><p> >I have chosen the simplest partition scheme, a single root partition and a >swap file. The choice is mostly arbitrary. You can check out the ><uri link="http://www.gentoo.org/doc/en/handbook/2005.0/handbook-x86.xml?part=1&chap=4#doc_chap2"> >Gentoo Linux x86 Handbook</uri> for other possible partitioning schemes. ></p> > ><pre caption="creating logical xen partitions"> ># <i>lvcreate -L2M -nxen1-root vg</i> ># <i>lvcreate -L100M -nxen1-swap vg</i> ></pre> > ><note>If you haven't already setup lvm read ><uri link="http://www.gentoo.org/doc/en/lvm2.xml">Gentoo LVM2 installation</uri> ></note> > ><note><c>vg</c> will be whatever you call your volume group</note> > ><p> >Next we need to format the partitions. I have chosen to use ext3 but the >choice is arbitrary. ></p> > ><note>your xen kernel must be configured with support for the file system you >choose</note> > ><pre caption="Applying a file system on the root partition"> ># <i>mkfs.ext3 /dev/vg/xen1-root</i> ></pre> ><pre caption="Creating a Swap signature"> ># <i>mkswap /dev/vg/xen1-swap</i> ></pre> ></body> ></section> ><section> ><title>Installing the OS</title> ><body> ><p> >The final stage is installing your OS on the new partition. This is mostly the >same as a normal install. ></p> ><p> >you will need to create the gentoo mount point and mount the root partition. ></p> ><pre caption="Mounting partition"> ># <i>mkdir /mnt/gentoo</i> ># <i>mount -t ext3 /dev/vg/xen1-root /mnt/gentoo</i> ></pre> ><p> >You will need to get a tarball with one of the stages and unpack it to your ><path>/mnt/gentoo</path> directory. If you don't know how to do this read ><uri link="http://www.gentoo.org/doc/en/handbook/2005.0/handbook-x86.xml?part=1&chap=5"> >Gentoo Handbook chapter 5</uri> ></p> ><p> >Now unpack your downloaded stage onto your system. We use GNU's <c>tar</c> to >proceed as it is the easiest method: ></p> ><pre caption="Unpacking the stage"> ># <i>cd /mnt/gentoo</i> ># <i>tar -xvjpf stage3-<subarch>-2005.0.tar.bz2</i> ></pre> ><p> >This will create the base folders. You will then need to bind the proc file >system to the mount point on the new partition. ></p> ><pre caption="Binding /proc"> ># <i>mount --bind /proc /mnt/gentoo/proc</i> ></pre> ><p> >We will be using nfs to access portage so we will bind the portage partition >from our main system. You will need to create the mount point then bind >portage to it. ></p> ><pre caption="Binding /usr/portage"> ># <i>mkdir /mnt/gentoo/usr/portage</i> ># <i>mount --bind /usr/portage /mnt/gentoo/usr/portage</i> ></pre> ><p> >You should copy the <path>/etc/resolve.conf</path> file and the ><path>/etc/make.conf</path> to <path>/mnt/gentoo/etc</path> ></p> ><pre caption="Copying resolve.conf and make.conf"> ># <i>cp /etc/resolve.conf /mnt/gentoo/etc/resolve.conf</i> ># <i>cp /etc/make.conf /mnt/gentoo/etc/make.conf</i> ></pre> > ><p> >You should now chroot into the partition and continue the install >process. ></p> > ><pre caption="Enter chroot"> ># <i>chroot /mnt/gentoo /bin/bash</i> ># <i>env-update</i> ># <i>source /etc/profile</i> ></pre> > ><p> >When you edit your fstab file it should contain the root file system and >the swap file entries. ></p> > ><pre caption="Editing /etc/fstab"> ># <i>nano /etc/fstab</i> ></pre> > ><pre caption="fstab entries"> ><comment># there is no boot partition so don't include it</comment> >/dev/sda1 / ext2 noatime 0 0 >/dev/sda2 none swap sw 0 0 ></pre> > ><note>You must have <path>/dev/hdaN</path> entries in you <c>domain0</c> >or the hypervisor will not be able to determine the major and minor for the >device.</note> > ><p> >Set a static address because that is simple. ></p> > ><pre caption="Editting /etc/conf.d/net"> ># <i>nano -w /etc/conf.d/net</i> ></pre> > ><pre caption="Setting static address"> >iface_eth0="192.168.0.4 broadcast 192.168.0.255 netmask 255.255.255.0" >gateway="eth0/192.168.0.1" ></pre> > ><p> >Next edit the hosts file and add the hostname. ></p> > ><pre caption="Editing /etc/hosts"> ># <i>nano -e /etc/hosts</i> ></pre> > ><pre caption="Add hostname"> >127.0.0.1 localhost xen1 ></pre> > ><p> >In order for the os to be started you need to create a configuration file as >follows. ></p> > ><pre caption="Create startup file"> ># <i>nano /etc/xen/auto/xen1</i> ></pre> > ><pre caption="Xen startup file"> >kernel = "/usr/src/linux-2.6.11.10-xen/vmlinuz" >memory = 128 >name = "xen1" >vif = [ 'mac=aa:00:00:00:00:11, bridge=xen-br0' ] >disk = [ 'phy:0801,vg/xen1-root,hda1,w','phy:0802,vg/xen1-swap,hda2,w' ] >root = "/dev/hda1" ></pre> > ><p> >Start the hypervisor access daemon and add it to the default domain. ></p> > ><pre caption="Starting hypervisor daemon"> ># <i>/etc/init.d/xend start</i> ></pre> > ><pre caption="Add xend to default"> ># <i>rc-update add xend default</i> ></pre> > ><p> >You can now start the new domain and display the domain boot sequence. ></p> > ><pre caption="starting domain"> ># <i>xm create -c /etc/xen/auto/xen1</i> ></pre> > ></body> ></section> ><section> ><title>the xm command</title> ><body> > ><p> >the <i>xm</i> allows you to control the hypervisor. You can >use it to start and stop domains, to check domain status and number >of other hypervisor related functions. ></p> > ><p> >using the following command you can display the status of the >guest domains. ></p> > ><pre caption="display domain status"> ># <i>xm list</i> ></pre> > ><p> >using the following command you can stop a domain synchronously ></p> > ><pre caption="stopping a domain"> ># <i>xm shutdown -H -w xen1</i> ></pre> > ></body> ></section> ></chapter> > ><chapter> ><title>Tips/Tricks/Thoughts/Hacks/etc</title> ><section> ><title>disable tls</title> ><body> > ><p> >tls does not work directly with Xen and has to be emulated. This makes >tls libraries very slow. It is recommended that you disable tls for >domains running under Xen. ></p> > ><pre caption="Editing /etc/make.conf"> ># <i>nano /etc/make.conf</i> ></pre> > ><pre caption="Unset tls"> >USE="-tls ... " ></pre> > ><pre caption="Disable tls"> ># <i>mv /lib/tls /lib/tls.disable</i> ></pre> ></body> ></section> ></chapter> > ><chapter> ><title>References</title> ><section> ><body> ><ul> > <li> > The main Xen <uri link="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/"> > homepage</uri>, > <uri link="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/readmes/user/user.html"> > manual</uri>, > <uri link="http://wiki.xensource.com/xenwiki/XenFaq">FAQ</uri>, and > <uri link="http://lists.xensource.com/">mailing lists</uri>. > </li> > <li> > A howto in the gentoo forums about Xen setup. > <uri>http://forums.gentoo.org/viewtopic-p-2462628.html#2462628</uri> > </li> ></ul> ></body> ></section> ></chapter> ></guide>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 70161
:
43893
|
43894
|
43934
|
44961
|
44962
|
44963
|
44965
|
50718
|
51453
|
52423
|
52424
|
53755
|
53756
|
53757
|
53758
|
53759
|
56536
|
57185
|
57186
|
57187
|
57188
|
57189
|
57231
|
57232
|
57233
|
57234
|
57444
|
59355
|
59688
|
59694
|
59695
|
59703
|
59710
|
59947
|
60478
|
60552
|
60561
|
60562
|
60746
|
61091
|
61951
| 62232 |
62233
|
66585