Howto setup a Xen user domain using debootstrap

Most commonly people use the xen-tools package for creating virtual servers for Xen in Debian and Ubuntu. My major complaint with xen-tools is that the virtual servers are created with 1 file per partition rather than 1 file per disk. Using 1 file per disk allows users controlling the domains to resize their partitions if they wish to do so and is far more compatible with other virtualization solutions. For these reasons I have standardized on 1 file per disk. It is still possible, and perhaps preferable, to use xen-tools and then simply convert the file after the creation process. However I set out to avoid using xen-tools and came up with this method. I’m not sure if I will continue to use it as xen-tools handles a lot of setup tasks that this does not but it is a good method to be aware of in making the decision about what process is best.

  • dd if=/dev/zero of=superhost.img bs=1M count=4K
  • xm block-attach 0 tap:aio:/xen-hosts/superhost.img /dev/xvda w
  • cfdisk /dev/xvda
  • mkfs.ext3 /dev/xvda1
  • mount /dev/xvda1 /mnt/xvda1/
  • debootstrap --include=grub,nano,linux-image-xen,nano,puppet,ssh --components=main,universe hardy /mnt/xvda1
    • installation problems can sometimes be fixed at this point by running chroot /mnt/xvda1 and using apt-get.
  • umount /mnt/xvda1
  • xm block-list 0
    • To get the vdev id
  • xm block-detach 0 51712
  • edit xen cfg file
  • bootup virtual machine and setup networking, hosts, etc

Trackback URL for this post:

http://hightechsorcery.com/trackback/189
Creative Commons License Except where otherwise noted, content on this site is licensed under a Creative Commons by-nc-sa 3.0 License