From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7AEF9138010 for ; Sun, 7 Oct 2012 13:33:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E217E027D; Sun, 7 Oct 2012 13:32:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CF4A3E0268 for ; Sun, 7 Oct 2012 13:32:51 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EAE3B33D780 for ; Sun, 7 Oct 2012 13:32:50 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 617) id A41DD20E47; Sun, 7 Oct 2012 13:32:49 +0000 (UTC) From: "Sven Vermeulen (swift)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, swift@gentoo.org Subject: [gentoo-commits] gentoo commit in xml/htdocs/doc/en: xen-guide.xml X-VCS-Repository: gentoo X-VCS-Files: xen-guide.xml X-VCS-Directories: xml/htdocs/doc/en X-VCS-Committer: swift X-VCS-Committer-Name: Sven Vermeulen Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20121007133249.A41DD20E47@flycatcher.gentoo.org> Date: Sun, 7 Oct 2012 13:32:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 966b0873-5e35-4dc9-a1e9-f3b92cb0a1f0 X-Archives-Hash: 86141c32f32de63ac8f783f745652750 swift 12/10/07 13:32:49 Modified: xen-guide.xml Log: Bug #437222 - Update Xen document to reflect later releases Revision Changes Path 1.14 xml/htdocs/doc/en/xen-guide.xml file : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/xen-guide.xml?rev=1.14&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/xen-guide.xml?rev=1.14&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo/xml/htdocs/doc/en/xen-guide.xml?r1=1.13&r2=1.14 Index: xen-guide.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/xen-guide.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- xen-guide.xml 24 Jul 2012 12:12:51 -0000 1.13 +++ xen-guide.xml 7 Oct 2012 13:32:49 -0000 1.14 @@ -1,8 +1,8 @@ - + - + Configuring Gentoo with Xen @@ -20,8 +20,8 @@ -8 -2012-07-24 +9 +2012-10-07 Introduction @@ -114,7 +114,7 @@

-~# emerge xen xen-tools xen-sources
+~# emerge xen xen-tools gentoo-sources
 
@@ -125,89 +125,64 @@

Next we'll build the Linux kernel with Xen support. This kernel, whose sources -are available at /usr/src/linux-2.6.x.z-xen, will be our main +are available at /usr/src/linux, will be our main running kernel (i.e. the one running domain 0). In the XEN section you'll find drivers for all kinds of input/output, each driver having a backend and frontend implementation available. For the domain 0 kernel you need to select the backend implementation: these are used by the other domains (who use the frontend drivers) to communicate directly with -the hardware. +the hardware. However, you should be able to configure the kernel to provide +support for both frontend (guest) and backend (host) drivers.

-Of course, don't forget to select Xen-compatible at Processor type and -features. If you're wondering about networking: each interface in a domain +If you're wondering about networking: each interface in a domain has a point-to-point link to an interface on domain 0 (called vifX.Y where X is the domain number and Y the Yth interface of that domain), so you can configure your network the way you want (bridging, NAT, etc.)

-
+
 Processor type and features  --->
-      Subarchitecture Type (Xen-compatible)
+    [*] Paravirtualized guest support --->
+        [*] Xen guest support
 
-
-Processor type and features  --->
-      Subarchitecture Type (PC-compatible)
-  [*] Enable Xen compatible kernel
-  [*] Support for hot-pluggable CPUs
-
- -
-Bus options (PCI etc.)  --->
-  [*] PCI support
-  [ ]   Xen PCI Frontend Debugging
-
-Networking  --->
-  Networking options  --->
-    <*> 802.1d Ethernet Bridging
-    Only required by bridged networking.
-
-XEN  --->
-  [*] Privileged Guest (domain 0)
-  <*> Backend driver support
-  <*>   Block-device backend driver
-  <*>   Network-device backend driver
-  <*>   PCI-device backend driver
-           PCI Backend Mode (Virtual PCI) --->
-  [*] Scrub memory before freeing it to Xen
-  [*] Disable serial port drivers
-      Xen version compatibility (3.0.4 and later)
-
- -
+
 Bus options (PCI etc.)  --->
-  [ ] PCI support
+    [*] Xen PCI Frontend
 
