Differences between revisions 64 and 66 (spanning 2 versions)
Revision 64 as of 2008-11-20 05:22:55
Size: 8326
Comment:
Revision 66 as of 2008-12-04 08:11:36
Size: 9465
Editor: ?Ivan Savcic
Comment:
Deletions are marked like this. Additions are marked like this.
Line 2: Line 2:
||<tablestyle="width: 100%;" style="border: 0px hidden">~-Translation(s): [:id/Xen:Indonesian]~ ||<style="text-align: right; border: 0px hidden"> (!) [:/Discussion:Discussion]|| ||<tablewidth="100%"style="border: 0px hidden ;">~-Translation(s): [:id/Xen:Indonesian]~ -~ ||<style="border: 0px hidden ; text-align: right;"> (!) ["/Discussion"] ||
Line 4: Line 4:

[[TableOfContents(2)]]
 . [[TableOfContents(2)]]
Line 25: Line 23:
Line 27: Line 26:

Line 40: Line 37:
If you install lenny domU on etch dom0, make sure you read this entry on [http://wiki.xensource.com/xenwiki/XenFaq#head-e05786f1e0d6a833bc146a6096cab2d96f2b30ae XenFaq].
Line 41: Line 40:
Line 66: Line 66:
== Additional note for domU on lenny using xen-tools ==
It seems that xen-tools, from the official lenny repository at the time of this writing (27/Nov/2008), don't use hvc0 as the console device (it's noted in the xen-tools configuration that it's the default, but it didn't work the last time I tried) and don't install udev (leading to /dev/pts missing in domU).

This makes logging in via xm console and via ssh impossible, because getty doesn't have a proper console to attach to and ssh can't attach to a pseudo terminal.

To fix this,

1. add to /etc/xen-tools/xen-tools.cfg:

{{{
serial_device = hvc0}}}
2. and make domU with:

{{{
xen-create-image --hostname HOSTNAME (more options...) --role udev}}}
Line 117: Line 132:
== 4gb seg fixup errors ==
Solution:

