Migrating Windows XenServer VMs to different Hypervisor

This is something that I figured out after a lot of pain, sweat and tears.

If you are planning to move away from XenServer, you might run into some problems running your existing Windows VMs on different hypervisors.  Merely uninstalling XenServer tools was not enough in my case. Here are the steps I took that made everything work again, that made it stop bluescreening and saved me from having to build new VMs, new AD structures, etc.

Step 1: Uninstalling XenServer Tools

While the virtual machine is still running on its original host, go to the Control Panel, click on Programs and uninstall everything related to XenServer Tools. These might include XenServer PV drivers, so be aware that your network connection to the host might drop.

Step 2: Removing Device drivers

Next, go to Control Panel, click on Hardware, go to Device Manager and View and Show hidden devices. After that, remove and uninstall every single device related to XenServer. Make sure to check Delete the driver software for this device when asked.

Step 3: Delete all XenServer services

Open Task Manager, go to the Services tab and look for any service with the word xen in it.

Open cmd with admin privileges, enter the following command and repeat for all other Xen services:

SC DELETE "[service name]"

If you also run XenApp or other Citrix services on your server, make sure to find out which services are part of those and do not delete them.

Step 4: Remove leftover Xen files

This step is kind of scary, but necessary. So make sure you have proper backups in case you mess this one up.

Boot into the recovery environment of Windows. On Windows 8 / Server 2012 and later this can be achieved by holding Shift while selecting Restart in the start menu. On Windows versions before that, you might need to create a recovery CD or boot from the installation disk.

Next, while in the recovery environment, open the command prompt. To figure out which drive letter our OS disk was assigned to, enter the following commands:

DISKPART (This will open the command line disk utility.)
LIST DISK (This will print a list of detected disks. Figure out the right disk and use that number in the next command.)
SELECT DISK [disk number]
LIST VOLUME (This will print a list of volumes, with their assigned drive letters.)
EXIT

Next, browse to the windows directory on the OS disk and delete all files related to XenServer:

CD /D [drive letter]:
CD WINDOWS
DEL /S xen*.*
EXIT

That should be it!

Now you can export your VM using XenCenter, or boot Clonezilla to clone it there, and if you did everything right it’ll come right back up without causing headaches. Install the new drivers, test everything and be on your way!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *