VMware Cloud Community
kcs_
Contributor
Contributor

Problems Migrating Windows 2012 from Xen Server to ESXi

Hi,

I have been searching for info on my problem and can't seem to find anything.

I have a XenServer Pool, Version 6.5. I am using the VMWare Standalone Converter to attempt to migrate VMs over to ESXi 6.0. The linux VMs I did worked great, no issues.

The same can't be said for Windows Server 2012. The VMs migrate over but when they boot I am stuck on a couple of issues that I just can't get past:

- Constant restarts and BlueScreens trying to boot. Tried Windows repair with no luck. Sometime I can get into Safe Mode without any problems but it will not boot up into regular Windows.

- A BSOD caused by xen.sys that I was able to work around that then turned into no bootable drive.

I have tried combination of uninstalling the Xen Tools, not uninstalling, installing the VmWare tool, not installing, tried exporting OVF/OVA files from Xen, etc. Nothing seems to work. When I try to look back and remember what I did and didn't do my head starts hurting.

Getting to the point where I am almost ready give up and build the VMs from scratch in ESXi. It may take a week of 14 hours days but at least I can move on to other headaches.

Any help, links, guidance would be greatly appreciated.

Thanks,

K

12 Replies
unsichtbare
Expert
Expert

What are the SCSI Adapter and Network Adapter type in VMware?

LSI and e1000 are natively supported by Windows

+The Invisible Admin+ If you find me useful, follow my blog: http://johnborhek.com/
Reply
0 Kudos
kcs_
Contributor
Contributor

Thanks for the reply.

I using the E1000 for network and treid both LSI Logic SAS and LSI Logic Patallel for SCSI.

My gut is telling me the Xen Tools and Drivers are the heart of the issue.

Thanks,

K

Reply
0 Kudos
patanassov
VMware Employee
VMware Employee

Hello

the default controllers for Windows 2012 are E1000e and LSI Logic SAS, but the older e1000 and LSI parallel should also work fine (they are supported by ESX and AFAIK by Windows too)

I suppose your gut feeling is true. Since you have managed to get rid of xen.sys, there might be something more like that (I had no idea Xen had special tools for Windows!)

Can you managed to boot in safe mode and confirm manually each driver load?

HTH

Plamen

Reply
0 Kudos
kcs_
Contributor
Contributor

I think I have kind of (see below) figured this out will add some notes here in case anyone else has this issue.

  1. When converting set the option to NOT power on when done.
  2. After conversion is complete make a snapshot.
  3. The first time you boot, boot into safe mode.
  4. Once logged in, go to Device Manager, and select View/Hidden Items
  5. Go through every branch of the tree and delete Xen* device.
  6. Reboot
  7. Log in and remove all Xen Tools from Programs and Features
  8. Reboot
  9. Log in and install VMWare tools.
  10. Reboot.

Getting a 0xc000021a BSOD after I login to the console but I hopefilly will be able to work around that without too much trouble.

fdapra
Contributor
Contributor

try to follow these steps after the conversion of the virtual machine.

http://vsphere-land.com/tips-tricks/converter-tips

Reply
0 Kudos
flynntof
Contributor
Contributor

I have the same problem migrating a windows 2012 r2 VM  from Xenserver to Vmware 6.5

It doesn't seem no matter what I do, I cant get rid of the dreaded

SYSTEM_THREAD_EXCEPTION_NOT_HANDLED (XEN.SYS)

I followed everyone's helpful instructions, but only end at the point of inaccessible boot device if I strip out the XEN components from the registry

Did anyone menage to resolve the issue for migrating from Xen server?

Reply
0 Kudos
BReed01
Contributor
Contributor

I really struggled with finding a solution to this same issue.  In my case, I no longer had XenServer and only had an OVA export of a XS server and none of the other solutions I found worked for me.  I tried everything I could find online to get past the SYSTEM_THREAD_EXCEPTION_NOT_HANDLED error on Server 2012 R2 (in my case, going from XenServer 7 to ESXi 6.5).

