Migrate physical Windows 10 to VM and start on console

christian789

New Member
Apr 27, 2024
15
0
1
I'm trying to use free resources on a NUC by running the existing pysical Windows 10 installation as VM on Proxmox and some other VMs in the background. From console’s user perspective Windows should be started and shown on screen after boot.

Steps taken so far:
* Copied current disk to a CIFS share with Sysinternal's disk2vhd (used VSS for the „C“ partition and a second execution for the other partitions as activating VSS gave an error)
* Installed proxmox 8.1 (and also 8.2) with defaults except using ZFS
* Created VM for Windows following the tutorials available (UEFI, TPM 2.0, q35, SATA:0, …), qm import from the CIFS share and set old „C“ partition as boot drive.

When starting the VM I always get BSOD with „bad system config info“. The system restarts multiple times and then ends up in repair mode. All bootrec tricks didn’t work. When I enter Window’s repair console, my old C drive is accessible. Analysing Window‘s LogFiles in Srt did not give any meaningful hint.

My assumption is that somewhere the old disk id is stored for startup and the imported disk got a new id and therefore the startup fails. But I might be wrong - at least I would have expected that to be fixed by automatic repair.

Anyone an idea? Let me know if additional details on config or logs are of interest.

Thanks
 
I believ
* Copied current disk to a CIFS share with Sysinternal's disk2vhd (used VSS for the „C“ partition and a second execution for the other partitions as activating VSS gave an error)
You've probably got a now inconsistent boot partition / manager for Windows.

Why not do it simpler. Make a complete dd image of the old drive & then import that with qm importdisk.

I'm assuming you haven't overwritten (at all) the old Windows OS disk with the PVE install.
 
I believ

You've probably got a now inconsistent boot partition / manager for Windows.
That's my assumption as well. How can I verify/fix that? Trying to find my way with diskpart, mountvol on Windows repair shell, but don't know how to move forward.
Why not do it simpler. Make a complete dd image of the old drive & then import that with qm importdisk.
I assume disk2vhd does someting similar as dd, but not sure. I did
mkdir /mnt/vm_import
mount -t cifs -o username=$user,password=$pwd //<smb-host/share>/ /mnt/vm_import
qm disk import $vmid /mnt/vm_import/<filename>.vhdx local-zfs
which executed fine (although on 8.1 I had 950 MBit/s while downloading whereas on 8.2 I only had 330 MBit/s).
I'm assuming you haven't overwritten (at all) the old Windows OS disk with the PVE install.
I'm sure I have overwritten the local disk - the proxmox installer by default uses the whole disk. Proxmox starts fine.

Thanks for looking into it!
 
downloading whereas on 8.2 I only had 330 MBit/s).
limited by your not datacenter disk, required for ZFS, moreover ZFS will wear out your disk quickly, it's not recommended to run ZFS on not datacenter grade disk. ("Pro" disk aren't datacenter grade disk)
Switching to Ext4, VMs will use Lvmthin as storage datastore, then you'll get ~baremetal performance.

Test your vhd backup with a hyperv install, or cloning vhd back to a disk to reboot as baremetal.
afaik, bad system config info is corrupted system registry hive. durirng the backup or the restore, that's why you need to test your VHD outside to PVE.
 
Last edited:
I'm sure I have overwritten the local disk
So I guess you can no longer do the dd full image I suggested above.

I find it hard to understand why you overwrote the original Windows OS disk before you had a working VM of it. That is obviously not the practical way to go about it.

I guess all your now left with is to try debug/repair your current (unworking) Windows VM. Probably most of that will be about seeking advice of a corrupted Windows OS - which will be mostly Windows-centric & not Proxmox.

You could start by setting the VM Processor, Type, to host, as this will replicate the original working Windows OS AMAP.

If you are eventually still unsuccessful, it sounds like you still have the old "C drive" so your data is not lost. What you could then do, is spin up a fresh (working) Windows VM & after that attach the old disk to the VM (in addition to the newly created VM's disk) & then recover any data from within Windows, one disk to another. Then you could finally remove the extra (old) disk from the VM.

Good luck.
 
  • Like
Reactions: Kingneutron
So I guess you can no longer do the dd full image I suggested above.

I find it hard to understand why you overwrote the original Windows OS disk before you had a working VM of it. That is obviously not the practical way to go about it.

I guess all your now left with is to try debug/repair your current (unworking) Windows VM. Probably most of that will be about seeking advice of a corrupted Windows OS - which will be mostly Windows-centric & not Proxmox.

You could start by setting the VM Processor, Type, to host, as this will replicate the original working Windows OS AMAP.

If you are eventually still unsuccessful, it sounds like you still have the old "C drive" so your data is not lost. What you could then do, is spin up a fresh (working) Windows VM & after that attach the old disk to the VM (in addition to the newly created VM's disk) & then recover any data from within Windows, one disk to another. Then you could finally remove the extra (old) disk from the VM.

Good luck.
Never mind, it's a test machine anyways. But I'd like to learn before I touch the productive system, where I don't want to loose the existing installation.
So how would you recommend to do the migration?
Boot a live linux and dd to a CIFS share?
 
Exactly. The target choice of CIFS is your decision, any will do. I'd actually use some local (USB attached etc.?) for speed. YMMV.
Thanks. Are you aware of a way to do it from within Windows as well?
How about Windows' integrated Backup? I guess it writes a .wim file. Could I somehow start from there?
 
How about Windows' integrated Backup? I guess it writes a .wim file
it writes a vhdx like disk2vhd.
it should produce same result.
I used disk2vhd many times without problem.
don't forget to reboot before image, because Windows "fast Startup" can do bad things, even I advice disable it.
 
I've had often problems doing it with disk2vhd, this OP himself has had an issue using this approach. I therefore always use a disk imager on a non working os disk, as is the correct procedure.
 
it writes a vhdx like disk2vhd.
it should produce same result.
I used disk2vhd many times without problem.
don't forget to reboot before image, because Windows "fast Startup" can do bad things, even I advice disable it.
Hmm. That's exactly what I did. Booted Windows from scratch (no hibernate, sleep to disk), started disk2vhd, selected all partitions, no VSS and vhdx got stored on a remote share. But something seems to be weird with the vhdx (or my way of integrating it).
Is there a way to check/validate the vhdx if it's complete/contains everything needed?
 
no error here. is only one hidden partition produce error ?
alternative : you can boot from a winpe usb then use disk2vhd without VSS which will be valid as Windows is offline.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!