Archives pour la catégorie «Debian»

Xen dom0 on Debian Squeeze with CentOS domU

Update : With Cen­tOS 5.6, you need upda­ted rinse package. You can  pick up ver­sion >= 1.8.1 from Debian Tes­ting repo­si­tory. Other­wise, you can add libu­ser, passwd and python-libs to /etc/rinse/centos-5.packages inside dom0 and run “cp /etc/modprobe.d/modprobe.conf.dist /etc/modprobe.conf” inside domU, just before the mki­ni­trd step.

Here are some hints for set­ting up Xen dom0 (ser­ver) on Debian Squeeze and run­ning Cen­tOS domU (guest in Xen ter­mi­no­logy) on it. This pro­ce­dure makes use of rinse tool, a deboots­trap equi­va­lent for CentOS.

First, fol­low this Debian wiki page for basic setup of the ser­ver. Debian recomm­mends to set up a net­work bridge by fol­lo­wing the ins­truc­tions in the man­page for bridge-utils-interfaces(5) ins­tead of uncommenting

(network-script network-bridge)

in /etc/xen/xend-config.sxp.
You are now ready to create the image:

xen-create-image --hostname hostname.yourdomain --ip 192.168.0.1 --scsi --vcpus 2 --pygrub\
 --install-method=rinse --dist centos-5

You can now mount the xen domU par­ti­tion, I will assume you use LVM for domU:

mount /dev/vg_xen/hostname.yourdomain-disk /mnt

We also need those pseudo file systems:

mount -o bind /proc /mnt/proc
mount -o bind /sys /mnt/sys

Then, chroot into it:

chroot /mnt
touch /etc/mtab
touch /etc/fstab

Ins­tall Cen­tOS Xen kernel:

yum install kernel-xen

Rebuild ini­trd with requi­red Xen dri­ver (block and net­work device)

mkinitrd --with=xenblk --with=xennet --preload=xenblk --preload=xennet\
 -f /boot/initrd-2.6.18-194.26.1.el5xen.img 2.6.18-194.26.1.el5xen

Create /boot/grub/menu.lst:

# WARNING : Don't forget to update this when you upgrade kernel !
# You can also exclude kernel-xen from updates by putting
# exclude=kernel-xen in in [main] in yum.conf

default=0
timeout=5
title CentOS (2.6.18-194.26.1.el5xen)
kernel        /boot/vmlinuz-2.6.18-194.26.1.el5xen
initrd        /boot/initrd-2.6.18-194.26.1.el5xen.img

Open the ini­t­tab file and add the fol­lo­wing line to it

co:2345:respawn:/sbin/mingetty console

and com­ment the fol­lo­wing lines as shown below.

#1:2345:respawn:/sbin/mingetty tty1
#2:2345:respawn:/sbin/mingetty tty2
#3:2345:respawn:/sbin/mingetty tty3
#4:2345:respawn:/sbin/mingetty tty4
#5:2345:respawn:/sbin/mingetty tty5
#6:2345:respawn:/sbin/mingetty tty6

If that does not work, try repla­cing tty with console to the line spe­ci­fying getty or min­getty like given below.

5:2345:respawn:/sbin/mingetty console

Set cor­rect timezone:

ln -sf /usr/share/zoneinfo/Europe/Brussels /etc/localtime

Ins­tall root bash config files:

cp -p /etc/skel/.* /root

Exit chroot:

<Ctrl-D>

Unmount domU file systems:

umount /mnt/proc
umount /mnt/sys
umount /mnt

Boot the domU with “-c” option to open console:

xm create -c /etc/xen/hostname.yourdomain.cfg

You can exit console with “Ctrl + ]”.
You can enter console again with

xm console hostname.yourdomain

Ins­tall impor­tant mis­sing packages:

yum install bind-utils file glibc man man-pages iptables mailx mc openssh-clients tcpdump telnet\
    traceroute sysklogd zip unzip wget vixie-cron xauth

Enable and start syslog:

chkconfig syslog on
/etc/init.d/syslog start

