CyberTek - the future at the present!
Google

Convert Windows 2003 guest from VMware to XEN

Posted by: admin (Jan 28)

The process of converting an image of windows from VMware to XEN is fast enough, the obstacles are to be considered pollibili few. The most important is to identify the mapping of the disk in VMware. The possibilities are two, or as a SCSI or IDE, converting the image is possible that a Windows guest does not work more xchè does not support the XEN virtual hardware, more information is available on Microsoft kb314082.

If you are sure to have a mapping to an IDE device, you can proceed to conversion. To make the conversion server "vmware-vdiskmanager" with this program will get a VMWare VMDK file used for conversion. This tool is present in VMWare 5.0 and VMWare Server 1.0. The method is applicable with some modifications to VMWare ESX.

The file extension. Vmdk is used to describe your virtual disk to VMware:

  1. The lone. Vmdk file that is rather tiny and contains a numer of lines of text describing the geometry and component series of files that comprise the whole. Vmdk.
  2. The first. Vmdk file in a series of 2G segmented files named with trailing -0001 style numbering,
  3. The last "snapshot". Vmdk file in a series (again, named with trailing -00001 style named files).
  4. The latest "REDO". Vmdk file in a series of snapshots.

There is more to say about the file. Vmdk, but for our purposes this is enough. Now we proceed by identifying the file. "Vmx" parameter with the line:

scsi0: 0.fileName = windows2003.vmdk

or

ide0: 0.fileName = windows2003.vmdk

This is what we know, of course, assume as the value of our parameter fileNane: "windows2003.vmdk".

$ Vdiskmanager vmware-windows2003.vmdk-r-t 0 Windows2003-flattened.vmdk

This creates a "single growable virtual disk" is stored in one file.

The next step is to convert our single. Vmdk file to a disk image with qemu-img belonging to the project QEMU.

$ Qemu-img convert windows-2003-flattened.vmdk windows2003.img

After the conversion process, you get a file windows2003.img ready to boot.

Unfortunately it is not finished here, the hard part comes now. When you restart the system will find differences of Microsoft hardware. You may need to change and then Hardware Abstraction Layer (HAL).

Windows 2003, for example has 6 HALS:

Halmacpi.dll - ACPI Multi processor PC
Halaacpi.dll - ACPI Uniprocessor PC
Halacpi.dll - Advanced Configuration and PowerInterface (ACPI)
Halmps.dll - MPS Multiprocessor PC
Halapic.dll - MPS Uniprocessor PC
Hal.dll - Standard PC

Only one is selected and installed when you first install: WINDOWSSYSTEM32HAL.DLL.

If possible you should change C: boot.ini to specify "/ HAL = Hal.dll," if you use a different copy of the referenced DLLs is needed. In this case you need to do some tests as long as you do not find a HALS perfettaemnte working with our configuration HVM domu.

When you create your XEN configuration, it is appropriate to set 4 parameters critical to the functioning of HALS:

# Enable / disable HVM guest PAE, default = 0 (disabled)
pae = 0

# Enable / disable HVM guest ACPI, default = 0 (disabled)
acpi = 0

# Enable / disable HVM guest APIC, default = 0 (disabled)
apic = 0

# The number of CPUs to assign to this domu
vcpus = 1

To improve their chance of success is better to use "Standard PC" Hal.dll.

For MPS HALS, 1 enables APIC.

For ACPI HALS, 1 enables ACPI.

If VMWare has created an image of Windows, with ACPI this was used enabling ACPI HAL. To change it to "Standard PC" Hal.dll, you must mount the image and replace the file:

# Mount-o loop, offset = $ ((63 * 512)), windows2003.img rw / mnt
# Find / mnt-name 'hal *. dll'-print
/ mnt/WINDOWS/ServicePackFiles/i386/halaacpi.dll
/ mnt/WINDOWS/ServicePackFiles/i386/hal.dll
/ mnt/WINDOWS/ServicePackFiles/i386/halacpi.dll
/ mnt/WINDOWS/ServicePackFiles/i386/halapic.dll
/ mnt/WINDOWS/ServicePackFiles/i386/halmacpi.dll
/ mnt/WINDOWS/ServicePackFiles/i386/halmps.dll
/ mnt/WINDOWS/system32/hal.dll
# Cp-f / mnt/WINDOWS/ServicePackFiles/i386/hal.dll
/ mnt/WINDOWS/system32/hal.dll
# Umount / mnt

Now you have an image "fixed" the drive, we can use the dd command to create a lvm logical volume to be used as Xen phy: VBD device:

# Ls-la win2003.img
-rw-r-r-1 root root 8589934592 2006-11-16 13:44 win2003.img
# Lvcreate-L 8G-n Win2003-hda vg
# Dd if = of = windows2000.img / dev/vg/win2003-hda bs = 1M

The work is finished, you can start the new HVM domain.

Published in: virtualization, vmware

Add A Comment

Powered by CyberTek - Remote Assistance