Debian guest on sles10 host
Successfully deployed a debian sarge guest on top of a sles10 installation.
It went quite easy , here are the steps (briefly)
- mkdir /var/li/xen/images/vm1
- dd if=/dev/zero of=/var/lib/xen/images/vm1/hda
- mkfs.ext3 /var/lib/xen/images/vm1/hda
- repeat the previous steps to create other partitions like swap (mkswap)
- mkdir /mnt/tmp-root
- mount -o loop /var/lib/xen/images/vm1/hda /mnt/tmp-root
- install debootstrap: rpm -i http://leo.unstable.be/projects/sles10/xen/debootstrap-0.2.45-1.2.i386.rpm
- debootstrap –arch i386 sarge /mnt/tmp-root ftp://ftp.debian.org/debian/ ( minus minus arch)
- chroot /mnt/tmp-root
- make sure you configure networking , hostnames , fstab , apt inside this chroot
- files to check and modify: /etc/hosts , /etc/hostname , /etc/fstab , /etc/network/interfaces , /etc/apt/sources.list
- install module-init-tools
- exit from the chroot
- cp /boot/initrd-xen /mnt/tmp-root/boot
- cp /boot/vmlinuz-xen /mnt/tmp-root/boot
- cp -r /lib/modules/`uname-r` /mnt/tmp-root/lib/modules
- Offcourse your initrd should use the correct root device (can be re-created with mkinitrd)
- create a xen config under /etc/xen/vm
- make sure your configuration uses the right disk file and the correct bootloader line
- launch your vm for the first time with xm create -c /etc/xen/vm/vm1
That’s about it.
November 8th, 2006 - Posted in SLES, xen | | 0 Comments
Novell and Microsoft Collaborate
For those who didn’t heard the news yet:
http://www.novell.com/linux/microsoft/
And even more interesting:
the FAQ
November 3rd, 2006 - Posted in Novell | | 0 Comments
Xen physical 2 virtual
I just hacked up a shell script which makes it possible to create a virtual machine out of
your running physical machine. After running this script you have the virtual disk and a configuration which can be started
with xm create -c /etc/xen/vm/
This is currently only tested with sles10 but with some small modifications it should also work in other environments.
Following steps are done by the script.
1. Check on which partition your / is mounted
2. Check which partition is your swap partition
3. Check sizes of both partitions and see if there is still enough availble space to create the virtual disk
4. Create a virtual disk image
5. Create partitions+filesystem on the virtual disk image
6. Copy all your data of your physical machine to the virtual disk image
7. Generate a xen configuration for your machine
This is still the first version of the script so there are still some ‘known issues’
- you already need to have the xen-kernel installed on your physical machine
- it only creates a / and a swap partition , no other partitions yet
- it (temp) creates the image file under /tmp before moving it to /var/lib/xen/images
- does not work with lvm (only loop devices)
You can find the script here
November 2nd, 2006 - Posted in SLES, xen | | 0 Comments