Enable and start crond:

chkconfig crond on
/etc/init.d/crond start

You can ins­tall option­nal package groups as needed:

yum grouplist
yum groupinstall "Development Libraries" "Development Tools" "X Software Development"\
    "Legacy Software Development"

To list Xen dom:

xm list

To stop domU:

xm destroy hostname.yourdomain

Apt-Pinning demystified

Here is a very good expla­na­tion how to do apt-pinning with Debian like OS. Apt-Pinning allows you to mix dif­ferent apt sources without bra­king your system.

Publication de Debian 5.0 Lenny

Après 22 mois de ges­ta­tion, la nou­velle Debian stable “Lenny” est sor­tie ce samedi 14 février 2009. Elle suc­cède ainsi à Etch qui est marquée comme “oldstable”.

Le cycle de déve­lop­pe­ment de la pro­chaine ver­sion 6.0 bap­ti­sée “Squeeze” (toujours en réfé­rence aux per­son­nages de Toy Story) a déjà débuté. C’est le moment d’y appor­ter toutes les modi­fi­ca­tions dont vous rêvez !

Vous pou­vez consul­ter l’annonce offi­cielle ainsi que les notes de publi­ca­tion sur le site de Debian.

Debian

Support officiel de OpenVZ dans Debian Lenny

Debian Lenny sup­porte main­te­nant offi­ciel­le­ment OpenVZ en plus de VSer­ver déjà pré­sent dans Etch.  Des noyaux  OpenVZ 32 et 64 bits sont inclus. L’avantage d’un sys­tème Debian réside prin­ci­pa­le­ment dans la faci­lité de créa­tion des tem­plates via deboots­trap.

Pour rap­pel :
Deboots­trap is a tool which will ins­tall a Debian base sys­tem into a sub­di­rec­tory of ano­ther, already ins­tal­led sys­tem. It doesn’t require an ins­tall cd, just access to a Debian Repo­si­tory. It can also be ins­tal­led and run from ano­ther os, so, for ins­tance, you can use deboots­trap to ins­tall debian onto an unu­sed par­ti­tion from a run­ning Gen­too ins­tall.
http://wiki.debian.org/Debootstrap

Il est pos­sible d’installer dif­fé­rentes ver­sions du sys­tème avec deboos­trap (old­stable, stable, tes­ting, unstable).

Lenny devrait pas­ser en stable dans le cou­rant du mois d’octobre.

Heure système décalée

Symp­tômes : Après avoir véri­fié votre zone horaire avec

#cat /etc/timezone

ainsi que l’état de la variable “UTC” dans /etc/default/rcS, l’heure sys­tème est toujours décalée.

Le pro­blème peut venir des scripts d’initialisation invoquant la com­mande hwclock, ser­vant à lire et à sau­ve­gar­der l’horloge de la machine.

Méthode de test :

#hwclock --localtime

Si vous obte­nez une erreur de ce genre à la place de l’heure :

select() to /dev/rtc to wait for clock tick timed out

Rées­sayez avec :

#hwclock --directisa --localtime

Si cela fonc­tionne, il faut modi­fier les scripts d’initialisation :

   Edit the files
   /etc/init.d/hwclock.sh
   /etc/init.d/hwclockfirst.sh
   and change the line (about line #23):

   HWCLOCKPARS=

   to read:

   HWCLOCKPARS="--directisa"

Expli­ca­tion de l’option “–directisa” :

--directisa   is  meaningful  only on an ISA machine or an Alpha (which imple‐
              ments enough of ISA to be, roughly speaking, an ISA machine  for
              hwclock’s  purposes).   For  other  machines,  it has no effect.
              This option tells hwclock to use explicit  I/O  instructions  to
              access  the  Hardware  Clock.  Without this option, hwclock will
              try to use the /dev/rtc device (which it assumes to be driven by
              the rtc device driver).  If it is unable to open the device (for
              read), it will use the explicit I/O instructions anyway.

              The rtc device driver was new in Linux Release 2.