...
Virtual Devices
Disk
Virtual Machines create large can use physical disks, but most of the time they use "disk image" files that are used to simulate a hard disk. The disk image contains records representing disk sectors, including partition tables. Each VM supervisor seems to have created its own format (VDI for VirtualBox, VMDK for VMWare, VHD for Hyper-V). VirtualBox supports all three formats and has a utility to convert from one to the other. A disk is logically just a sequence of numbered sectors containing data, so any disk image format is equivalent to all the others. Hyper-V has an improved VHDX format that supports larger sized disk images and is a bit more robust Disk image files are typically dynamic, so they start small and grow as data is written to previously unused sector numbers.
There is an exposure if the system crashes while the a dynamic disk image is growing in sizebeing expanded. If your host computer is Windows, then there are extra advantages to the VHD format. The Windows kernel has support for the VHD formate, and can mount If it would be difficult to recover, you might create the disk image file with a fixed size so it doesn't example. VirtualBox claims it can recover from crashes better if the disk is a VDI format, and Hyper-V has an improved version of VHD called VHDX. The VHD format is supported by both systems, so a strategy is to use dynamic VHD files for distribution to other users (and zip them up to save space when they are archived or shared), but then when you get one of these files and intend to use it personally you are free to convert it to one of the other formats.
Windows can "mount" a VHD or VHDX file as if it were a portable disk (like a USB thumb drive). Use the The Windows Disk Manager to mount the drive has an Attach VHD function that lets you mount it and assign disk letters to its the volumes. This
The Windows Boot Configuration (BCD) file also allows you to access files on the virtual disks from the host Windows system when there is no VM running, which makes it easier to maintain VMs.Like a physical hard disk, the disk image in the file can be formatted with either the old style Master Boot Record (MBR) or the modern GPT format. All modern operating systems support both, so the only real issue is how you format the system boot disk. To boot from a GPT disk, the VM has to support a simulated EFI/UEFI firmware. VirtualBox claims to have this support, but it is one of the things that has been "beta" or "experimental" for many years now. Hyper-V can create "Generation 1" VMs with legacy BIOS that boot MBR disks, or "Generation 2" VMs with UEFI BIOS that boot GPT disks, but Generation 2 VMs do not emulate legacy devices and require all special Hyper-V drivers in order to run (although such drivers are in all versions of Windows and many Linux distributions). Disks you don't boot off can have any format, so use GPT because it is newer and betteradd a VHD or VHDX to your boot menu. If you select that option, the system boots from the disk image file as if it were a regular hard disk.
Hard disk image files simulate a bare hard drive, so the first step must be to create one of the two formats of partition tables at the start of the disk. For real disks and modern machines there is no reason to use the legacy Master Boot Record (MBT) format created for the first IBM PC. Modern computers support the newer and better Guid Partion Table (GPT). However, Virtual Machine supervisors often emulate really, really old hardware that provides a lowest common denominator supported by all sorts of operating systems. VirtualBox has what it has called "exprimental" support for the EFI boot mode needed to boot off a GPT disk, but they don't recommend you use it. So to make system disks portable, you generally have to use the MBR format. If you are only going to use Hyper-V, then you can create a GPT system disk and use it with a "Generation 2" type of Virtual Machine, but then you cannot share that disk with others who use VirtualBox because they run on Macs. For data disks that you do not boot, GPT is the obvious choice.
Every Hard Drive is assigned a unique identifier when it is first attached to any operating system. If you copy a disk image file (copy a.vhd b.vhd) then you copy the unique identifier. Windows and Linux will not mount two disks with the same unique identifier at the same time. VirtualBox, in fact, doesn't want two different disk image files on the same host computer, even if they are attached to two different virtual machines. So if you want a copy of the same data or the same system, it is better to use the VirtualBox "clone disk" utility, which changes unique identifiers, rather than just making an ordinary copy of the file. An ordinary copy can be used to make a backup, or to share a copy of the disk image to someone who will put in on another host computer.
...