Convert Windows 7 VM from VirtualBox to Hyper-V

I used qemu utils in WSL for the disk conversion:

sudo apt install qemu-utils
qemu-img convert -f vdi -O vhdx "Windows 7.vdi" "Windows 7.vhdx"

VM in Hyper-V has to be created as Generation 1 with disk in IDE controller. The problem is that VirtualBox uses SATA driver by default. So after VM started I got BSOD 0X0000007B. I had to load PCI driver after start of Windows. To do it I have used startup repair to get into the command prompt and executed the following commands. It assumes that the original Windows system disk is mounted as D:.

reg load HKLM\OFFLINE D:\Windows\System32\Config\SYSTEM

reg add "HKLM\OFFLINE\ControlSet001\Services\atapi" /v Start /t REG_DWORD /d 0 /f
reg add "HKLM\OFFLINE\ControlSet001\Services\intelide" /v Start /t REG_DWORD /d 0 /f

reg unload HKLM\OFFLINE

Leave a Reply

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