What virtual disk formats are comptatible with GPT?

260 Views Asked by At

I'd like to write a bootloader/ os using uefi so naturally I'm using virtualbox to shortcut the feedback loop. Currently I've made a gpt partition file in my workspace, but now I'd like to hook it up to a virtual machine. Unfortunately GPT is meant to partiton the entire device and I need to do so in a Virtual Hard drive. I've looked into vdi (which I don't think I want) and vhd files, where ultimate I'd like to copy and paste the binary into those files and have it work like a booting a normal hd under efi,... but I'm lost as to where to start.

There a few other virtual hard drive formats but I'm not sure what to pick. Also there is little documentation on how any of these formats work. What type of virtual hard drive can I use to accomplish this task? And which format has the best documentation?

1

There are 1 best solutions below

0
On

I'll suggest don't go into details of virtual disk layout. Best way to achieve would be:

  • mounting your choice of virtual disk, so that it appears as a normal disk on the host OS (Microsoft allows mounting of vhd/ vhdx disks on Windows server).

  • attaching the disk to a proxy VM, from inside that proxy vm, your virtual disk would appear as regular disk.

Once you have abstracted the virtual disk as a regular disk you can write binary data at any offset you wish.

Another interesting thing not all hypervisors support UEFI booting. So you'll have to choose the Hypervisor which supports UEFI booting to complete your end-to-end experiment.