Xen 02 - dom0
Xen on Debian 4 Learning · Previous: The basics of XEN virtualisation · Next: domU
The Slovak original of this document: Xen 02 - dom0 (slovensky).
|=----------------------------------=[ XEN ]=------------------------------=| +---------------------------------------------------------------------------+ | | | XEN - dom0 (vmware) | | Debian 4.0 Etch | | | +---------------------------------------------------------------------------+ |=-------------------------------=[ BH 2007 ]=-----------------------------=|
1. System requirements
CPU
---
* One or more 64bit x86 processor(s)
* minimum - 1.5 GHz
* recommended - 2 GHz or multicore
RAM
---
* minimum - 1 GB
* recommended - 2 GB or more
DISK
----
Locally attached data storage (PATA, SATA, SCSI)
* minimum - 16 GB of disk space
* recommended - 60 GB or more
NETWORK
-------
A 100 Mbit/s network card, or faster.
A gigabit network card is recommended, to speed up the Physical2Virtual conversion and
data transfers on export/import, and for live relocation
of virtual machines.2. Partition layout + parameters
VMWARE - 20 GB disk
-------------------
/boot - 200 MB
swap - 1,5 GB
/root (LVM) - 8 GB
/x1-www (LVM) - 3 GB
/x2-db (LVM) - 3 GB
# cat /etc/fstab
----------------
/dev/mapper/system-root / ext3 defaults,errors=remount-ro 0 1
/dev/sda1 /boot ext3 defaults 0 2
/dev/mapper/system-x1--www /x1-www ext3 defaults 0 2
/dev/mapper/system-x2--db /x2-db ext3 defaults 0 2
/dev/mapper/system-swap none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
---------------- END /etc/fstab3. Install basic software
# apt-get install ssh mc
4. Install XEN
The Debian Etch package repository contains 3 versions of XEN kernels:
----------------------------------------------------------------------
a/ with PAE support (xen-linux-system-2.6.18-5-xen-686)
b/ without PAE support (linux-image-2.6.18-5-xen)
c/ XEN + vserver ()
PAE: http://en.wikipedia.org/wiki/Physical_Address_Extension
When installing the XEN kernel, take care that the right kernel is installed.
If the wrong kernel version is installed, the system will not boot at all and ends with the error message:
'Mismatch between Xen and DOM0 kernel'
a/ Install XEN-PAE (tested)
---------------------------
Although PAE is meant for systems with more than 4 GB of memory we use this kernel, since
the standard Debian kernel is PAE, and using a non-PAE XEN kernel caused a mismatch.
# apt-get install xen-linux-system-2.6.18-5-xen-686
# apt-get install libc6-xen
# init 6
Problem 1 - booting the system with the XEN kernel produced a great many of these messages
------------------------------------------------------------------------------------------
'4gb seg fixup, process sshd (pid 1162), cs:ip 73:008d8cfc'
'printk: 185714 messages suppressed.'
Solution 1 - install the XEN GLIBC (libc6-xen)
----------------------------------------------
# apt-get install libc6-xen
b/ Install XEN without PAE
--------------------------
For a XEN kernel without PAE support these packages have to be installed separately:
- linux-image-2.6.18-5-xen kernel
- xen-utils
- xen-hypervisor
c/ Install XEN + vserver
------------------------
Since we don't want a mess in the system, we won't mix virtualization tools, and so we
won't use this kernel.5. Network - bridge setup
# apt-get install bridge-utils
# nano /etc/xen/xend-config.sxp
-------------------------------
(network-script network-bridge)X. Linkz
XEN on DEBIAN dom0
------------------
http://www.howtoforge.com/debian_etch_xen_3.1
http://www.jejik.com/articles/2007/03/a_test_drive_of_debian_etch_xen/Current practice (checked 2026-10)
noteThe article above is kept as it was written in 2008. This section lists what has changed since and what to do instead today.
- Debian 4.0: Etch reached end of life on 2010-02-15 and gets no security updates. Build the dom0 on the current Debian stable release.
- Xen packages: the article picks between
xen-linux-system-2.6.18-5-xen-686, a non-PAE kernel and a Xen+vserver kernel. Today one metapackage,xen-system-amd64, pulls in the hypervisor and the tools, and the standard Debian kernel boots as dom0, so there is no separate-xen-kernel flavour to match against the hypervisor.
$ # apt install xen-system-amd64 $ # reboot $ # xl info
- 32-bit, PAE and libc6-xen: the PAE choice, the
4gb seg fixupmessages and thelibc6-xenfix belong to 32-bit PV kernels.xen-system-amd64exists for amd64 only, and from Debian 13 there is no i386 kernel or installer at all, so this whole section no longer applies. - Booting: after the install, GRUB 2 gets an entry "Debian GNU/Linux, with Xen hypervisor"; boot that one.
init 6still works,rebootis the usual command. - Bridge:
(network-script network-bridge)in/etc/xen/xend-config.sxpis gone together with xend.xldoes not build the bridge; it expects a bridge namedxenbr0that you define in the distribution's own network configuration (on Debian in/etc/network/interfaces), and the defaultvif-bridgescript attaches each guest interface to it. - Toolstack: every
xmcommand in this series is now anxlcommand; see the "Current practice" section of the first article. - Xen inside VMware: PV guests needed no CPU support, which is why this worked in a VMware guest. PVH and HVM guests use the hardware virtualisation extensions, so inside another hypervisor they need nested virtualisation exposed to the VM.
Sources: