#> aptitude install xen-hypervisor-4.0-amd64 linux-image-xen-amd64 xen-tools
Sqeeuze use Grub 2 - the defaults are wrong for Xen.
Xen hypervisor should be the first entry, so you should do this:
#> mv /etc/grub.d/10_linux /etc/grub.d/100_linux
After that disable the OS prober, so that you don’t have entries for virtual machines installed on a LVM partition.
#> echo "GRUB_DISABLE_OS_PROBER=true" >> /etc/default/grub
Xen tries to save-state the VM’s when doing Dom0 shutdown.
This save/restore has never been successful for me, so I disable it in /etc/default/xendomains to make sure machines gets shut down too:
Enable the network bridge in /etc/xen/xend-config.sxp (uncomment existing line).
I also set some other useful params (for me):
Add independent wallclocl in sysctl dom0
#> echo xen.independent_wallclock=1 >> /etc/sysctl.conf
and also in the domUs. Setup ntpdate update at 1hour for example in domUs.
This will save you a lot of clocksync headachecs.
Config /etc/xen-tools/xen-tools.conf contains default values the xen-create-image script will use. Most important are:
# Virtual machine disks are created as logical volumes in volume group universe (LVM storage is much faster than file)
lvm = vg001
install-method = debootstrap
size = 20Gb # Disk image size.
memory = 256Mb # Memory size
swap = 4Gb # Swap size
fs = ext3 # use the EXT3 filesystem for the disk image.
dist = `xt-guess-suite-and-mirror --suite` # Default distribution to install.
gateway = 18.104.22.168
netmask = 255.255.255.0
# When creating an image, interactively setup root password
passwd = 1
# I think this option was this per default, but it doesn't hurt to mention.
mirror = `xt-guess-suite-and-mirror --mirror`
mirror_squeeze = http://ftp.bg.debian.org/debian/
# let xen-create-image use pygrub, so that the grub from the VM is used, which means you no longer need to store kernels outside the VM's. Keeps this very flexible.
Script to create vms (copied from http://blog.bigsmoke.us/):
if [ -z "$hostname" -o -z "$ip" -o -z "$dist" ]; then
echo "No dist, hostname or ip specified"
echo "Usage: $0 dist hostname ip"
# --scsi is specified because when creating maverick for instance, the xvda disk that is used can't be accessed.
# The --scsi flag causes names like sda to be used.
xen-create-image --hostname $hostname --ip $ip --vcpus 2 --pygrub --dist $dist
Usage of the script should be simple. When creating a VM named ‘host’, start it and attach console:
xm create -c /etc/xen/host.cfg
You can go back to Dom0 console with ctrl-].
Place a symlink in /etc/xen/auto to start the VM on boot.
As a sidenote: when creating a lenny, the script installs a xen kernel in the VM.
When installing maverick, it installs a normal kernel.
Normals kernels since version 2.6.32 (I believe) support pv_ops, meaning they can run on hypervisors like Xen’s.
TrackbacksTrackback specific URI for this entry
This link is not meant to be clicked. It contains the trackback URI for this entry. You can use this URI to send ping- & trackbacks from your own blog to this entry. To copy the link, right click and select "Copy Shortcut" in Internet Explorer or "Copy Link Location" in Mozilla.