-Device Drivers  --->
-  SCSI device support  --->
-    < > SCSI device support
-    Disabling SCSI support frees up the /dev/sd* device names
-    for use as Xen virtual block devices.
-
-XEN  --->
-  [ ] Privileged Guest (domain 0)
-  <*> Block-device frontend driver
-  <*> Network-device frontend driver
-  [*] Scrub memory before freeing it to Xen
-  [*] Disable serial port drivers
-      Xen version compatibility (3.0.4 and later)
+[*] Networking support --->
+    Networking options  --->
+        <*> 802.1d Ethernet Bridging
+	[*] Network packet filtering framework (Netfilter) --->
+	    [*] Advanced netfilter configuration
+	        [*] Bridged IP/ARP packets filtering
+
+Device Drivers --->
+    [*] Block devices (NEW) --->
+        <*> Xen block-device backend driver
+    [*] Network device support --->
+        <*> Xen backend network device
+    Xen driver support --->
+        [*] Xen memory balloon driver (NEW)
+	[*]   Scrub pages before returning them to system (NEW)
+	<*> Xen /dev/xen/evtchn device (NEW)
+	[*] Backend driver support (NEW)
+	<*> Xen filesystem (NEW)
+	[*]   Create compatibility mount point /proc/xen (NEW)
+	[*] Create xen entries under /sys/hypervisor (NEW)
+	<M> userspace grant access device driver (NEW)
+	<M> user-space grant reference allocator driver (NEW)
+	<M> xen platform pci device driver (NEW)
 

-A nice hint is to have the kernel make process store its intermediate object -files elsewhere so that you can reuse the same kernel tree to build different -configurations: -

- -
-~# mkdir -p ~/build/dom0 ~/build/domU
-~# make O=~/build/dom0 menuconfig
-(Configure the kernel)
-~# make O=~/build/dom0 && make O=~/build/dom0 modules_install
-
+The shown kernel configuration should allow the kernel image to boot both as a +host as well as a guest. However, if you want to, you can slim down the guest +image kernel considerably. Refer to the Xen documentation for more information. +

Once the kernel is built you'll find the kernel image immediately in the @@ -220,26 +195,16 @@

-title Xen 3.0 / Gentoo Linux 2.6.x.y
+title Xen Gentoo Linux 3.5
 root (hd0,0)
 kernel /boot/xen.gz
-module /boot/kernel-2.6.x.y-xen0 root=/dev/sda3
+module /boot/kernel-3.5.x.y-xen0 root=/dev/sda3
 

-Now reboot your system into Xen. Once you are booted, you need to load the Xen -daemon: -

- -
-~# /etc/init.d/xend start
-
- -

-Now check if you can do whatever you normally do on your system. If this is the -case, you can edit your bootloader configuration to always boot into Xen and add -the Xen deamon to the default runlevel so that it is started automatically -next time you boot. +Now reboot your system into Xen and check if you can do whatever you +normally do on your system. If this is the case, you can edit your +bootloader configuration to always boot into Xen.

@@ -259,25 +224,18 @@

-Go to the Xen-powered Linux kernel source and update the configuration. It is -wise to keep as many topics as possible similar to the main kernel except the -XEN settings where drivers should now have their frontend -implementation selected instead of the backend. Then build the kernel +Go to the Xen-powered Linux kernel source and, if necessary, update the +configuration. It is wise to keep as many topics as possible similar to +the main kernel. Then build the kernel and place the resulting vmlinuz file where you want (we assume this is /mnt/data/xen/kernel):

 ~# make O=~/build/domU
-~# cp ~/build/domU/vmlinuz /mnt/data/xen/kernel/kernel-2.6.x.y-xen
+~# cp ~/build/domU/vmlinuz /mnt/data/xen/kernel/kernel-3.5.x.y-xen
 
-

-It is also possible to create a single kernel image for both the administrative -domain and the unpriviledged domain. More information about this can be found -in the Xen user manual. -

-
@@ -293,13 +251,13 @@

You can create a file based filesystem using dd and mke2fs (or -any other file system creation tool). For instance, to create a 2Gbyte ext3 +any other file system creation tool). For instance, to create a 4 Gbyte ext4 filesystem:

-~# dd if=/dev/zero of=/mnt/data/xen/disks/ext3root.img bs=1M count=2048
-~# mke2fs -j /mnt/data/xen/disks/ext3root.img
+~# dd if=/dev/zero of=/mnt/data/xen/disks/ext4root.img bs=1M count=4096
+~# mkfs.ext4 /mnt/data/xen/disks/ext4root.img
 
@@ -319,11 +277,11 @@
 ~# nano -w /mnt/data/xen/configs/gentoo
 
-kernel = "/mnt/data/xen/kernel/kernel-2.6.x.y-xen"
+kernel = "/mnt/data/xen/kernel/kernel-3.5.x.y-xen"
 memory = 512
 name   = "gentoo"
 (Map the disk image to the virtual /dev/sda1)
-disk   = ['file:/mnt/data/xen/disks/ext3root.img,sda1,w']
+disk   = ['file:/mnt/data/xen/disks/ext4root.img,sda1,w']
 root   = "/dev/sda1 ro"
 
@@ -353,11 +311,11 @@

