Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Xen host system based on Debian Squeeze, and installed xen-tools. I would like to setup a CentOS domU using xen-create-image. xen-tools already 'knows' of CentOS-5, but I cannot seem to get xen-create-image working correctly. I have trouble finding out the necessary parameters I need to pass to xen-create-image (especially mirror?). And, of course, it would be nicer to use CentOS-6.

So, how do I create a CentOS-6 (or 5) domU on a Debian Squeeze dom0 (both x86_64), preferably using xen-create-image?

share|improve this question
1  
You could try rinse (rinse - RPM installation environment) –  Todd Deshane Jan 10 '12 at 3:21

1 Answer 1

This took a while to trudge through and shouldn't die in my notes. This is for Debian 6/Squeeze, xen4 on amd64 hardware.

  1. Edit /etc/rinse/centos-5.packages and add the following items (probably alpha sorted, but I haven't played around with this):
    • authconfig
    • chkconfig
    • libuser
    • passwd
    • python-libs
  2. Create the base image: xen-create-image --hostname=foo.example.com --ip=1.2.3.4 --gateway=1.2.3.1 --netmask=255.255.255.0 --install-method=rinse --dist=centos-5 --mirror=http://mirror.centos.org/centos/5/os/x86_64/CentOS/ --arch=i386
    • The ---arch=i386 is required, x86_64 is a non-starter for some reason.
    • Passing --install-method=rinse is required.
    • I'm not sure that the --mirror flag is required.
  3. Create a temp dir to mount the image: mkdir -m 0700 /tmp/img_mnt
  4. Mount the image: mount -o loop /home/xen/images/domains/foo.example.com/disk.img /tmp/img_mnt
  5. chroot(1) to the new jail: chroot /tmp/img_mnt /bin/bash
  6. Enable/disable services:
    1. chkconfig iscsi off
    2. chkconfig iscsid off
    3. chkconfig rsyslogd on - Recommended for debugging
  7. Setup/convert to shadow passwords: pwconv
  8. Change the root password: passwd root
  9. Exit the chroot(1)`ed environment: exit
  10. unmount(1) the loopback image: umount /tmp/img_tmp
  11. Start the VM: xm create -c foo.example.com.cfg
  12. Login.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.