This article describes how to successfully migrate a physical host running Windows 2000 to a Xen 3.0.3 DomU. The Xen Dom0 is running Linux CentOS 5.2 on Intel Xeon CPUs with VT extensions. Other online discussions and examples led me to believe this would NOT work unless I was using Xen 3.0.4 or later. The process was fairly simple. The process works with Windows 2000 Professional as well as Windows 2000 Server variants.
IMPORTANT: I assume you can already create and view other DomU virtual hosts on your Xen server. I also assume you are using a system that supports Intel-VT extensions and that those extensions are properly enabled. Keep in mind that the CPU, the motherboard, and the BIOS all need to support VT extensions. You may also need to enable VT extensions within your BIOS.
First, prep your server as per Microsoft KB 314082. You will save the entire block of registry changes into a “.reg” file and merge with your own registry so that Win2K will recognize your Xen IDE adapter. You will extract the IDE related driver files that they list (Atapi.sys, Intelide.sys, Pciide.sys, and Pciidex.sys) into “system32\drivers\”. I installed a barebones Win2K PRO test DomU before spending a lot of time attempting a migration, so I simply copied the listed driver files from that working DomU to the physical system we were about to migrate. I only copied files that did not already exist. I did not overwite any existing files.
Second, you will want to copy each hard disk in your WIN2K system to an image of equal size. Our WIN2K system had a 20GB hard disk, which we cloned to a 20GB image file on the Xen server. If your WIN2K system has large disks and a lot of unnecessary disk space (ie: 500GB, of which 450GB is free), consider using some sort of tool to migrate the system to a smaller disk (ie: 100GB, of which 50GB would be free) before proceeding. Otherwise, the disk image you copy to your Xen server will be wasting a lot of space!
Our system had a single hard disk, so we only had to create one image using the command below. Repeat this for each hard disk in your system. In our example below, the hard disk from the original system was presented as “/dev/hde”, and the image was saved to “/vservers/win2k-example/win2k.img”. Adjust your paths accordingy. Copying our 20GB disk to an image took just over 10 minutes.
time dd if=/dev/hde of=/vservers/win2k-example/win2k.img bs=4k
Lastly, we will create the file containing settings for this DomU. Our file was located at “/etc/xen/win2k-example” and had the following contents. I’m not sure that all of these settings are relevant, but this working config should give you a good starting point.
import os, re arch = os.uname() if re.search('64', arch): arch_libdir = 'lib64' else: arch_libdir = 'lib' kernel = "/usr/lib/xen/boot/hvmloader" builder='hvm' memory = 512 shadow_memory = 8 name = "win2k-example" vif = [ 'type=ioemu, bridge=xenbr0' ] vcpus=1 disk = [ "file:/vservers/win2k-example/win2k.img,hda,w", "phy:/dev/hda,hdc:cdrom,r" ] vnc = 1 vncunused = 1 vncconsole=1 boot="dc" #boot="c" acpi = 1 apic = 1 device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm' stdvga=0 serial='pty' usbdevice='tablet'
Now we can boot our new Windows 2000 DomU virtual host. Be prepared to reconfigure TCP/IP settings for your “new” network card and to resolve other driver issues after the migration.
xm create win2k-example
2008/09/14 – Jason Klein