{{{
echo 'hwcap 0 nosegneg' > /etc/ld.so.conf.d/libc6-xen.conf && ldconfig
}}}
Read this [http://wiki.xensource.com/xenwiki/XenFaq#head-e05786f1e0d6a833bc146a6096cab2d96f2b30ae XenFaq entry] for more info.

Translation(s): [:id/Xen:Indonesian]~

(!) ["/Discussion"]


  • ?TableOfContents(2)

Xen Overview

Modern computers are sufficiently powerful to use virtualization to present the illusion of many smaller virtual machines (VMs), each running a separate operating system instance. Successful partitioning of a machine to support the concurrent execution of multiple operating systems poses several challenges. Firstly, virtual machines must be isolated from one another: it is not acceptable for the execution of one to adversely affect the performance of another. This is particularly true when virtual machines are owned by mutually untrusting users. Secondly, it is necessary to support a variety of different operating systems to accommodate the heterogeneity of popular applications. Thirdly, the performance overhead introduced by virtualization should be small.

Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. Xen is Open Source software, released under the terms of the GNU General Public License. We have a fully functional ports of Linux 2.6 running over Xen, and regularly use it for running demanding applications like MySQL, Apache and PostgreSQL. Any Linux distribution (RedHat, SuSE, Debian, Mandrake) should run unmodified over the ported OS.

In addition to Linux, members of Xen's user community have contributed or are working on ports to other operating systems such as NetBSD (Christian Limpach), FreeBSD (Kip Macy) and Plan 9 (Ron Minnich).

It is also possible to run some other, not ported, operating systems if your CPU has hardware virtualization support (VT or Pacifica).

Installation on etch

Upstream documentation can be found in the xen-docs-3.0 package (in /usr/share/doc/xen-docs-3.0/user.pdf.gz). It's also available [http://www.cl.cam.ac.uk/research/srg/netos/xen/readmes/user/user.html online].

Dom0 (host)

  • Choose and install a xen-linux-system-KERNELVERSION package. This installs the kernel, a hypervisor and matching utilities.

  • On i386, install libc6-xen. This means that you don't have to delete /lib/tls or move it out of the way, as suggested by most Xen guides.

  • Use Grub as bootloader (since Lilo and Xen don't play well with one another)
  • You probably want to configure /etc/xen/xend-config.sxp (especially the network-script scheme).

The xen-linux-system packages of interest are (Install the correct one for your distribution and architecture):

If you need to apply some modifications to the kernel with the xen patch, then one way to do it is described ?DebianKernelCustomCompilation.

DomU (guests)

The easiest way to create a domU is to use xen-tools (and, if this doesn't do what you need, Steve Kemp is keen and fast in implementing useful suggestions).

If you do not wish to use xen-tools, follow [http://www.debian.org/releases/stable/i386/apds03.html this alternative guide].

Xen boots domUs using kernels stored on dom0, so you only need to install the corresponding linux-modules package in the domU. Alternatively, you can use pygrub to boot kernels on the domU filesystem (is there documentation for this?).

On i386, make sure you install libc6-xen.

If you install lenny domU on etch dom0, make sure you read this entry on [http://wiki.xensource.com/xenwiki/XenFaq#head-e05786f1e0d6a833bc146a6096cab2d96f2b30ae ?XenFaq].

?Anchor(InstallLenny)

Installation on lenny

Dom0 (host)

Quite the same way as Etch. The kernel is 2.6.26, the -xen variant contains patches from SuSE for dom0 support.

DomU (guest)

The Lenny Debian Installer fully supports installation of 32 bit guests under Xen using the netboot/xen variant. Currently images are available only from the[http://people.debian.org/~joeyh/d-i/images/daily/netboot/xen/ daily builds] which contain a kernel, installer ramdisk and an example Xen configuration file. To install edit the configuration file to suite your tastes and start the guest with the "install=true" option and, for the time being, manually direct it to the daily builds:

xm create -c xm-debian.cfg install=true \
  install-installer=http://people.debian.org/~joeyh/d-i/images/daily/

See the comments in the configuration file for additional installation options.

Once the guest is installed simply boot it using:

xm create -c xm-debian.cfg

Since Lenny only includes 32 bit (PAE) kernel support which means there is no installer support for 64 bit guests. You can continue to use the Etch kernels or obtain a newer upstream kernel which supports 64 bit operation (2.6.27+).

In addition to installing via Debian Installer xen-tools can also create a Lenny domU as described in the Etch section above.

The default Lenny kernel is the newer paravirt_ops version (2.6.26), which does not function as a dom0 (except for the -xen variants, which have dom0 support but also some issues running as domU). It will also not support PCI passthrough in a domU. For PCI passthrough, you have to run the 2.6.18 etch kernel as both dom0 and domU.

In Lenny the distinction between the Xen and non-Xen flavours of the kernel (with respect to domU support) is no longer present. The Debian Installer will install the -686-bigmem flavour.

Additional note for domU on lenny using xen-tools

It seems that xen-tools, from the official lenny repository at the time of this writing (27/Nov/2008), don't use hvc0 as the console device (it's noted in the xen-tools configuration that it's the default, but it didn't work the last time I tried) and don't install udev (leading to /dev/pts missing in domU).

This makes logging in via xm console and via ssh impossible, because getty doesn't have a proper console to attach to and ssh can't attach to a pseudo terminal.

To fix this,

1. add to /etc/xen-tools/xen-tools.cfg:

serial_device = hvc0

2. and make domU with:

xen-create-image --hostname HOSTNAME (more options...) --role udev

Using Debian-Installer

The page ["DebianInstaller/Xen"] contains instructions on how to install Xen Dom0 and Etch DomU with DebianInstaller.See above for details of installing Lenny using Debian Installer.

Package maintenance

Debian's Xen packages are maintained by the [http://alioth.debian.org/projects/pkg-xen/ pkg-xen] project. ([http://lists.alioth.debian.org/mailman/listinfo/pkg-xen-devel developpers' mailing list])

The [http://qa.debian.org/developer.php?login=pkg-xen-devel@lists.alioth.debian.org Debian Developer's Package Overview] page lists source packages that are maintained by the team.

Common Errors

dom0 automatic reboots

  • {i} Note: if Xen is crashing and reboot automatically, you may want to use noreboot xen option, to prevent it from rebooting automatically. Grub example :

    title           Xen 3.1-1-i386 / Debian GNU/Linux, kernel 2.6.18-5-xen-686
    root            (hd0,0)
    kernel          /xen-3.1-1-i386.gz noreboot
    module          /vmlinuz-2.6.18-5-xen-686 root=/dev/foo ro console=tty0
    module          /initrd.img-2.6.18-5-xen-686

error: CDROM boot failure

You get the error :

  • CDROM boot failure code 0002
    or CDROM boot failure code 0003
    Boot from cd-Rom failed
    Fatal: Could not read the boot disk.

That's because Xen can't boot from a cdrom iso image at the moment. i.e you can't have tap:aio:/path/to/mycd.iso,hdc:cdrom,r or file:/path/to/mycd.iso,hdc:cdrom,r.

Workaround: use losetup to create a loopback device for the cdrom ISO image, then use it in Xen configuration file. for example :

  • #First, check which loop device is free
    $losetup -f
    /dev/loop9
    #Then create a loopback device
    $losetup -f /path/to/mycd.iso
    losetup /dev/loop9
    /dev/loop9: [fe04]:3096598 (/path/to/mycd.iso)

Now you can use /dev/loop9 in xen configuration file (/etc/xen/foobar.cfg) :

  • ...
    disk = [ 'phy:/dev/vg1/xpsp3,ioemu:hda,w', 'phy:/dev/loop/0,ioemu:hdc:cdrom,r' ]
    ...

then boot/install the guest OS.

note: yo should switch back to the tap:aio:/path/to/mycd.iso,hdc:cdrom,r syntax after installation, since loop back have to be recreated after you reboot the host system.

4gb seg fixup errors

Solution:

echo 'hwcap 0 nosegneg' > /etc/ld.so.conf.d/libc6-xen.conf && ldconfig

Read this [http://wiki.xensource.com/xenwiki/XenFaq#head-e05786f1e0d6a833bc146a6096cab2d96f2b30ae ?XenFaq entry] for more info.

Resources