Debian domU on CentOS 5.4 Dom0 using debootstrap


I’m hoping to essentially follow this: bderzhavets.wordpress.com/2009/05/02/debootstrap-ubuntu-jaunty-pv-domu-at-xen-331-f10-dom0-kernel-2630-rc3-tip/

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 http://mirror.nus.edu.sg/Debian because my local mirror (by local, I mean Singapore) is mirror.nus.edu.sg

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 (orangesquash.org.uk/2009/02/16/now-running-lenny-and-a-workaround-for-a-grub-bug/), run echo '(hd0) /dev/xvda' > /boot/grub/device.map && 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

and
echo "debianlenny" > /etc/hostname && echo "127.0.0.1 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.
===
Links:
wiki.debian.org/Xen
www.debian.org/releases/stable/i386/apds03.html
wiki.debian.org/PyGrub
74.125.153.132/search?q=cache:gFoX17gLEs4J:ac3bf1.org/2010/03/12/lenny-domu-on-xen-with-debootstrap/+debootstrap+lenny&cd=8&hl=en&ct=clnk&gl=sg&client=firefox-a

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

    Fresh boot from setup:
    [root@dom0 ~]# 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
    done.
    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)
    done.
    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 www.isc.org/sw/dhcp/

    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 255.255.255.255 port 67 interval 3
    DHCPOFFER from 192.168.1.1
    DHCPREQUEST on eth0 to 255.255.255.255 port 67
    DHCPACK from 192.168.1.1
    bound to 192.168.1.149 — renewal in 37907 seconds.
    done.
    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: old.nabble.com/Unable-to-set-system-clock-on-domU-td22042252.html

    Also, the missing hardware should have the modules unloaded, or the kernel recompiled without support for the absent hardware. (compile guide at www.debianadmin.com/step-by-step-tutorial-howto-compile-kernel-in-debian-5-0-lenny.html and wiki.debian.org/HowToRebuildAnOfficialDebianKernelPackage)

(will not be published)