Xen templates

Shell Script (Bash) posted 5 months ago by christian

Description here…

   1  # Docs
   2  http://wiki.debian.org/Xen?highlight=((DebianInstaller|Xen))#DomU.28guest.29
   3  
   4  # 20 Gb disk image
   5  dd if=/dev/zero of=/srv/xen/mailserver.img oflag=direct bs=1M seek=20470 count=1
   6  
   7  # Copy template
   8  cp template.cfg domu.cfg
   9  
  10  # Edit template
  11  xxx
  12  
  13  # Start domU
  14  xm create -c domu.cfg

Tagged xen, template

Resizing a Xen disk image partition

Shell Script (Bash) posted about 1 year ago by christian

   1  # Stop & backup
   2  xm shutdown sandbox
   3  cp -a sandbox/ sandbox.bk
   4  
   5  # Verify MD5 sum
   6  md5sum sandbox/disk.img 
   7  4976347006df34843d29c939b5fc3742  sandbox/disk.img
   8  md5sum sandbox.bk/disk.img 
   9  4976347006df34843d29c939b5fc3742  sandbox.bk/disk.img
  10  
  11  # Create a 5Gb temp file
  12  dd if=/dev/zero of=Tempfile bs=1024 count=5000000
  13  
  14  # Append it to the existing image
  15  cat Tempfile >> disk.img
  16  rm Tempfile
  17  
  18  # Resize the partition
  19  resize2fs -f disk.img
  20  
  21  # Check partition & start domU
  22  fsck.ext3 disk.img
  23  xm create -c sandbox.cfg

Tagged xen, disk, image, resize

Xen DomU maintenance from Dom0

Shell Script (Bash) posted over 2 years ago by christian

   1  xm shutdown xyz
   2  mount -o loop disk.img /mnt/os-image/
   3  chroot /mnt/os-image/
   4  
   5  # Do your stuff
   6  
   7  exit
   8  umount /mnt/os-image

Tagged xen, domu, dom0, maintenance

Detach from Xen console with Finnish keyboard mapping

Shell Script (Bash) posted over 2 years ago by marko

Using this key combination on a system having Finnish keyboard mapping you can detach from a xen console.

   1  CTRL + Alt Gr + 9

Tagged xen, console, detach, suomalainen näppäimistökartta

Multiple IP addresses on a Xen VM

Shell Script (Bash) posted over 2 years ago by marko

Xen VM’s support up to three IP addresses. Just give them as parameters when you create the image. There will be one interface within the Xen and the other IP’s are mapped to interface aliases.

   1  xen-create-image ... --ip=10.0.0.44 --ip=10.0.0.45 ...

Tagged xen, multiple ip's