If you can't access the outside world for some reason, use a dummy bridge. On the dom0,

brctl addbr dummybr0

ifconfig dummybr0 10.1.1.1 netmask 255.255.255.0 up

and use that vif for the guest,

vif = [ 'vifname=vcentos4x64.0,bridge=dummybr0' ]

Installation settings

Launch the guest to start the installation process,

cd /data/guests/centos5x64/

xm cr centos5x64 -c

#xm cr centos4x64 -c

During installation, if you choose FTP installation, e.g.,

site: ftp.free.fr

folder: /mirrors/ftp.centos.org/5.7/os/x86_64

#folder: /mirrors/ftp.centos.org/4.8/os/x86_64

press OK or F12.

Note. the kernel argument for pygrub (by default),

console=xvc0

When prompted for reboot, simply shutdown the guest from the dom0,

xm shu centos5x64

#xm shu centos4x64

otherwise you'll have to 'xm destroy' it when it prompts for a new install... You can now comment out the kernel and installer ramdisk,

#kernel= "vmlinuz"

#ramdisk = "initrd.img"

add pygrub instead,

bootloader = "/usr/bin/pygrub"

Note. it's preferable to use pygrub to make sure "/lib" is in sync with the kernel inside the guest. It's also preferable to make a clean cut separation between dom0 and guests : to enter into guest's single user mode, you do as usual using grub (start the guest with xm create -c do you get there in time before the timeout).

Post-installation

Disable the hardware clock,

cd /sbin/

ls -l hwclock*

mv hwclock hwclock.dist

touch hwclock

chmod +x hwclock

Note. otherwise we could get that error,

Cannot access the Hardware Clock via any known method.

Use the --debug option to see the details of our search for an access method.