I was able to boot my server in Safe Mode, and ultimately it was an easy fix.

Full steps involved:

1. convert OVA to VMDK with WinImage

2. modify the server.vmdk (the small file, not the 'flat' file) file with notepad and changed the line for ddb.adapterType = "ide" to ddb.adapterType = "'lsilogic"

3. built a new VM in ESXi, but didn't power it up

4. deleted the base HDD from new VM and then uploaded my new converted VMDK files to the appropriate server folder on the datastore

5. Edited VM to attach an existing hdd, making sure that the new hdd was set to use SCSI controller

6. Booted up server, and let it fail with SYSTEM_THREAD_EXCEPTION_NOT_HANDLED error and then went into Safe Mode

7. Open regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\, and create a new Key called MSIServer and change the Value to Service

8. Uninstall old XenTools through Programs (this is what Step 7 allows you do in Safe Mode)

9. Back in regedit, delete the Software->Citrix folder (if you have other Citrix products installed, make sure you're only deleted the appropriate XenTools stuff and not your app directories)

10. Go to Program Files (x86) directory and delete the Citrix->XenTools folder

11.  Open up Run and go to MSCONFIG and then Services tab and uncheck the XenServer service at bottom (can't recall actual name, but was obvious)

12.  And the big step that actually fixes the error, go to C:\Windows\System32\drives and scroll to bottom and delete xen.sys and all other xenXXXX.sys drivers

13.  Rebooted and everything worked.  Installed VMWare Tools like normal, and then opened up CMD and ran DEVMGR_SHOW_NONPRESENT_DEVICES=1

14.  Went to Device Manager and did Show Hidden Devices, and then uninstalled all the unused (greyed out) devices to clean things up a bit

Reply
0 Kudos
lazygh0st
Contributor
Contributor

Hi guys. I have found a successful and fast way to migrate from Xenserver to Vmware. Yes, Xenserver is a turd and it's real pain in the ass to migrate VMs from it. No other way worked for me.

Fastest way to migrate Xenserver VM to ESXi(i tried with Xen 7.2 to VMware 6.0 U3):

Note IP address of VM because when you remove XS tools the IP configuration will not move on new adapter.

Uninstall Xenserver tools

Remove in Device manager Xen PV Bus, it remove all other Xen hidden devices. Double check if there are no hidden devices View>Show Hidden Devices. Check Disk, Network Adapter)

delete all xen*.sys in C:\Windows\System32\drivers - 9 files by default. Differ between OS.

delete all xen*.dll in C:\Windows\System32\ - 19 files by default. Differ between OS.

Shutdown VM

Export VM using CMD and not the GUI because you can export without using SSL encryption, it's lot faster. You can export in only in XVA format from cmd though, but it's still faster to export in XVA and convert to OVF.  Once you run command you can see the VM icon becomes yellow and you can see export progress in Xencenter notifications.

go to C:\Program Files (x86)\Citrix\XenCenter and open cmd in that location. Run command:

xe.exe -s <xenserver_ip> -u root -pw <passwpod> vm-export vm="<name_of_vm_case_sensitive>" filename=C:\Export\<name_of_vm>.xva --nossl

Once export finishes you need to convert the xva appliance file to OVG.

Download and Install XenConvert (Xenconvert is depricated and you cannot download it from Citrix. Don't download 2.4.1 version. It doesn't have an option to convert XVA to OVF or any other option to convert vdisk file. Download 2.3.2 version. Here is the download link -http://downloadns.citrix.com.edgesuite.net/akdlm/5322/XenConvert_Install_x64.exe)

Run Xenconvert choose -  From - Xenserver virtual appliance,To - open virtualization format ovf

Once conversion finishes rename vhd files to proper vm name, because it will called ref**.vhd.

You cannot import OVF into VMware because it will show some kind of XML error. You have convert OVF to VMDK.

Download and Install Starwind V2V converter latest version and run it(you need to register with legit email. They will send you download link in email):

Run Starwind. Source image location - local file> choose VHD file >choose VMware ESX server image and run conversion

After it finishes it will create two files *.VMDK and *-flat.VMDK. Create new folder in datastore, copy both files there and wait till VMware finishes combining both files.

Create new VM and choose existing disk, find your VMDK file in datastore and you are done.

Win2012 will boot straight away.

For Win2008(this works for both Win2008 and WIn2008r2) you need to do these extra steps because VM will go in BSOD because it's laking SCSI driver(once you remove XS tools you will see in Device Manager that it's missing SCSI controller driver. You cannot install VMware scsi driver on source machine because it's not compatible). Forget about other solutions like loading hive and changing services which to start. It doesn't work anymore. It will still go in BSOD.

Enable SSH server on ESXi host

connect via putty to ESXI host which hosts the Win2008 VM

go to /vmfs/volumes/<name of datastore>/<nameofWindows2008VM>

open with vi editor -  <nameofWindows2008VM>.vmdk

change adapter type to - ddb.adapterType = "ide"

Edit VM settings from vsphere client, remove harddisk with option Remove from Virtual machine and then press Add> Harddisk and and this time it show that it will add IDE controller, choose IDE address(0:0) and add SCSI CD/DVD on SCSI address (0:1).

You are done(You can do it while you are creating new VM, just choose option Edit VM settings before finish).win2008 will successfully boot.

Boot VM and check if Device Manager has installed LSI adapter driver.

Shutdown VM

connect via putty to ESXI host which hosts the Win2008 VM

go to /vmfs/volumes/<name of datastore>/<nameofWindows2008r2VM>

open with vi editor -  <nameofWindows2008r2VM>.vmdk

change adapter type back to - ddb.adapterType = "lsilogic"

Open Edit VM settings from vsphere client, remove harddisk with option Remove from virtual machine again and then  Add Harddisk. Now it will show SCSI controller, choose SCSI address(0:0). Then Remove CD/DVD which previously added and press ok.

win2018 VM will now boot with LSILOGIC SCSI driver.

Good luck!

salmajster
Contributor
Contributor

Works fine on win2012 R2, but on win 2008 can not delete xen*.dll files from c:\windows\system32, although I am logged as local administrator.

Reply
0 Kudos
jihanmalmsteenr
Contributor
Contributor

Although a very old problem, it just happened to me.  Did an export of a Windows 2016 VM from XenServer that couldn't boot in VMWare.  Here it's how I fixed:

1) Boot in safe mode.

2) Enable msiserver in safe mode so you can uninstall XenTools - Type REG ADD “HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Minimal\MSIServer” /VE /T REG_SZ /F /D “Service” and press enter.

3) Uninstall xentools

4) Search for all xen* files and delete all of them, including the folders in C:\Program Data ( If you try to delete before uninstalling, you're going to get an error.)

5) Delete Citrix folders in C:\Program Data

6) Since you started msiserver in step 2, you can start the installation of vmware tools - it's going to ask you for a reboot.

7) Finish vmware tools installation

It worked for me.

Reply
0 Kudos
karahalilogluca
Contributor
Contributor

Now, I'm working with this issue. I have applied all methods on the internet.

Problem is not related the OS version of Windows. Source of the problem is Citrix Xentool version.

Probably you are trying xentools 6.5.x and older version installed VMs. If upgrade to 7.1.x tools it will be working fine with below known method.

After convert;

safe mode > enable msiserver > remove tools > remove drivers (also hidden)> remove registry records starts with xen* (hklm\currentcontrolset1\services and 2) > reboot.

Thanks

Reply
0 Kudos
Andre_Favoretto
Contributor
Contributor

Hey brother,

your step-by-step worked for me . Thanks a lot!

Reply
0 Kudos