CentOS 5.1 mit Debian Etch als DomU (Gast) und debootstrap

Unser CentOS 5.1 Basissystem ist in der Architektur x86_64 installiert. Somit sollten wir unsere Gäste in der gleichen Architektur installieren. Allerdings heißt diese unter Debian nicht x86_64 sondern amd64.

FIXME: Überarbeitung dieser Doku!

debootstrap

Installationsvorbereitungen

Wir erzeugen uns eine virtuelle Festplatte, auf die wir später installieren wollen.

dd if=/dev/zero of=/xendomains/etch/xvda.img bs=1024 count=$((8000 * 1024))

Jetzt können wir mittels virt-install das System für unsere Zwecke initialisieren:

virt-install -n etch --ram=500 -f /xendomains/etch/xvda.img --location=http://mirror.intergenia.de/centos/5.1/os/x86_64
Would you like a fully virtualized guest (yes or no)?  This will allow you to run unmodified operating systems. no
 You are going to overwrite file '/xendomains/etch/xvda.img'!
Do you really want to use the file (yes or no)?  y
 Would you like to enable graphics support? (yes or no) no
Starting install...
libvir: Xen error : Domain not found: xenUnifiedDomainLookupByUUID
Retrieving file CentOS...                                       587 kB 00:02 
Retrieving file vmlinuz.. 100% |=========================| 1.8 MB    00:02     
Retrieving file initrd.im 100% |=========================| 5.2 MB    00:06     
libvir: Xen error : Domain not found: xenUnifiedDomainLookupByName
Creating domain...                                                 0 B 00:01 
Bootdata ok (command line is   method=http://mirror.intergenia.de/centos/5.1/os/x86_64)
Linux version 2.6.18-53.el5xen (mockbuild@builder6.centos.org) (gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)) #1 SMP Mon Nov 12 02:46:57 EST 2007
BIOS-provided physical RAM map:
 Xen: 0000000000000000 - 0000000011600000 (usable)
No mptable found.
Built 1 zonelists.  Total pages: 71168
Kernel command line:   method=http://mirror.intergenia.de/centos/5.1/os/x86_64
Initializing CPU#0
PID hash table entries: 2048 (order: 11, 16384 bytes)
Xen reported: 2133.404 MHz processor.
...

Sobald das System angelaufen ist, können wir mit dem CentOS installer noch die Festplatte nach unseren Wünschen partitionieren, dann aber mittels xm destroy etch das Virtuelle System wieder stoppen.

debootstrap debian etch

Wir mounten uns nun das Diskimage.

mkdir -p /mnt/install
lomount -diskimage /xendomains/etch/xvda.img -partition 1 /mnt/install

Hier führen wir unseren debootstrap aus.

$ debootstrap --arch amd64 etch /mnt
I: Retrieving Release
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://ftp.debian.org/debian...
...
I: Base system installed successfully.

Anpassungsarbeiten im chroot.

$ chroot /mnt/install
$ aptitude update
$ aptitude upgrade
$ vi /etc/{fstab,hosts,hostname}
$ vi /etc/network/interfaces
$ vi /etc/modules
# hier xennet einfügen!

Jetzt kopieren wir uns aus einem funktionierenden centos gast /boot und /lib/modules/2.6.18-53.1.4.el5xen, sowie modifizieren wir die /boot/grub/menu.lst so, dass unser System gute Chancen hat in init=/bin/bash zu booten.

Frisch gebootet können wir dann den etch-Kernel installieren.

mount -o rw,remount /
. /etc/profile
modprobe xennet
ifconfig eth0 up
dhclient eth0
aptitude update
aptitude install grub
aptitude install linux-image-xen-amd64

Nach einer weiteren Anpassung von /boot/grub/menu.lst auf den 2.6.18-5-xen-amd64 bootet unser neue Debian Etch Gast einwandfrei.

 
wissen/linux/centos/centos-5.1-xen-und-debian-etch-domu-mittels-virsh-und-debootstrap.txt · Zuletzt geändert: 05.09.2010 20:31
 
Recent changes RSS feed Donate Valid XHTML 1.0 Valid CSS Recent cached RSS feed cacert-signed web site: inhalt.serviert.de