Getting Started

This page guides you through getting Xen up and running on your hardware for the first time.

Prerequisites

Before installing Xen, check that your hardware meets these requirements:

  • A 64-bit x86 processor with hardware virtualization extensions (Intel VT-x or AMD-V). These are present on virtually all modern server and desktop processors.

  • Enough RAM for dom0 and at least one guest VM. A minimum of 4 GB is recommended; more is better.

  • A Linux distribution that supports Xen as dom0.

Getting Xen

The recommended way to install Xen is through your Linux distribution. Most major distributions include Xen packages in their repositories and handle configuration automatically.

Distributions with good Xen support include:

  • Debian and Ubuntu

  • Fedora

  • openSUSE / SLES

  • XCP-ng (a dedicated Xen-based platform)

Install the Xen hypervisor package using your distribution’s package manager. The exact package name varies by distribution, but is typically xen or xen-hypervisor.

Tip

Check your distribution’s documentation for Xen-specific setup steps. For example, Debian has an xen-system meta-package that installs everything needed.

dom0 needs a Xen-aware kernel, but for most distributions this is rarely something you need to think about: dom0 support has been in mainline Linux since around version 3.0 (2011), so any reasonably current kernel already has it. The one major exception is the RHEL family (RHEL, CentOS Stream, Rocky, Alma): Red Hat has shipped KVM instead of Xen since RHEL 6, and no dom0 support since. If your distribution turns out not to have it, the wiki’s Dom0 Kernels for Xen page has a distribution-by-distribution rundown.

Building from source

If you need a specific version or want to contribute to Xen development, you can build from source. See Building Xen From Source for instructions.

Configuring the bootloader

After installing Xen, you need to configure your bootloader to start the Xen hypervisor instead of the Linux kernel directly. Xen then starts Linux as dom0.

On most distributions, this is handled automatically when you install the Xen package. Check that your bootloader menu includes a Xen entry, and reboot.

After rebooting, verify that Xen is running:

xl info

This should print information about the hypervisor, including the Xen version and the amount of physical memory available.

If you plan to run HVM or PVH guests, also confirm the CPU virtualization extensions are enabled:

xl dmesg | grep -i 'vmx\|svm'

No output usually means the extensions are disabled in the BIOS/UEFI firmware rather than a Xen problem — look for a setting called “Intel VT-x”, “AMD-V”, or “Virtualization Technology”.

Toolstack

The toolstack is the software that manages VMs. The standard toolstack for the Xen Project hypervisor is xl, which is included in the xen-tools package.

Some distributions also support libvirt with Xen, which allows you to use tools like virsh or virt-manager.

For most users, xl is the right choice. It is simple, well-documented, and closely follows Xen’s capabilities. The exception is XCP-ng and XenServer: these are complete platforms built around XAPI rather than plain Xen with a toolstack choice layered on top, so if you installed one of them, use xe (XAPI’s command-line tool) or their GUI tools instead of xl.

Dedicating memory to dom0

By default, dom0 starts with access to all of the host’s memory and gives it back (“balloons down”) as guests are created. It’s better to give dom0 a fixed amount up front instead — ballooning changes the memory total the dom0 kernel calculated its own sizing parameters against at boot, which wastes memory and can affect stability once dom0 has ballooned down a long way.

Set a cap in the hypervisor boot options (in your bootloader config, alongside the Xen entry — typically 1 GB is enough unless dom0 is doing heavy I/O work like backups):

dom0_mem=1024M,max:1024M

Then stop xl from adjusting it automatically by setting autoballoon=0 in /etc/xen/xl.conf, and reboot.

Next steps

Once Xen is running with dom0 active, you can start creating guest VMs. See Managing Guests for how to create and manage guests.