Migrated Windows Server 2012R2 VM from Hyper-V to Proxmox does not boot

llinty

Member
Sep 15, 2022
22
3
8
Hi,

I have done the following procedure to migrate a W2012 server from Hyper-V to Proxmox
1) Virtio driver has been dowloaded and installed on W2012 server
2) QEMU Agent has also been installed on W2012 server
3) Hyper-V VM has been shutdown
4) VMHD diskfile has been copied to PVE with scp
5) Disk Image has been checked with : qemu-img check disk.vmhd --> No error
6) Disk image has been converted to QCOW2 format : qemu-img convert disk.vmhd -O qcow2 disk.qcow2
7) Converted Disk Image has been checked again with : qemu-img check disk.qcow2
No errors were found on the image.
975555/2080768 = 46.88% allocated, 0.00% fragmented, 0.00% compressed clusters
Image end offset: 63944327168

8) A VM has been created without network card to prevent any IP conflict after booting with : qm config 104
agent: 1
boot: order=scsi0;ide2
cores: 1
ide2: none,media=cdrom
machine: pc-i440fx-6.1
memory: 4096
meta: creation-qemu=6.1.0,ctime=1666763193
name: server
numa: 0
ostype: win8
scsi0: vm-storage:vm-104-disk-1,size=127G
scsihw: virtio-scsi-pci
smbios1: uuid=c4d931ee-cc16-4c90-a9c4-9020140b767b
sockets: 1
vmgenid: eaa50655-6bc9-4c42-acdc-b04240b4163e

9) The VMID 104 has been started but it is unable to boot (No bootable device !)

Please help.
 
Last edited:
Windows won't install drivers if no device is plugged. That's why vitioscsi drivers weren't installed in (1).
Change the windows disk from scsi to sata and power it on (don't forget to add the sata to boot in Options -> Boot order)
If it boots, add 1GB scsci disk an then install the drivers. Ater that, change the windows disk from sata to scsi.

Tip:
Change "machine: pc-i440fx-6.1" to "q35/7.0"
 
  • Like
Reactions: Tmanok
Hi @santiagobiali,

thank you for you answser. I have deleted the VM ID 104 and restarted from scratch at step 6) to be sure. I have created again a new VM with a SATA disk of 1 Go which has been deleted after. The machine type is pcq35-6.1 (no 7.0 available). Then the converted QCOW2 image has been imported and declared has a SATA device. The Boot order has been defined with sata0,ide2. This is the current VM configuration:

agent: 1
boot: order=sata0;ide2
cores: 1
ide2: none,media=cdrom
machine: pc-q35-6.1
memory: 4096
meta: creation-qemu=6.1.0,ctime=1666851496
name: server
numa: 0
ostype: win8
sata0: vm-storage:vm-104-disk-0,size=127G
scsihw: virtio-scsi-pci
smbios1: uuid=e33e47cb-954b-4322-9f73-46f7892471fa
sockets: 1
vmgenid: 5409379f-dfe5-43cd-a9d4-1f94366fa595

However the server is still unable to boot. It is looping between hard disk and cdrom and it is claiming about a bootable device. I seriously have some doubt on the conversion process. I have used the qemu-img binary provided by Proxmox.

qemu-img version 6.1.0 (pve-qemu-kvm_6.1.0)

I'm wondering if the solution is to use a third party tool to make it worked as suggested:
https://pve.proxmox.com/wiki/Migration_of_servers_to_Proxmox_VE#HyperV

A clear and reliable documentation on how to migrate VM from Hyper-V will be very usefull for such critical task.
 
I have moved many windows guests from hyper V to proxmox. I use the Starwind converter which is a free download to convert the VHD file to QCOW.

In proxmox create a new virtual machine with sata drive and empty disk. Then replace the default qcow drive with the hyper v with same name via sftp.

Also attach the virtio drivers CD-ROM