Now we're all set and we can launch the new domain. If the disk image contained an operating system, we could just create and attach the domain using the -xm command (Xen manager): +xl command:

-~# xm create /mnt/data/xen/configs/gentoo -c
+~# xl create /mnt/data/xen/configs/gentoo -c
 

@@ -369,7 +327,7 @@

If you want to disconnect from the domain, press Ctrl+]. You can -always reconnect to the domains' console using xm console gentoo. +always reconnect to the domains' console using xl console gentoo. However, there is only one console per domain, so only use it when you can't access the domain otherwise (for instance, through SSH).

@@ -384,23 +342,8 @@

-Xen supports at least two ways of configuring your (virtual) network: -routed and bridged. -

- -

-When selecting the routed approach, the interface inside your -unpriviledged domain is connected to the virtual interface on your -administrative domain. On your administrative domain (domain 0), the virtual -interface is linked together with eth0. The -interface inside your unpriviledged domain should have an IP address on the same -network as the interface on the administrative domain. Any communication to -that IP address can only occur from the administrative domain, unless you set -up specific routing rules. -

- -

-When selecting the bridged approach, your default network interface on +Xen works best when using a bridged mode network configuration. +This means that your default network interface on the administrative domain becomes a bridge which accepts connections to the virtual domains as well as to the IP address your administrative domain has.

@@ -408,119 +351,39 @@
-Regular Routed Interfaces - - -

-Before you set up the interface on your unpriviledged domain, make sure that -Xen's netloop and netbk drivers are loaded. A quick -hint: if you have netloop as a module, load it with -nloopbacks=0 so that it doesn't create pointless interfaces to the -loopback device. Then, edit your domain configuration file and add a vif -instruction to it. -

- -
-~# nano -w /mnt/data/xen/configs/gentoo
-
-(Add the vif instruction)
-vif    = [ 'ip=192.168.1.101, vifname=veth1' ]
-
- -

-In the above example, the interface will be created for the unpriviledged domain -(in which it will be called eth0) and Xen will ensure that address -192.168.1.101 will be reachable from the administrative domain through interface -veth1. -

- -

-This doesn't mean that the virtual eth0 interface will -automatically have IP 192.168.1.101 assigned to it, but rather that, if you -don't give it that IP, it will not be connected with the administrative domain -and thus cannot be reached. -

- -

-Now edit /etc/xen/xend-config.sxp as follows to select routed -network configuration: -

- -
-~# nano -w /etc/xen/xend-config.sxp
-
-(Comment out the following lines)
-#(network-script network-bridge)
-#(vif-script vif-bridge)
-
-(Enable the following lines)
-(network-script network-route)
-(vif-script vif-route)
-
- - -
-
Bridged Interfaces

-Unlike the routed interfaces you now need to load the netloop -driver with nloopbacks=1 (or higher) as the additional loopback devices -are used to create the bridge. For the other modules you still need the -netbk module as well as briding functionality (bridge -module if build as such). -

- -

-Now edit your virtual domain and add the vif construct: +Create a bridge interface by creating a new link to the networking init script +as provided by Gentoo:

-
-~# nano -w /mnt/data/xen/configs/gentoo
-
-(Add the vif instruction)
-vif    = [ 'ip=192.168.1.101, vifname=veth0' ]
-
- -

-Next edit /etc/xen/xend-config.sxp as follows to select bridged -network configuration: -

- -
-~# nano -w /etc/xen/xend-config.sxp
-
-(Enable the following lines)
-(network-script network-bridge)
-(vif-script vif-bridge)
-
-(Comment out the following lines if not done already)
-# (network-script network-route)
-# (vif-script vif-route)
+
+# cd /etc/init.d
+# ln -s net.lo net.br0
 

-By default, the bridge will contain whatever interface is configured to be the -default interface (the device that is listed under the default route through -ip route list). If you want to alter this behavior, edit the -xend-config.sxp as follows: +Next, edit /etc/conf.d/net and setup the bridge:

-
-~# nano -w /etc/xen/xend-config.sxp
+
+# nano -w /etc/conf.d/net
 
-(Edit the network-script line)
-(network-script 'network-bridge netdev=eth0 bridge=xenbr0 vifnum=0')
+bridge_br0="eth0"
+config_br0="192.168.1.200 netmask 255.255.255.0 brd 192.168.1.255"
+routes_br0="default via 192.168.1.1"
 

-Once the configuration is done, restart the xend init script to have Xen -build the bridge: +Finally, install the net-misc/bridge-utils package, and make sure the +net.br0 init script is loaded at boot.

-
-~# /etc/init.d/xend restart
+
+# emerge net-misc/bridge-utils
+# rc-update add net.br0 default