Windows Virtual Machine(VM) Migration From ESX to KVM
Follow the steps to migrate Windows XP Virtual Machine from ESX to KVM
Before migrating any Virtual Machine we need to enable IDE in the registry and need to uninstall VMware tools form the VM
1. Uninstall VMware tools form VM
2. Login into the VM which you want to migrate, extract the Atapi.sys, Intelide.sys, Pciide.sys, and Pciidex.sys files from the %SystemRoot%\Driver Cache\I386\Driver.cab file, and copy into the %SystemRoot%\System32\Drivers folder. Now we will Import new registry settings into windows registry
Open regedit-->Go to file-->Export-->Give a file name-->Click save to save a registry file.
Right Click on saved reg file and click-->Edit-->Open below link-->Copy each line from below link-->Replace copied data into Opened registry file-->Save the registry file
http://www.proxmox.com/cms_proxmox/cms/upload/misc/mergeide.reg
Right click on saved file-->Click Merge-->Click yes-->Click Ok
3. Copy VMDK,Flat.VMDK and VMX files to KVM
4. Now we will convert .vmx to .xml and .vmdk to .qcow2. We will use vmware2libvirt to convert .vmx file to .xml . Install virt-goodies in your KVM system.
apt-get install virt-goodies
5. vmware2libvirt -f ./file.vmx > file.xml
6. virsh -c qemu:///system define file.xml
The first command converts the VMware 'file.vmx' file to the libvirt compatible 'file.xml'. See man vmware2libvirt for details. The second command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.
Once you converted to xml file, we need to edit VMNAME, OS Arch & Disk name or source file name. Please find below is the sample of a xml file. Open the converted xml file and Change VM name as you want, change "type arch" to x86_64, change source file name.
Note:While vmware2libvirt works well on simple virtual machines, there are limitations because .vmx files don't always contain enough information, and also because vmware2libvirt tries not to make too many assumptions about what it finds. A couple of things to look out for: While vmware2libvirt attempts to detect a 64-bit guest, be sure that your 64-bit guest has in its .xml file:
vmware2libvirt only detects and uses the first ethernet interface found. Additional interfaces can be added from within virt-manager.
Currently the first scsi disk is used if found, otherwise the first ide disk. Additional disks can be added from within virt-manager.
The converted virtual machine is hard-coded to use 1 cpu. This can be changed with:
7. Now we will convert .vmdk file to qcow2 file format
qemu-img convert diskname.vmdk -O qcow2 new-diskname.qcow2
8. Define the xml file and start the VM.Change the XML file as per your new-diskname.qcow2 and start the VM
#virsh -c qemu:///system define file.xml
#virsh start vmname
Above command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.Next command will start VM.
Note: We can follow same procedure for Windows XP, Windows Server 2003 & Windows Server 2008.
Follow the steps to migrate Windows XP Virtual Machine from ESX to KVM
Before migrating any Virtual Machine we need to enable IDE in the registry and need to uninstall VMware tools form the VM
1. Uninstall VMware tools form VM
2. Login into the VM which you want to migrate, extract the Atapi.sys, Intelide.sys, Pciide.sys, and Pciidex.sys files from the %SystemRoot%\Driver Cache\I386\Driver.cab file, and copy into the %SystemRoot%\System32\Drivers folder. Now we will Import new registry settings into windows registry
Open regedit-->Go to file-->Export-->Give a file name-->Click save to save a registry file.
Right Click on saved reg file and click-->Edit-->Open below link-->Copy each line from below link-->Replace copied data into Opened registry file-->Save the registry file
http://www.proxmox.com/cms_proxmox/cms/upload/misc/mergeide.reg
Right click on saved file-->Click Merge-->Click yes-->Click Ok
3. Copy VMDK,Flat.VMDK and VMX files to KVM
4. Now we will convert .vmx to .xml and .vmdk to .qcow2. We will use vmware2libvirt to convert .vmx file to .xml . Install virt-goodies in your KVM system.
apt-get install virt-goodies
5. vmware2libvirt -f ./file.vmx > file.xml
6. virsh -c qemu:///system define file.xml
The first command converts the VMware 'file.vmx' file to the libvirt compatible 'file.xml'. See man vmware2libvirt for details. The second command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.
Once you converted to xml file, we need to edit VMNAME, OS Arch & Disk name or source file name. Please find below is the sample of a xml file. Open the converted xml file and Change VM name as you want, change "type arch" to x86_64, change source file name.
Note:While vmware2libvirt works well on simple virtual machines, there are limitations because .vmx files don't always contain enough information, and also because vmware2libvirt tries not to make too many assumptions about what it finds. A couple of things to look out for: While vmware2libvirt attempts to detect a 64-bit guest, be sure that your 64-bit guest has in its .xml file:
vmware2libvirt only detects and uses the first ethernet interface found. Additional interfaces can be added from within virt-manager.
Currently the first scsi disk is used if found, otherwise the first ide disk. Additional disks can be added from within virt-manager.
The converted virtual machine is hard-coded to use 1 cpu. This can be changed with:
7. Now we will convert .vmdk file to qcow2 file format
qemu-img convert diskname.vmdk -O qcow2 new-diskname.qcow2
8. Define the xml file and start the VM.Change the XML file as per your new-diskname.qcow2 and start the VM
#virsh -c qemu:///system define file.xml
#virsh start vmname
Above command imports file.xml into libvirt. The imported .xml files are stored in /etc/libvirt/qemu.Next command will start VM.
Note: We can follow same procedure for Windows XP, Windows Server 2003 & Windows Server 2008.
No comments:
Post a Comment