Debian domU on CentOS 5.4 Dom0 using debootstrap

I’m hoping to essentially follow this:

Essentially, create LVs and format them (look at the previous posts for the how to), and have debootstrap installed on the CentOS host.

Mount the LV in which you’re going to install Debian on by running mount <LV location> <mount location>. I did mount /dev/mapper/debian /mnt/debian.

The command to run is debootstrap --arch ARCH lenny <mount location of LV> <mirror to download from>. For me, this should be debootstrap --arch i386 lenny /mnt/debian because my local mirror (by local, I mean Singapore) is

chroot to the install root.

Add 7:2345:respawn:/sbin/getty 38400 hvc0 to /etc/inittab. (While you’re at it, you can comment out the rest of the console entries – they’ll remain unused.)

Add the Xen drive config to /etc/fstab:
proc /proc proc defaults 0 0
/dev/xvda1 / ext3 defaults,errors=remount-ro 0 1
/dev/xvdb1 none swap defaults 0 0

Mount /proc. (So there are no complaints later about /proc/modules not existing.)

To get around the grub bug (, run echo '(hd0) /dev/xvda' > /boot/grub/ && cd /dev && mknod xvda b 202 0. (If you have your disk mounted as something other than /dev/xvda, then replace xvda with your appropriate drive location.)

Run apt-get install locales and dpkg-reconfigure locales to build the correct language support for your region. (Gets around the “locale not detected” error messages if you didn’t run export LANG=C.)

Create networking info in /etc/network/interfaces:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

echo "debianlenny" > /etc/hostname && echo " localhost localhost.localdomain debianlenny" > /etc/hosts

Run aptitude install libc6-xen

Run aptitude install linux-image-xen-ARCH grub (To get the kernel installed and grub – in order to use PyGrub. ;))

Run aptitude install openssh-server screen (Personal preference. =))

To-do: Kill the wallclock stuff.

  1. #1 by kyl191 on April 20, 2010 - 6:59 am

    Fresh boot from setup:
    [[email protected] ~]# xm create -c debian
    Using config file “/etc/xen/debian”.
    Started domain DebianLenny5.04
    [ 0.147222] PCI: Fatal: No config space access function found
    [ 0.260892] i8042.c: No controller found.
    Loading, please wait…
    FATAL: Error inserting fan (/lib/modules/2.6.26-2-xen-686/kernel/drivers/acpi/fan.ko): No such device
    WARNING: Error inserting processor (/lib/modules/2.6.26-2-xen-686/kernel/drivers/acpi/processor.ko): No such device
    FATAL: Error inserting thermal (/lib/modules/2.6.26-2-xen-686/kernel/drivers/acpi/thermal.ko): Unknown symbol in module, or unknown parameter (see dmesg)
    INIT: version 2.86 booting
    Starting the hotplug events dispatcher: udevd.
    Synthesizing the initial hotplug events…done.
    Waiting for /dev to be fully populated…done.
    Setting the system clock.
    Unable to set System Clock to: Tue Apr 20 14:56:20 UTC 2010 (warning).
    Activating swap…done.
    Checking root file system…fsck 1.41.3 (12-Oct-2008)
    /dev/xvda1: clean, 18231/1310720 files, 169546/2621440 blocks
    Setting the system clock.
    Unable to set System Clock to: Tue Apr 20 14:56:24 UTC 2010 (warning).
    Cleaning up ifupdown….
    Loading kernel modules…done.
    Checking file systems…fsck 1.41.3 (12-Oct-2008)
    Setting kernel variables (/etc/sysctl.conf)…done.
    Mounting local filesystems…done.
    Activating swapfile swap…done.
    Setting up networking….
    Configuring network interfaces…Internet Systems Consortium DHCP Client V3.1.1
    Copyright 2004-2008 Internet Systems Consortium.
    All rights reserved.
    For info, please visit

    Listening on LPF/eth0/00:16:3e:45:56:68
    Sending on LPF/eth0/00:16:3e:45:56:68
    Sending on Socket/fallback
    DHCPDISCOVER on eth0 to port 67 interval 3
    DHCPOFFER from
    DHCPREQUEST on eth0 to port 67
    DHCPACK from
    bound to — renewal in 37907 seconds.
    INIT: Entering runlevel: 2
    Starting enhanced syslogd: rsyslogd.
    Starting OpenBSD Secure Shell server: sshd.
    Starting periodic command scheduler: crond.

    Debian GNU/Linux 5.0 debianlenny hvc0

    debianlenny login:

  2. #2 by kyl191 on April 20, 2010 - 11:35 pm

    Re the unable to set system clock bit:

    Also, the missing hardware should have the modules unloaded, or the kernel recompiled without support for the absent hardware. (compile guide at and

(will not be published)