Skip to main content

Recently I had the possibility to work with VMs running Xen App, especially on XEN. One request from the customer was the possibility to move the VMs from XEN to VMware without reinstalling everything, so porting a part of existing infrastructure and VMs into VMware. I spent quite a lot of time finding the proper procedure that avoids the issue to the VMs when moved to VMware related basically to a lot of BSOD based on dirty XEN drivers mainly related to the SCSI controller.
Long story short I’ll put here the procedure (this procedure is not supported from VMware or XEN, so use it at your own risk):


– Remove VM on the Citrix Farm, Disable app published on a specific server

– Shut down the VM on XenCenter

– Clone it

– Power on the clone, and took a snapshot

– Uninstall Citrix XenServer Management Agent

– Uninstall Citrix XenServer Windows Guest Agent

– Uninstall Citrix Xen Windows x64 PVDrivers

– Uninstall Citrix XenServer Tools Installer

– Launch from: Program Files x86 Citrix  XenTools – unistall-Xenprovide

– Device Manager: Uninstall all XEN Drivers for Disks, Network,Controllers, CD/DVD Drives, Hidden Devices (NO REBOOT)

– Check the Devices

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet\Services\XEN \xenbus \xenvif \xendisk

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet001\Services\XEN \xenbus \xenvif \xendisk

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet002\Services\XEN \xenbus \xenvif \xendisk
– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet\Control\Class – check if there is a key with upperfilter XEN*

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet001\Control\Class – check if there is a key with upperfilter XEN*

– Remove if present RegKeys HKEY_LOCAL_MACHINE/SYSTEM\CurrentControlSet002\Control\Class – check if there is a key with upperfilter XEN*

– Remove from C:\Windows\System32\Drivers\Xen.sys-xenbus.sys-xencrsh.sys-xendisk.sys-xenfilt.sys-xennet.sys

Then you can Reboot

Once the VM is back you can install vCenter Converter, if you don’t have it you can download it free from the VMware site.
I highly recommend if you have it running on your system to stop the following Citrix Service: Citrix System Monitoring Agent service

Also if needed I recommend to increase the timeout for the service start, vCenter Converter creates the following regkey on:


ServicesPipeTimeout   = 300000

Reboot, check again if the Citrix System Monitoring Agent service is stopped and then start the conversion, wait of course al the vCenter Converter services are running (this will require based on the server 5 to 15 minutes)

Then you can start the migration of your VM with vCenter Converter

I hope this could be helpful if you have questions or you want to add your own procedure please write a comment!

Update 11/2021

Remember when you finalize the vCenter Converter to select the virtual nic created on the vCenter or the Host to select VMxnet3. (VMtools must be installed on the VM, you can after you power on the VM on vSphere)

With the help of my colleague Fabio that developed a quick and easy script we automated all the parts of regkey deletion and file deletion, so with this you just need to Uninstall the Xen software from the control panel and from the Device Manager and the boring Regedit part will be done by this script (this script will also create a local user “vmware” inside the administrator in case of need):

Create a powershell file and copy the following text:

$Keys = Get-ChildItem -Path “HKLM:\SYSTEM\CurrentControlSet\Control\Class” -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.GetValueNames() -contains ‘UpperFilters’}
$Keys += Get-ChildItem -Path “HKLM:\SYSTEM\ControlSet001\Control\Class” -Recurse -ErrorAction SilentlyContinue |Where-Object {$_.GetValueNames() -contains ‘UpperFilters’}
$Keys += Get-ChildItem -Path “HKLM:\SYSTEM\ControlSet002\Control\Class” -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.GetValueNames() -contains ‘UpperFilters’}
$xenfilt_keys = $Keys | Get-ItemProperty | Where-Object{$_.UpperFilters -like “XENFILT”}
$xenfilt_keys | ForEach-Object {Remove-ItemProperty -path $_.PSPath -Name “UpperFilters”}

reg add HKLM\SYSTEM\CurrentControlSet\Control\ /v ServicesPipeTimeout /t REG_DWORD /d 300000 /f

net user vmware VMware1! /add
net localgroup administrators vmware /add

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenbus /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenbus /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenbus /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenfilt /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenfilt /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenfilt /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xeniface /f
reg delete HKLM\SYSTEM\ControlSet001\services\xeniface /f
reg delete HKLM\SYSTEM\ControlSet002\services\xeniface /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenlite /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenlite /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenlite /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xennet /f
reg delete HKLM\SYSTEM\ControlSet001\services\xennet /f
reg delete HKLM\SYSTEM\ControlSet002\services\xennet /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\XenPVInstall /f
reg delete HKLM\SYSTEM\ControlSet001\services\XenPVInstall /f
reg delete HKLM\SYSTEM\ControlSet002\services\XenPVInstall /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\XenSvc /f
reg delete HKLM\SYSTEM\ControlSet001\services\XenSvc /f
reg delete HKLM\SYSTEM\ControlSet002\services\XenSvc /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenvbd /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenvbd /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenvbd /f

reg delete HKLM\SYSTEM\CurrentControlSet\Services\xenvif /f
reg delete HKLM\SYSTEM\ControlSet001\services\xenvif /f
reg delete HKLM\SYSTEM\ControlSet002\services\xenvif /f

cd C:\Windows\System32\Drivers
Del xen.sys
Del xenbus.sys
Del xencrsh.sys
Del xenfilt.sys
Del xeniface.sys
Del xennet.sys
Del xenvbd.sys
Del xenvif.sys


Leave a Reply

Giovanni Dominoni's Tech Blog