Convert A Xen Virtual Machine To VMware – Step by Step

October 5, 2012

Table of Contents

This article explains how you can convert a Xen guest to a VMware guest. The steps descibed here assume advanced VMware and Xen knowledge.
Additional software requirements:
  • qemu
  • VMware Server 1.xx
  • VMware Converter
  • Knoppix LiveCD or the distribution’s first CD

Xen -> VMware VM Migration Steps (Kernel Step)

The kernel on the VM to be migrated must support fully virtualized operation. The kernels used for para-virtulized machines using RHEL/Fedora/CentOS as a guest do not support fully virtualized operation by default. The best way to deal with this is to also install a standard kernel in the machine, port the machine and finally remove the Xen kernel.
1. Since this is a highly risky procedure, FIRST CREATE A BACK-UP OF YOUR VIRTUAL MACHINE!!!
2. Download a kernel with the same version number and architecture as the Xen kernel, except it should be the a generic one. Use the distribution CD/DVD or any other repository to get it.
3. Use RPM tools to install the kernel.
4. Modify /etc/modprobe.conf to add the proper SCSI and network card modules:
alias eth0 xennet
alias scsi_hostadapter xenblk
will be replaced by
alias eth0 pcnet32
alias scsi_hostadapter mptbase
alias scsi_hostadapter1 mptspi
alias scsi_hostadapter2 ata_piix
Modify /etc/inittab by removing the # in front of the getty and puting a comment in front of the line containg the xen console:
1:2345:respawn:/sbin/mingetty --noclear tty1
2:2345:respawn:/sbin/mingetty
3:2345:respawn:/sbin/mingetty
4:2345:respawn:/sbin/mingetty
5:2345:respawn:/sbin/mingetty
6:2345:respawn:/sbin/mingetty
This is a one way action. Once modified the kernel modules, you won’tbe able to properly start the machine, and you will receive a Kernel panic error message.

Xen – > VMware VM Migration Steps (Disk Step)

To convert a XEN machine in a .vmdk format to be used with VMware, a tool called qemu will be used. QEMU is a generic and open source machine emulator and virtualizer. It is also a fast processor emulator using dynamic translation to achieve good emulation speed.
1. Download qemu from DAG repository. Use the EL5 package for any Fedora/RHEL5/CentOS5 that you use.
2. Convert the XEN machine to VMware:
qemu-img convert <source_xen_machine> -O vmdk <destination_vmware.vmdk>
<dest_vmware .vmdk=”.vmdk” style=”margin: 0px; padding: 0px;”>3. At this point, we have a valid VMware Server 1.xx disk image. This can be powered on onto any VMware Server. We need to do it anyway in order to build a .VMX file that will be later used. This stage also confirms whether the newly machine runs properly.
3.1 Create a new virtual machine. Do not create a new HDD, but use the previously created vmdk.
3.2 Power it on in order to validate that it is usable and to allow the machine to reconfigure itself.
4. Move the VMware Server virtual machine to a Windows workstation running VMwareConverter.
5. Using VMware Converter, convert the VMware Server virtual machine to VMware ESXi.

Xen -> VMware VM Migration Steps (ESX Step)

1. Configure the virtual machine to boot first from CD-ROM drive.
2. Modify the machine’s HDD SCSI controller type from BUS Logic to LSI Logic.
Edit Virtual Machine Settings > SCSI Controller 0 > Change type > LSI Logic.
3. Boot using Knoppix or the distribution’s first CD.
4. Mount the VM’s disk and chroot to it.
5. Get the disk architecture using fdisk -l, and modify /etc/fstab accordingly.
6. Create a new initrd image. You also must know the version of the running kernel. For example, if you are running kernel 2.6.18-1234, then the initrd command would look like this:
# mkinitrd -v -f /boot/initrd-2.6.18-1234.img 2.6.18-1234
7. Edit /boot/grub/menu.lst to boot from this initrd.
8. Keep your fingers crossed and reboot the machine.
Don’t forget to re-configure your network card.
Share on
Facebook
Twitter
LinkedIn
Pinterest
More posts

Dedicated Servers Quick Guide

What is a Dedicated Servers? Why bother using a dedicated server over a VPS or Shared Hosting?A dedicated server is a server 100% dedicated to your website/project or business needs.

Windows Update Cleanup Plugin

Here is some good news for windows 7 SP1 users and maybe for VDI admins running windows 7 desktops in their VDI environments. Windows update cleanup plugin allows to uninstall

Get 90% Discount

First 3 People gets the Bonus!
Don't Miss Out Our Big Sale

Get 0-90% On All
247Rack Services

247Rack

The Sale Is Until The End Of March