Start the Windows virtual machine and use the proxmox console to login and install virtio.

Shutdown virtual machine and create a second empty hard disk attached to the SCSI drive . This is the bit you are missing.

Now boot the virtual machine from SATA and the virtual drivers will be loaded because of the second hard disk. Check in widnows device manager you should see red hat scsi driver.

Shut down the virtual machine

Now you can switch from Sata to SCSI and the virtio drivers will be recognised and find the boot disk.

Dont forget the boot order I always do.
 
Last edited:
@llinty are you using BIOS or UEFI?
Is secure boot disabled in BIOS?
Try creating a boot from file entry in BIOS: {YOURDISK}\EFI\Microsoft\Boot\bootmgfw.efi
 
Now boot the virtual machine from SATA and the virtual drivers will be loaded because of the second hard disk. Check in widnows device manager you
Hi @toomanylogins, thank you for your help !

I have downloaded and installed Starwind converter on Hyper-V. I have started the conversion from VHDX to QCOW2. It has created a Snapshot and the conversion is processing. It seems very slow comparing to qemu-img binary on Proxmox. Time doesn't matter in fact. The proxmox target VM disk is on located on /var/lib/vz whcih is too small to store the QCOW2 disk drive. The storage is defiined as LVM Storage. So I will not be able to replace as default qcow drive with the hyper V converted one. If I'm writing down the default name before deleting I can rename the QCOW2 before importing to be sure it will got the same name. Does it matter if the name is not the same?

I will attach the virtio drivers CD-ROM even if I have already installed the Virtio Driver on the Hyper V running VM. Is it a problem to have installed first virtio driver and QEMU Agent on the Hyper-V VM to be converted?

As soon as the image will be ready I will get back to you for a feedback.
 
@llinty are you using BIOS or UEFI?
Is secure boot disabled in BIOS?
Try creating a boot from file entry in BIOS: {YOURDISK}\EFI\Microsoft\Boot\bootmgfw.efi
@santiagobiali as far as I can see the Secure Boot is disabled on the Hyper-V VM. The tick isn't checked in the VM firmware property.

The boot information are as following:

Description : Windows Boot Manager

Valeur : \HD(2,GPT82313C0E-92BD-4A8F-991D-83E1665C6E20,616448,202752)\EFI\Microsoft\Boot\bootmgfw.efi

Chemin d’accès de périphérique du microprogramme : \HD(2,GPT82313C0E-92BD-4A8F-991D-83E1665C6E20,616448,202752)\EFI\Microsoft\Boot\bootmgfw.efi
 
@santiagobiali as far as I can see the Secure Boot is disabled on the Hyper-V VM. The tick isn't checked in the VM firmware property.

The boot information are as following:

Description : Windows Boot Manager

Valeur : \HD(2,GPT82313C0E-92BD-4A8F-991D-83E1665C6E20,616448,202752)\EFI\Microsoft\Boot\bootmgfw.efi

Chemin d’accès de périphérique du microprogramme : \HD(2,GPT82313C0E-92BD-4A8F-991D-83E1665C6E20,616448,202752)\EFI\Microsoft\Boot\bootmgfw.efi
Not in hyper-v, check the bios in your proxmox guest vm.

I had to do this last week when I migrated a uefi gen2 Linux vm from hyper-v:

Press F2 or delete (don't remember which one) when the VM is booting and add the boot option from file (same path as you have in your hyper-v firmware boot)
 
you've missed to switch the BIOS type in Hardware Settings of the VM from Default to OVMF to enable UEFI boot then EFI boot part will be located from your qcow2 to load Windows
 
Not in hyper-v, check the bios in your proxmox guest vm.

I had to do this last week when I migrated a uefi gen2 Linux vm from hyper-v:

Press F2 or delete (don't remember which one) when the VM is booting and add the boot option from file (same path as you have in your hyper-v firmware boot)
@santiagobiali , I have created the Proxmox VM with default option. So BIOS is the default one (SeaBIOS). Do I need to set UEFI BIOS? In this case, I will have to create an EFI disk. I have already played with UEFI and the system was booting on UEFI System cli with a prompt. I had two disks : 1 UEFI disk and the QCOW2 disk. Is it the documentation to follow?

https://pve.proxmox.com/wiki/OVMF/UEFI_Boot_Entries#Short_How-To
 
efi disk of proxmox is only for store bios settings.
the efi boot partition is already in your qcow2
 
@santiagobiali , I have created the Proxmox VM with default option. So BIOS is the default one (SeaBIOS). Do I need to set UEFI BIOS? In this case, I will have to create an EFI disk. I have already played with UEFI and the system was booting on UEFI System cli with a prompt. I had two disks : 1 UEFI disk and the QCOW2 disk. Is it the documentation to follow?

https://pve.proxmox.com/wiki/OVMF/UEFI_Boot_Entries#Short_How-To
@santiagobiali, it works !!

I have set the BIOS to OVF (UEFI. Then, I have first Detached the QCOW2 disk drive. I have created an EFI Disk from the GUI and I have attached again the QCOW2. It is declared as SATA device. Finally, I have added the sata0 to the Boot Order. It has taken some time to boot but it works.

This is the current configuration for sharing with community:
agent: 1
bios: ovmf
boot: order=sata0;ide2
cores: 1
efidisk0: vm-storage:vm-104-disk-1,efitype=4m,pre-enrolled-keys=1,size=4M
ide2: none,media=cdrom
machine: pc-q35-6.1
memory: 4096
meta: creation-qemu=6.1.0,ctime=1666851496
name: server
numa: 0
ostype: win8
sata0: vm-storage:vm-104-disk-0,size=127G
scsihw: megasas
smbios1: uuid=e33e47cb-954b-4322-9f73-46f7892471fa
sockets: 1
vmgenid: 5409379f-dfe5-43cd-a9d4-1f94366fa595

Is it safe now to change the device from SATA to Virtio? @toomanylogins says that we need to create a dummy disk with Virtio to enable the drivers for loading. Virtio drivers and QEMU Agent has been installed in VM when it was running on Hyper-V.

Thank you for your help!
 
  • Like
Reactions: BiagioParuolo
efi disk of proxmox is only for store bios settings.
the efi boot partition is already in your qcow2
Hi @_gabriel, this point was clear for me. From my point of view, the EFI boot partition should have been present in my QCOW2 disk file. But I was unable to boot from this disk with the BIOS set to default. What did I miss?
 
as I said previoulsy, OVMF bios type is mandatory to enable UEFI boot.
Default bios is only Legacy/MBR boot.
Your existing Windows install was done in UEFI/GPT so you need the ajustement.
 
Hi,

I have done the following procedure to migrate a W2012 server from Hyper-V to Proxmox
1) Virtio driver has been dowloaded and installed on W2012 server
2) QEMU Agent has also been installed on W2012 server
3) Hyper-V VM has been shutdown
4) VMHD diskfile has been copied to PVE with scp
5) Disk Image has been checked with : qemu-img check disk.vmhd --> No error
6) Disk image has been converted to QCOW2 format : qemu-img convert disk.vmhd -O qcow2 disk.qcow2
7) Converted Disk Image has been checked again with : qemu-img check disk.qcow2
No errors were found on the image.
975555/2080768 = 46.88% allocated, 0.00% fragmented, 0.00% compressed clusters
Image end offset: 63944327168

8) A VM has been created without network card to prevent any IP conflict after booting with : qm config 104
agent: 1
boot: order=scsi0;ide2
cores: 1
ide2: none,media=cdrom
machine: pc-i440fx-6.1
memory: 4096
meta: creation-qemu=6.1.0,ctime=1666763193
name: server
numa: 0
ostype: win8
scsi0: vm-storage:vm-104-disk-1,size=127G
scsihw: virtio-scsi-pci
smbios1: uuid=c4d931ee-cc16-4c90-a9c4-9020140b767b
sockets: 1
vmgenid: eaa50655-6bc9-4c42-acdc-b04240b4163e

