Xen

From ArchWiki

Jump to: navigation, search

This document explains how to setup Xen for Arch Linux.

Contents

What is Xen?

According to the Xen development team: "The Xen hypervisor, the powerful open source industry standard for virtualization, offers a powerful, efficient, and secure feature set for virtualization of x86, x86_64, IA64, PowerPC, and other CPU architectures. It supports a wide range of guest operating systems including Windows®, Linux®, Solaris®, and various versions of the BSD operating systems."

The Xen hypervisor is a thin layer of software which emulates a computer architecture. It is started by the boot loader and allows several operating systems to run simultaneously on top of it. Once the Xen hypervisor is loaded, is starts the "dom0" (for "domain 0"), or privileged domain, which in our case runs a modified Linux kernel (other possible dom0 operating systems are NetBSD and OpenSolaris). The dom0 kernel in the AUR is currently based on Linux kernel 2.6.31.5; hardware must be supported by this kernel to run Xen. Once the dom0 has started, one or more "domU" (for "user") or unprivileged domains can be started and controlled from the dom0.

Setting up Xen

To set up Xen by hand, see Xen_Install (though this page is very out of date, so be careful). That page details installing a custom xen kernel and the xen userland tools by hand, rather than by taking advantage of pre-built packages in the AUR, which is the method which will be considered here.

Installing the necessary packages

Install the xen (or xen-hv-tools) and kernel26-xen-dom0 packages from the AUR.

Configuring GRUB

Next, edit Grub to boot the Xen hypervisor is booted and then the Dom0 kernel. To do so, add the following entry to /boot/grub/menu.lst:

title Xen with Arch Linux
root (hd0,X)
kernel /xen.gz dom0_mem=524288
module /vmlinuz26-xen-dom0.gz root=/dev/sdaY ro console=tty0 vga=0x307
module /kernel26-xen-dom0.img

where X and Y are the appropriate numbers for your disk configuration, and dom0_mem, console, and vga are optional parameters.

Reboot and select this option at boot. (If there are errors, just reboot and choose your normal kernel.) Start xend:

# /etc/rc.d/xend start

Add domU instances

The basic idea behind adding a domU is as follows. We must get the domU kernels, allocate space for the virtual hard disk, create a configuration file for the domU, and finally start the domU with xm.

Resources

  • Xen's homepage: [1]
  • The Xen Wiki: [2]
Personal tools