3
edits
(New page: == Converting a VMWare image to Xen HVM== The process for converting a VMWare VMDK disk image to Xen HVM is rather quite easy. However, there are "gotchas" that you need to consider when ...) |
No edit summary |
||
Line 1: | Line 1: | ||
== Converting a VMWare image to Xen HVM== | == Converting a VMWare image to Xen HVM== | ||
[http://ian.blenke.com/vmware/vmdk/xen/hvm/qemu/vmware_to_xen_hvm.html Ian Blenke] | |||
The process for converting a VMWare VMDK disk image to Xen HVM is rather quite easy. However, there are "gotchas" that you need to consider when doing this conversion. | The process for converting a VMWare VMDK disk image to Xen HVM is rather quite easy. However, there are "gotchas" that you need to consider when doing this conversion. | ||
===First, and most importantly, identify if this is a SCSI or an IDE virtual disk.=== | |||
If you installed Windows to a SCSI disk under VMWare, it is unlikely that Windows has the IDE drivers appropriate for Xen HVM. To remedy this, you need to follow the guide documented by Microsoft kb314082. | |||
Once you have ensured that your windows image has IDE drivers installed, you can procede to converting the image. | Once you have ensured that your windows image has IDE drivers installed, you can procede to converting the image. | ||
===Next, you need "vmware-vdiskmanager", to convert newer VMWare VMDK files into a compatible format for furthe processing.=== | |||
This tool comes with VMWare 5.0 and VMWare Server 1.0. There is a similar (but different) method of doing this under VMWare ESX. | |||
===Identify the appropriate vmdk file to use that represents your disk.=== | |||
This will either be: | |||
#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. | |||
#The first .vmdk file in a series of 2G segmented files named with trailing -0001 style numbering, | |||
#The last "snapshot" .vmdk file in a series (again, named with trailing -00001 style named files). | |||
#The latest "REDO" .vmdk file in a series of snapshots. | |||
I'm sure there are more incarnations of this. It's rather hairy if you've not dealt with it before. | I'm sure there are more incarnations of this. It's rather hairy if you've not dealt with it before. | ||
How do you find the right one? Look inside your ".vmx" file for a line beginning with: | ====How do you find the right one?==== | ||
Look inside your ".vmx" file for a line beginning with: | |||
scsi0:0.fileName = windows2003.vmdk | scsi0:0.fileName = windows2003.vmdk | ||
Line 26: | Line 34: | ||
ide0:0.fileName = windows2003.vmdk | ide0:0.fileName = windows2003.vmdk | ||
===That's all there is to it.=== | |||
Now, lets assume the name of our disk is "windows2003.vmdk". | |||
$ vmware-vdiskmanager -r windows2003.vmdk -t 0 windows2003-flattened.vmdk | $ vmware-vdiskmanager -r windows2003.vmdk -t 0 windows2003-flattened.vmdk | ||
Line 32: | Line 41: | ||
This will create a "single growable virtual disk" that is flattened into a single file. | This will create a "single growable virtual disk" that is flattened into a single file. | ||
===The next step is to turn this flattend.vmdk file into a disk image with qemu-img from the QEMU project.=== | |||
$ qemu-img convert windows-2003-flattened.vmdk windows2003.img | $ qemu-img convert windows-2003-flattened.vmdk windows2003.img | ||
Line 38: | Line 47: | ||
When this completes, you will now have a windows2003.img file that might boot for you. | When this completes, you will now have a windows2003.img file that might boot for you. | ||
The unfortunate reality of running a Windows OS is that it makes a number of assumptions at install time as to your PC hardware. If you transplant the image, you may need to change the Hardware Abstraction Layer (HAL). | ====The unfortunate reality of running a Windows OS is that it makes a number of assumptions at install time as to your PC hardware.==== | ||
If you transplant the image, you may need to change the Hardware Abstraction Layer (HAL). | |||
HALMPS.DLL - MPS Multiprocessor PC | *Windows 2003, for example has 6 HALs: | ||
*HALMACPI.DLL - ACPI Multi processor PC | |||
HALAPIC.DLL - MPS Uniprocessor PC | *HALAACPI.DLL - ACPI Uniprocessor PC | ||
*HALACPI.DLL - Advanced Configuration and PowerInterface (ACPI) | |||
HAL.DLL - Standard PC | *HALMPS.DLL - MPS Multiprocessor PC | ||
*HALAPIC.DLL - MPS Uniprocessor PC | |||
*HAL.DLL - Standard PC | |||
Only one is selected and installed as \WINDOWS\SYSTEM32\HAL.DLL at install time. | Only one is selected and installed as \WINDOWS\SYSTEM32\HAL.DLL at install time. | ||
Line 86: | Line 90: | ||
<nowiki>#<nowiki/> find /mnt -name 'hal*.dll' -print | <nowiki>#<nowiki/> find /mnt -name 'hal*.dll' -print | ||
/mnt/WINDOWS/ServicePackFiles/i386/halaacpi.dll | */mnt/WINDOWS/ServicePackFiles/i386/halaacpi.dll | ||
*/mnt/WINDOWS/ServicePackFiles/i386/hal.dll | |||
/mnt/WINDOWS/ServicePackFiles/i386/hal.dll | */mnt/WINDOWS/ServicePackFiles/i386/halacpi.dll | ||
*/mnt/WINDOWS/ServicePackFiles/i386/halapic.dll | |||
/mnt/WINDOWS/ServicePackFiles/i386/halacpi.dll | */mnt/WINDOWS/ServicePackFiles/i386/halmacpi.dll | ||
*/mnt/WINDOWS/ServicePackFiles/i386/halmps.dll | |||
/mnt/WINDOWS/ServicePackFiles/i386/halapic.dll | */mnt/WINDOWS/system32/hal.dll | ||
/mnt/WINDOWS/ServicePackFiles/i386/halmacpi.dll | |||
/mnt/WINDOWS/ServicePackFiles/i386/halmps.dll | |||
/mnt/WINDOWS/system32/hal.dll | |||
<nowiki>#</nowiki> cp -f /mnt/WINDOWS/ServicePackFiles/i386/hal.dll /mnt/WINDOWS/system32/hal.dll | <nowiki>#</nowiki> cp -f /mnt/WINDOWS/ServicePackFiles/i386/hal.dll /mnt/WINDOWS/system32/hal.dll | ||
Line 104: | Line 102: | ||
<nowiki>#</nowiki> umount /mnt | <nowiki>#</nowiki> umount /mnt | ||
===Now that you have a "fixed" img file representing the entire drive, you can dd it straight to a lvm logical volume to be used as a Xen phy: vbd device:=== | |||
<nowiki>#</nowiki/> ls -la win2003.img | <nowiki>#</nowiki/> ls -la win2003.img | ||
Line 111: | Line 109: | ||
<nowiki>#<nowiki> dd if=windows2000.img of=/dev/vg/win2003-hda bs=1M | <nowiki>#<nowiki> dd if=windows2000.img of=/dev/vg/win2003-hda bs=1M | ||
Now you are done. Start up your spiffy new HVM domain. | ===Now you are done. === | ||
Start up your spiffy new HVM domain. | |||
===This, in a nutshell, is how you convert a VMWare image into a Xen HVM disk image.=== | |||
vmware/vmdk/xen/hvm/qemu | 0 trackbacks | vmware/vmdk/xen/hvm/qemu | 0 trackbacks |
edits