9) The VMID 104 has been started but it is unable to boot (No bootable device !)

Please help.
Bonjour!

I know your problem has been solved, but just to save you time in the future...
You tried both Hyper-V > Export to VHD and then later Starwind P2V + qemu-img convert. Well, both should work fine, I generally export from Hyper-V, but the step that will save you time is:
Code:
qm importdisk <vmid> <virtualdiskfile.vhd> <proxmox-storage-volume-destination>
For your case, I think:
Code:
qm importdisk 104 ws2012-filename.vhd vm-storage

And this step will save you time by performing both the vhd to qcow2 conversion automatically, move the disk to the preferred storage, and assign the newly converted and moved disk to the VM you want. Good advice from others about virtual mobo type and clarifying BIOS vs UEFI and their differences in regards to EFI disks vs partitions. Note that if you want a UEFI VM to have a larger console resolution, you will need to edit the config in the EFI disk to configure it.

Cheers,


Tmanok
 
@santiagobiali, it works !!

I have set the BIOS to OVF (UEFI. Then, I have first Detached the QCOW2 disk drive. I have created an EFI Disk from the GUI and I have attached again the QCOW2. It is declared as SATA device. Finally, I have added the sata0 to the Boot Order. It has taken some time to boot but it works.

This is the current configuration for sharing with community:
agent: 1
bios: ovmf
boot: order=sata0;ide2
cores: 1
efidisk0: vm-storage:vm-104-disk-1,efitype=4m,pre-enrolled-keys=1,size=4M
ide2: none,media=cdrom
machine: pc-q35-6.1
memory: 4096
meta: creation-qemu=6.1.0,ctime=1666851496
name: server
numa: 0
ostype: win8
sata0: vm-storage:vm-104-disk-0,size=127G
scsihw: megasas
smbios1: uuid=e33e47cb-954b-4322-9f73-46f7892471fa
sockets: 1
vmgenid: 5409379f-dfe5-43cd-a9d4-1f94366fa595

Is it safe now to change the device from SATA to Virtio? @toomanylogins says that we need to create a dummy disk with Virtio to enable the drivers for loading. Virtio drivers and QEMU Agent has been installed in VM when it was running on Hyper-V.

Thank you for your help!
This works for me.
 
Sorry for using this thread but it's the same issue which I have now.
Did excatly what @Tmanok wrote but now I have the issue that the changes in the UEFI BIOS are not saved for booting from the correct disk.
What can I do to fix this? Or should I leave it to non UEFI as I don't need the full resolution of the desktop?
 
Last edited:
Set the VM bios to same of the original machine.

Windows need gpt disk layout with the mandatory efi fat32 boot part and its new bootloader to boot after a switch from SeaBIOS to OVMF (UEFI).

btw "Boot Order" is done from Options of VM.
 
Set the VM bios to same of the original machine.

Windows need gpt disk layout with the mandatory efi fat32 boot part and its new bootloader to boot after a switch from SeaBIOS to OVMF (UEFI).

btw "Boot Order" is done from Options of VM.
I have imported the disk with the command:
qm importdisk <vmid> <virtualdiskfile.vhdX> <proxmox-storage-volume-destination>
and these VM Settings:

1669643806492.png

then when the VM starts I press ESC and I have this defaults in the boot manager. When I change it to the last entry QM00001 then I can boot into Windows
 

Attachments

  • 1669643901955.png
    1669643901955.png
    104.7 KB · Views: 45
Last edited:
you need to re-use the small empty efi disk , it's needed by proxmox to store uefi bios settings like boot order and resolution.
it contains pre-enrolled keys else Windows Update cannot apply updates (since few months).
 

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!