[SOLVED] Hyper-v export with GPT partition table will not boot

omen

Member
Oct 16, 2014
14
0
21
We are working on transitioning a department off Hyper-v onto Proxmox, but have hit a snag with a 2012R2 server that has a GPT partition table. It gets stuck in a boot loop indicating: No bootable device. Retrying in 1 seconds. Per the FAQ I checked the partition table, and one of the partitions has the boot flag set.
Code:
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  316MB   315MB   ntfs         Basic data partition          hidden, diag
 2      316MB   419MB   104MB   fat32        EFI system partition          boot, esp
 3      419MB   554MB   134MB                Microsoft reserved partition  msftres
 4      554MB   64.4GB  63.9GB  ntfs         Basic data partition          msftdata

I tired booting off the Windows install CD and running:

  • bootrec /fixmbr
  • bootrec /fixboot
But that didn't fix it.

I tried booting a GParted live CD and setting the disk flag
Code:
(parted) disk_set pmbr_boot on
Now I get a "Missing Operating System" error.

Our Hyper-v exports with MBR work just fine, it's just the few with GPT that are hanging us up.

Has anyone run into this before? How did you work around it?

Thanks,
Omen
 
Last edited:
Is it a hybrid-MBR/GPT? Because windows doesn't like to boot from a pure GPT without UEFI. There's also DUET which might work.
msdn said:
all versions can use GPT partitioned disks for data. Booting is only supported for 64-bit editions on UEFI-based systems.[1]

So the options are to convert to MBR (eg. with gdisk), use UEFI DUET [2], or try to use qemu with uefi [3].
Personally I'd go with converting to MBR as there's no reason to add any unnecessary overhead to a VM unless you really need support for 4TB drives inside your VM.

[1] https://msdn.microsoft.com/en-us/library/windows/hardware/dn640535(v=vs.85).aspx (Tue, 29 Sep 2015 09:59:44 +0200)
[2] http://www.rodsbooks.com/bios2uefi/
[3] https://fedoraproject.org/wiki/Using_UEFI_with_QEMU
 
You correctly set the boot/bootdev options in the VM config?

The VM has:

boot: dc
bootdisk: sata0
[snip]
sata0: zstor2-images:158/cl-print.raw,format=raw

I forgot to mention that I'm using Proxmox 3.4, if that makes a difference.
 
Personally I'd go with converting to MBR as there's no reason to add any unnecessary overhead to a VM unless you really need support for 4TB drives inside your VM.
The other options look like they have lots of possibilities to mess up and cause more issues, so I'm going to go with the simple option. Looks like there is free Windows software (AOMEI Partition Assistant) that can do it. I can attach the disk to be converted to another Windows VM. Ah the power of VMs.

Thanks,
Omen
 
Should also be possibly via fdisk/gdisk on linux (iow. directly from the proxmox ve host), but that's always a little tricky (you need to be careful to make sure all the partitions start and end at the exact position they did with the GPT table).
And another nice thing about VMs is that they're very easy to backup before screwing them up ;-)
 
Should also be possibly via fdisk/gdisk on linux (iow. directly from the proxmox ve host), but that's always a little tricky (you need to be careful to make sure all the partitions start and end at the exact position they did with the GPT table).

I mis-read the license for AOMEI Partition Assistant. It's only free for use on non-server OSs. Since mine is 2012R2 it would not work, so I ended up going the gdisk route. This is the sequence that worked for me:

  1. SSH to Proxmox node
    1. modprobe nbd max_part=8
    2. qemu-nbd --connect=/dev/nbd0 /path/to/images/VMID/IMG.qcow2
    3. gdisk /dev/nbd0
    4. The following keys, one at a time, with a return after each:
      1. r g p a 4 p w Y
      2. NOTE: the 4 above is because our Windows install was on partition #4.
      3. NOTE #2: this may only work for disks with 4 or fewer partitions.
    5. qemu-nbd --disconnect /dev/nbd0
  2. Boot from 2012_R2_64Bit_English_-3_MLF_X19-53588.ISO
  3. Repair mode, command prompt:
    1. c:
    2. bootrec /scanos
    3. bootrec /rebuildbcd
    4. bootrec /fixmbr
    5. bootrec /fixboot
  4. Shutdown
 
(...)This is the sequence that worked for me:
(...)
So it's booting again now? Can the thread be marked as [SOLVED] then? :)
 
So it's booting again now? Can the thread be marked as [SOLVED] then? :)
Done! I had to look up how to do that. Not as trivial as clicking a "Marked Solved" button in the message that actually solved it. Thanks for your help.
 
Just a note, because I had a similar problem : should your VM use a VirtIO disk instead of SATA, you must also load the VirtIO drivers from command prompt, before attempting the "bootrec" commands in repair mode :

Code:
drvload f:\viostor\2k12R2\amd64\viostor.inf
 

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!