Note: Almost all content here will eventually be revised and merged into the live-manual. Please do not add new content to the wiki, but contribute to the manual directly. |
Here's a quick (and growing) guide for creating live Xen images using debian live.
Intro
Xen is a virtual machine monitor (hypervisor). It offers some neat features - check out http://wiki.xensource.com/xenwiki/XenIntro for a thorough intro.
The virtual machine host portion is called "Dom0", which can be Debian with a xen kernel. DomU is the guest operating system. It can also be a regular debian live image (iso for example).
Dom0 Config
For Dom0 creation, you can use lh_config from live-helper:
$ lh_config --linux-flavours "xen-686" $ lh_config --linux-packages "xen-linux-system-2.6.18-4 squashfs-modules-2.6.18-4" $ lh_config --packages "xen-ioemu-3.0.3-1"
Unionfs
There is still no official Debian unionfs module for Xen kernels (if there is, please update!), so we need to build it manually:
m-a -k /usr/src/linux-headers-2.6.18-4-xen-686 -l 2.6.18-4-xen-686 build unionfs
To make live-helper use this, the resulting .deb in /usr/src should be copied into config/chroot_localpackages directory.
Xen configuration
If you have an HVM (Hardware Virtual Machine) compatible computer, you can use the configuration:
guest.conf:
device_model = '/usr/lib/xen-3.0.3-1/bin/qemu-dm' kernel = "/usr/lib/xen-3.0.3-1/boot/hvmloader" builder='hvm' memory = 256 name = "guest" pae=1 disk=['file:/live_media/domains/guest.iso,hdc:cdrom,r'] boot = "d"
<non-HVM config here...>
grub
grub is needed as the bootloader because Xen kernel does not play well with syslinux.
title LiveXen kernel /boot/live/xen-3.0.3-1-i386-pae.gz console=vga dom0_mem=256MB module /boot/live/vmlinuz-2.6.18-4-xen-686 initrd=initrd.img-2.6.18-4-xen-686 max_loop=255 boot=casper module /boot/live/initrd.img-2.6.18-4-xen-686
dom0_mem=256MB is used mainly for testing reasons.
Putting it all together
The resulting image should contain the following:
/boot - kernel, initrd, xen
/casper - filesystem.{squashfs,dir,*} (of Dom0)
/domains - guest.conf, guest.iso
Starting guests
After the boot xend service should be running, allowing guest operating systems to run. To start our guest debian live:
xm create guest.conf
