Debian Squeeze (6.0) Xen 4.0.1 VM Server with HVM on LV

Installing Xen 4.0.1 onto Debian Squeeze has been a huge issue for me.  Mostly, I ran into problems because I’m a xen novice and really didn’t understand the ins and outs of the xen packages, but also because installing and manipulating xen in Lenny was so easy and manipulating xen in Squeeze was….

  1. I installed my Debian Squeeze base (aka. Dom0) in the normal fashion.  I ended up combining the instructions I found at this webdevster link, and this howtoforge link .  The webdevster link was very useful for general install pearls (aka. gotchas), but I elected to ignore the vnc and static ip address sections.  I wanted a gnome desktop w/ vnc and I also needed dhcp instead of a statically assigned ip address (my dd-wrt router assigns the static ip addresses).  Finally, I wanted to install at least one windows 7 HVM, and the network bridge example in the webdevster tutorial never worked for my windows host (see my solution below).
  2. The webdevster link shows how to install a VM onto a logical volume, but if you really want to understand how LVM and logical volumes work, this howtoforge link is fantastic.
  3. For windows specific Xen HVM instructions I found this howtoforge tutorial.  This xen HVM tutorial is for Debian Lenny (i.e. not Squeeze), but it does document the process of creating a windows install disk iso, and its respective xen configuration.
  4. The default network script is a huge issue for an automated install:  I finally found some help on this page. Apparently, the network-script that gets used by the xend-config.sxp file to create a bridge for use by the virtual interfaces that get created when you build a virtual machine leaves much to be desired.  The big issue that I had was that I could install a HVM virtual machine (VM), but the VM could only communicate with the host server (i.e. Dom0).  It was really strange, but thankfully some xen guru knew about this issue and just created their own network bridge (i.e. they didn’t rely on the “network-script” located in your /etc/xen/scripts folder. (Of note: others seem to be having the same issues. See: xen-users list-serve )  Creating a network bridge is really pretty easy as it only requires a few lines in your /etc/network/interfaces file.   Below is the “interfaces” file I’m currently using.
    # The loopback network interface
    auto lo
    iface lo inet loopback
    # The primary network interface
    #allow-hotplug eth0
    #auto eth0
    #iface eth0 inet dhcp
    #Added by EBJ 2/27/2011
    auto xen-br0
    #iface xen-br0 inet static
    iface xen-br0 inet dhcp
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0

    Notice that I have commented out the static ip sections. I use dd-wrt to assign my ip addresses according to mac addresses so I like have non-static ips. Still the “ServerFault” example I found used static ip addresses.

  5. Comment out “network-script line in /etc/xen/xend-config.sxp file and include your bridge name (e.g. xen-br0) in the /etc/xen/xend-config.sxp “vif script”
  6. #added by EBJ 2/28/11
    (xend-http-server yes)
    #(xend-unix-server no)
    #added by EBJ
    (xend-unix-server yes)
    #added by EBJ
    (vif-script vif-bridge bridge=xen-br0)
    #added by EBJ
    #(network-script 'network-bridge antispoof=yes' )
    (dom0-min-mem 196)
    (enable-dom0-ballooning yes)
    (total_available_memory 0)
    (dom0-cpus 0)
    (vnc-listen '')
    (vncpasswd 'somePassword or empty string')
  7. The xen configuration file I ended up using is below:
  8. import os, re
    arch = os.uname()[4]
    kernel = "/usr/lib/xen-default/boot/hvmloader"
    memory = 1024
    shadow_memory = 8
    name = "xenwin7lv"
    vif=['type=ioemu, bridge=xen-br0,  mac=00:16:3e:00:00:01' ]
    # The number of cpus guest platform has, default=1
    # for a LVM use the location of your LV
    disk = [ 'phy:/dev/xen4lvg/win7lv,ioemu:hda,w', 'file:/RAID1A/xen/windows7.iso,ioemu:hdc:cdrom,r' ]
    #device_model = '/usr/lib/xen-default/bin/qemu-dm'
    device_model = '/usr/lib64/xen-4.0/bin/qemu-dm'
    # boot on floppy (a), hard disk (c) or CD-ROM (d)
    # default: hard disk, cd-rom, floppy
  9. TODO add VM creation/maniup instructions
This entry was posted in 64 bit, Debian, Linux, networking, Squeeze, Uncategorized, Virtualization, Windows, Xen. Bookmark the permalink.

One Response to Debian Squeeze (6.0) Xen 4.0.1 VM Server with HVM on LV

  1. Hi,

    I don’t think the above are good instructions, and I would recommend anyone to *NOT* do like that. Debian uses eth0 as the name for the bridge, and there is absolutely no reasons to change that. There is absolutely nothing to edit in the xend-config.sxp but adding something like:

    (network-script ‘network-bridge antispoof=yes’)

    and THAT IS IT. The defaults in Debian just work ™. Don’t touch the vif-script either.

Leave a Reply

Your email address will not be published. Required fields are marked *