You are hereCreate a new VM on XEN 4

Create a new VM on XEN 4


By julien - Posted on 19 September 2011

For Windows VMs

  • Create a new harddisk in /home/xen_disk (or reuse an existing one)
    dd if=/dev/zero of= /home/xen/domains/win01/disk.img bs=1M count=15096
  • Copy/Paste a domain config file and change basic things:
    • MAC adress
    • disk file
    • vnc settings
    • cd drive on iso...
  • And launch it with a 'xm create win01'

 

For Linux VMs

  • Get an i386 kernel, because I want to run 32 bits DomU on my x64 Dom0 :
    • Download a i386 kernel version
      wget http://ftp.fr.debian.org/debian/pool/main/l/linux-2.6/linux-image-2.6.32-5-xen-686_2.6.32-37_i386.deb
    • Unpack it, without installing it (he don't want to install because not the same arch)
      dpkg -X linux-image-2.6.32-5-xen-686_2.6.32-37_i386.deb /
    • Create the initrd ram fs:
      update-initramfs -c -k 2.6.32-5-xen-686
  • Create your VM with xen-tools:
    xen-create-image --hostname lin01 --dhcp --vcpus 1 --dir /home/xen_disk --arch=i386 --size=15Gb --noswap --memory=1024Mb  --kernel=/boot/vmlinuz-2.6.32-5-xen-686 --initrd /boot/initrd.img-2.6.32-5-xen-686
  • Start it :)
    xm create lin01

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.

More information about formatting options