Glossary
- P2V
- (Physical-to-Virtual) conversion
- P2V converts a physical server's operating system, applications, and data into a virtual machine format (like VMDK).
- V2V
- (Virtual-to-Virtual) conversion
- the process of migrating a virtual machine (VM) from one virtualization platform to another.
- Fixed Disk / "Thick" Provisions
- These disk images are a set size and are never changed. They are roughly the size of the disk defined in the image.
- Dynamic Disk / Growable / "Thin" Provisioned / "Sparse" Provisioned
- the disk image file size can change and is not directly related to the size of the defined virtual disk it holds.
- OVA/OVF
- These are not disk images, but a standard to allow moving of virtual machines between platforms.
- Deploy and Export OVF and OVA Templates
- You can export virtual machines, virtual appliances, and vApps in Open Virtual Format (OVF) and Open Virtual Appliance (OVA). You can then deploy the OVF or OVA template in the same environment or in a different environment.
- How To Convert Virtual Machines Between VirtualBox and VMware
- Migrating to another virtual machine program can be intimidating.
- If you use an ova extension, then all of the files will be combined into one Open Virtualization Format Archive.
- If you use an ovf extensions, several files will be written separately.
- Super Floppy
- This is the term given to a type of USB formating where it has the following features:
- No MBR
- No Partition Table
- 1 Partition that takes the whole of the drive
- The term "super floppy" can be a bit ambiguous, but generally, when people refer to a "super floppy" in the context of USB drives, they often mean a removable drive (like a USB flash drive) that does not have partitions, behaving more like a traditional floppy disk. Some older disk management utilities, like Acronis Disk Director, might label such drives as "Super Floppy."
- This is the term given to a type of USB formating where it has the following features:
- Boot Sector
- This can contain MBR or GPT code.
- Boot sector - Wikipedia
- A boot sector is the sector of a persistent data storage device (e.g., hard disk, floppy disk, optical disc, etc.) which contains machine code to be loaded into random-access memory (RAM) and then executed by a computer system's built-in firmware (e.g., the BIOS).
- Master Boot Record (MBR)
- The MBR is physically the first sector of a data medium (e.g. hard drive or USB stick), which is used by computers for the booting, or start-up process. The computer must be equipped with a BIOS and a x86 operating system.
- The searches for the active partition and then load the VBR
- The MBR code is OS specific.
- This is placed in the boot sector of a drive
- Volume boot record - Wikipedia
- A master boot record (MBR) is a type of boot sector in the first block of partitioned computer mass storage devices like fixed disks or removable drives intended for use with IBM PC-compatible systems and beyond. The concept of MBRs was publicly introduced in 1983 with PC DOS 2.0.
- The MBR holds the information on how the disc's sectors (A.K.A. "blocks") are divided into partitions, each partition notionally containing a file system.
- The MBR also contains executable code to function as a loader for the installed operating system—usually by passing control over to the loader's second stage, or in conjunction with each partition's volume boot record (VBR). This MBR code is usually referred to as a boot loader.
- MBR (Master Boot Record) explained - IONOS UK - The master boot record is a vital piece of code for many PCs to start up. But how does it work, how is it structured and how can it be repaired if necessary?
- Volume Boot Record (VBR)
- This is where Windows/OS start to load.
- The VBR is a file with a specific file name in a specific location.
- The VBR code is OS specific.
- The VBR for Windows is a file in the root called:
BOOTMGR
- Volume boot record - Wikipedia
- A volume boot record (VBR) (also known as a volume boot sector, a partition boot record or a partition boot sector) is a type of boot sector introduced by the IBM Personal Computer.
- The code in volume boot records is invoked either directly by the machine's firmware or indirectly by code in the master boot record or a boot manager. Code in the MBR and VBR is in essence loaded the same way.
- Windows Boot Manager
- Windows Boot Manager - Wikipedia
- The Windows Boot Manager (
BOOTMGR
) is the bootloader provided by Microsoft for Windows NT versions starting with Windows Vista and Windows Server 2008. It is the first program launched by the BIOS or UEFI of the computer and is responsible for loading the rest of Windows. It replaced the NTLDR present in older versions of Windows. - The boot sector or UEFI loads the Windows Boot Manager (a file named
BOOTMGR
on either the system or the boot partition), accesses the Boot Configuration Data store and uses the information to load the operating system throughwinload.exe
orwinresume.exe
on BIOS systems, andwinload.efi
andwinresume.efi
on UEFI systems. - On system with BIOS firmware, the BIOS invokes MBR boot code from a hard disk drive at startup. The MBR boot code and the VBR boot code are OS-specific. In Microsoft Windows, the MBR boot code tries to find an active partition (the MBR is only 512 bytes), then executes the VBR boot code of an active partition. The VBR boot code tries to find and execute the bootmgr file from an active partition.[3]
- On systems with UEFI firmware, UEFI invokes
bootmgfw.efi
from an EFI system partition at startup, starting the Windows Boot Manager.
- The Windows Boot Manager (
- Windows Boot Manager - Wikipedia
- Operating System Boot Loader.
UEFI / MBR Boot Procedure
- Windows MBR Boot Procedure
- MBR is loaded into RAM by the firmware.
- MBR searches for an active partition
- MBR loads the Windows Boot Manager (
BOOTMGR
/ VBR) from the active paritition. - Windows Boot Manager now loads the Windows Boot loader from one of these locations:
\windows\system32\winload.exe \windows\system32\boot\winload.exe
- Windows now loads
- Windows EFI Boot Procedure
- UEFI invokes the Windows Boot Manager from an EFI system partition (ESP) at startup,
\EFI\Microsoft\Boot\bootmgfw.efi
- A user can make an OS selection now, or the default OS is loaded. These settings are defined in the BCD.
- Windows Boot Manager now loads the Windows Boot loader from one of these locations.
\windows\system32\winload.efi \windows\system32\boot\winload.efi
- Windows now loads
- UEFI invokes the Windows Boot Manager from an EFI system partition (ESP) at startup,
Links
- UEFI boot: how does that actually work, then? | AdamW on Linux and more - This blog post is aimed at regular everyday folks; it's intended to dispel a few common myths and help regular people understand UEFI a bit better. It is not a low-level fully detailed and 100% technically accurate explanation, and I'm not a professional firmware engineer or anything like that.
- Difference between bootmgr.efi and bootmgfw.efi? - Super User
- Could someone explain the EFI partition file structure please? | Reddit - I'm trying to boot back into PopOS after something went wrong during an update. I need to recreate an EFI boot entry in NVRAM, and am looking for the correct .efi file to point to on the EFI partition.
- 1. Introduction — UEFI Specification 2.10 documentation | UEFI Specification - This Unified Extensible Firmware Interface (UEFI) Specification describes an interface between the operating system (OS) and the platform firmware. UEFI was preceded by the Extensible Firmware Interface Specification 1.10 (EFI). As a result, some code and certain protocol names retain the EFI designation. Unless otherwise noted, EFI designations in this specification may be assumed to be part of UEFI.
- edk2/MdePkg/Include/Uefi/UefiSpec.h at master · tianocore/edk2 · GitHub - A boot loader code example.
- UEFI vs BIOS: What is the difference between BIOS and UEFI? | TheWindowsClub - A imple and concise answer to this questions.
Image Formats
- VHD (deprecated)
- (Microsoft Virtual PC Virtual Hard Disk)
- Azure (requires fixed size), Virtual PC,
- Developed by Microsoft
- Does Azure use VHD or VHDX? - Darwin's Data - Azure supports both VHD and VHDX disk formats for virtual machine disks. The choice between VHD and VHDX depends on the specific scenario and requirements.
- VHD should not be used for new systems.
- What is a VHD File? (Unpacking Virtual Hard Disk Mysteries) - Discover how Virtual Hard Disk (VHD) files revolutionize computing by simplifying management of multiple operating systems and enhancing efficiency.
- VHDX
- (Microsoft Hyper-V Virtual Hard Disk)
- Microsoft Hyper-V
- [MS-VHDX]: Virtual Hard Disk v2 (VHDX) File Format | Microsoft Learn - Specifies the Virtual Hard Disk v2 (VHDX) File Format Protocol, the virtual hard disk format that provides a disk-in-a-file abstraction.
- Hyper-V technology overview | Microsoft Learn - Describes what Hyper-V is, how to get it, key features, and common uses. This article includes an overview for Hyper-V in Windows and Windows Server.
- Hyper-V Manager: Is It the Right Tool for Hyper-V Configuration? - Hyper-V Manager is used for creating, configuring and deleting Hyper-V hosts and VMs. Read this blog post to learn more about Hyper-V Manager capabilities.
- Hyper-V Disk Types Explained - BDRSuite
- Hyper-V Disks : Fixed Size, Dynamically Expanding, and Differencing Disks
- In today’s blog post, we’ll discuss what virtual file formats are supported by Hyper-V and their types. We’ll cover in detail, the different types of VHD/VHDX, and how to choose the right one for your business requirements.
- VMDK
- (VMware Virtual Disk File)
- VMware and ESXi
- VDI
- (VirtualBox Virtual Disk File)
- VirtualBox
- QCOW (deprecated)
- KVM type Virtual Machines (old format, deprecated)
- QCOW2
- KVM type Virtual Machines
- HDD,HDS
- (Parallels Desktop Virtual Disk File)
- Parallels
- DD
- These are created by the Linux command
dd
. - This is a binary blog, made by copying the RAW bits, and therefore is file system agnostic.
- These are created by the Linux command
- IMG
- (Disk or Partition Image File)
- This binary blog, made by copying the RAW bits, and therefore is file system agnostic.
- IMG (file format) - Wikipedia
- The .img file extension was originally used for floppy disk raw disk images only. A similar file extension, .ima, is also used to refer to floppy disk image files by some programs. A variant of raw image, called IMZ, consists of a gzipped version of a raw floppy disk image. These files use the .imz file extension, and are commonly found in compressed images of floppy disks created by WinImage.
- QEMU uses the .img file extension for a raw image of a hard disk drive and calls the format "raw".
- An .img file is just a raw disk image, a sector-by-sector copy of a storage device (like a hard drive, SSD, USB stick, etc.). It doesn’t have a special format; it’s literally just the binary contents of a disk.
.img
was not a format invented by dd, it’s just a raw image file — a byte-for-byte copy of a disk.
- IMA
- (Virtual Floppy Disk Drive)
- This is a binary blog, made by copying the RAW bits, and therefore is file system agnostic.
- IMZ
- GZipped (Virtual Floppy Disk Drive)
- RAW
- This is a binary blog, made by copying the RAW bits, and therefore is file system agnostic.
- BIN
- This is a binary blog, made by copying the RAW bits, and therefore is file system agnostic.
- WIM
- Microsoft Windows Image File
- This is used to hold a Windows operating system and various other task.
- This is not strictly a Disk Image file but can behave like one.
- PHVD
- Paragon
- PMFX
- DiskGenius
- E01
- EnCase
- AFF
- (Advance Forensics Format)
- EWF
- (Expert Witness Compression Format)
Software
V2V and P2V
There will be cross over between software functionality and their category.
- Conversion
- StarWind V2V and P2V Converter
- StarWind V2V / P2V Converter converts (sic!) virtual machines from one format to another, and turns physical machines into VMs as well. It simplifies transition between virtual environments, both public clouds and on-premises, making migration quick and frictionless. With on-the-fly, snapshot-based “direct” VM conversion between hypervisors, StarWind eliminates downtime and the burden of allocating intermediate space, saving valuable time and resources.
- Supports all the major image formats as source and destination.
- StarWind V2V Converter generally does not directly support converting or accessing USB drives as part of its core functionality. While it can convert virtual machine images and physical disks, USB drives are typically handled differently within virtualized environments.
- StarWind V2V Converter Help : Command Line Interface | Starwind - There are two ways for working with StarWind V2V Converter without GUI which is covered here.
- StarWind V2V Converter Overview (Part 5): Converting VMs to QCOW2v3 | Starwind - The StarWind V2V Converter series wraps up with an exciting new feature – QCOW2v3 support! From larger disks to better encryption, see how this format can transform your VM migration workflow Introduction Welcome to the fifth and final article in our StarWind V2V Converter series. In the previous articles, we covered converting virtual machines (VMs) to and from Oracle VirtualBox, oVirt, Proxmox, and explored hot migration from Microsoft Hyper-V to VMware ESXi. Now, we'll delve into an exciting new feature of StarWind V2V Converter: the ability to convert your disk images into the QCOW2v3 format. QCOW2v3 is the latest iteration of the widely used QEMU Copy-On-Write format, offering better performance, improved snapshot capabilities, and more efficient use of storage space. This makes it ideal for virtualization professionals who need a reliable, flexible, and powerful conversion tool for optimized VM migrations. For those who haven't yet tried StarWind V2V Converter, you can download.
- VMware vCenter Converter Standalone
- VMware vCenter Converter is an essential tool for users of VMware Workstation, enabling seamless physical-to-virtual machine conversions. While bundled with VMWare Workstation, it installs independently and supports individual version upgrades, offering flexibility and efficiency for virtualization tasks.
- Is able to reach into an offline virtual machine image and change the drivers in the Windows installation to the ones the VMWare environments need/offer.
- Convert Windows and Linux physical machines or third-party VMs into VMware virtual machines.
- Resize partitions and control disk formats during migration.
- Extremely painful sign up and download procedure, the website is terrible, but at least the software is free.
- Introduction to VMware vCenter Converter Standalone - VMware vCenter Converter Standalone provides an easy-to-use solution that automates the process of creating VMware virtual machines from physical machines (running Windows and Linux) and from other virtual machine formats.
- VMware vCenter Converter Download | filehorse
- VMware vCenter Converter transforms your Windows and Linux-based physical machines and third-party image formats to VMware virtual machines.
- It supports many source physical machines, including Windows and Linux desktop and server editions. It also supports the conversion of third-party virtual machines like Hyper-V and KVM.
- P2V and V2V Conversion: The software allows you to perform both Physical-to-Virtual (P2V) and Virtual-to-Virtual (V2V) conversions, giving you the flexibility to migrate from physical servers to virtual ones or move virtual machines between different hypervisors.
- This page has a good write-up of features.
- This is an alternative download source.
- Migrate machines to VMWare vCenter VMs using standalone converter - Notes_Wiki - VMWare standalone converter can be used for converting physical or virtual machines from different types of physical hardware or hypervisors to VMWare vCenter based VMs. For the conversion use following steps:
- VBoxManage
- This is part of the VirtualBox hypervisor package.
- VBoxManage is the command-line interface to Oracle VM VirtualBox. With it, you can completely control Oracle VM VirtualBox from the command line of your host operating system.
- It also has the ability to convert and manipulate disk images.
- How to Convert Between Fixed and Dynamic Disks in VirtualBox | How-to-Geek - VirtualBox allows you to choose either a dynamically allocated or fixed size disk when creating a new virtual hard disk file.
- Convert a VirtualBox Fixed Disk to a Dynamic or vice versa | TheWindowsClub - When creating a virtual machine, you are asked to select a disk type, you can either go for Fixed Disk or Dynamic Disk. What if you went for a Fixed Disk and later on realized that you need a dynamic one, or vice-versa? Well! You can convert one into another. In this post, we will see how you can convert a VirtualBox Fixed Disk to a Dynamic one or vice-versa.
- Use VBoxManage for Raw to VDI
VBoxManage convertfromraw source.img output.vdi --format VDI
- QEMU disk image utility (qemu-img)
- This is part of the QEMU hypervisor package.
- qemu-img allows you to create, convert and modify images offline. It can handle all image formats supported by QEMU.
- There are many options and are all run from the command line.
- Use qemu-img for Raw to VHDX
qemu-img convert -f raw -O vhdx source.img output.vhdx
- Disk2vhd - Sysinternals | Microsoft Learn
- Disk2vhd simplifies the migration of physical systems into virtual machines.
- Disk2vhd is a utility that creates VHD (Virtual Hard Disk - Microsoft's Virtual Machine disk format) versions of physical disks for use in Microsoft Virtual PC or Microsoft Hyper-V virtual machines (VMs).
- The difference between Disk2vhd and other physical-to-virtual tools is that you can run Disk2vhd on a system that’s online.
- Disk2vhd uses Windows' Volume Snapshot capability, introduced in Windows XP, to create consistent point-in-time snapshots of the volumes you want to include in a conversion.
- You can even have Disk2vhd create the VHDs on local volumes, even ones being converted (though performance is better when the VHD is on a disk different than ones being converted).
- vhdtool.exe / vhdxtool.exe (Microsoft)
- These are old sofwares made by Microsoft and should not be used.
- VhdTool Is Dead, Long Live VhdxTool! | Systola
- KB200004
- This article covers this new tool and explains a few things.
- VhdxTool | Systola
- KB100005
- VhxdTool is a command line utility for Windows for quick creation and resizing of virtual hard disk files (VHDX).
- Convert-VHD (PowerShell) (Hyper-V Management Tools)
- How to Convert from Dynamic VHD/VHDX Disk Format to / from Fixed in Hyper-V | BC Blog
Convert-VHD –Path c:\VM\my-vhdx.vhdx –DestinationPath c:\New-VM\new-vhdx.vhdx –VHDType Dynamic
- Converting Fixed Size VHDs to Dynamic Sized VHDs – The World According to Mitch - You can use the Hyper-V menu or powershell.
- Convert VHD to VHDX | Virtualization file conversions - How to convert VHD to VHDX for better performance and larger disk support using Hyper-V Manager or PowerShell.
- How to convert VHD to VHDX using Hyper-V Manager | TheWindowsClub - If you have a VHD file and want to convert it to VHDX format, you can use Hyper-V Manager. This tutorial will show you how to convert VHD to VHDX using Hyper-V Manager in Windows 11/10.
- CITRIXEN: Convert, Resize, and Optimize VHD and VHDX files with PowerShell
- Convert, Resize, and Optimize VHD and VHDX files with PowerShell.
- This small article covers a lot.
- How to Convert from Dynamic VHD/VHDX Disk Format to / from Fixed in Hyper-V | BC Blog
- Powershell
- Fixed to Dynamic, Dynamic to Fixed
## Fixed --> Dynamic Convert-VHD -Path "D:\Path\To\Fixed-Disk.vhd" -DestinationPath "D:\Path\To\Dynamic-Disk.vhd" -VHDType Dynamic ## Dynamic --> Fixed (For Reference Only) Convert-VHD -Path "D:\Path\To\Disk-dynamic.vhd" -DestinationPath "D:\Path\To\Disk-trimmed-fixed.vhd" -VHDType Fixed
- Fixed to Dynamic, Dynamic to Fixed
- Multiple
- How to Convert VMDK to VHDX (VMWare to Hyper-V)? | TheITBros
- In an environment where different versions of the hypervisor are used, it is often necessary to convert virtual machine files from one format to another. In this article, we will look at how to convert a VMware virtual machine’s VMDK file to Hyper-V (VHDX) format.
- The article covers both PowerShell, Starwind V2V converter and QEMU-img.
- Convert VHD from Dynamic to Fixed | Easy Guide to Convert Dynamic VHD to Fixed | DiskInternals - Easily convert dynamic VHD to fixed or fixed VHD to dynamic with this step-by-step guide ?️. Learn the best tools and methods for hassle-free VHD conversions!
- Ultimate Guide to Converting Virtual Disks with VBoxManage and Other Tools - Learn how to convert VDI, VMDK, VHD, and more with VBoxManage, qemu-img, and other system virtualization tools.
- How to Convert VMDK to VHDX (VMWare to Hyper-V)? | TheITBros
- StarWind V2V and P2V Converter
- Resizing
- VhdResizer | Softpedia
- A small and straightforward Windows utility designed to help users to shrink or expand the volumes of VHD files. Made in 2007.
- How to Resize a Microsoft Virtual Hard Drive (VHD) File - When you create a Microsoft Virtual Hard Drive either through Virtual PC or Virtual Server, you have to specify the maximum size of the file up front.
- VhdxTool
- VhxdTool is a command line utility for Windows for quick creation and resizing of virtual hard disk files (VHDX).
- This offers similar functionality to a former program vhdtool for Windows Server 2008/R2, but while vhdtool worked with older (VHD) format, vhdxtool works with the new (VHDX) format.
- VhdResizer | Softpedia
- Compacting
- vboxmanage
- wslcompact
- Compacts the size of the ever-growing WSL vhdx images.
- Compacting the size of the ever-growing WSL images · microsoft/WSL · Discussion #9566 · GitHub
- Give the usage commands of the tool.
- Using virtual drives is a great idea. But, ext4 filesystem optimization inside VHDX images is not so well supported by the optimization tools. NTFS partitions are well optimized, but ext4 partitions are not so well optimized, and WSL suffers from this problem.
- Since WSL doesn't provide a good solution for this, I have coded a small utility wslcompact that compacts the WSL partitions.
- Any thoughts on improving the tool would be welcome. However, it would be better if the WSL team releases something similar. A good improvement would be an improvement in the export function, not only making a copy of the VHD file but dumping the contents in a newly created VHD, which would considerably reduce the size of the backup.
- Optimize-VHD (Hyper-V Management Tools)
- Needs Hyper-V to be installed.
Optimize-VHD -Path "Path\To\Your\VHDfile.vhdx" -Mode Full
- Needs Hyper-V to be installed.
- DISKPART
- Always present in Windows.
- Optimize-Vhd doesn't require diskpart, of course, both processes can do more or less the same regarding drive compaction. Diskpart is somehow more convenient as it is readily available in all systems without the need for installing any extra package.
- diskpart | Microsoft Learn - Reference article for the diskpart command interpreter, which helps you manage your computer's drives.
- Compact a VHD file created by Disk Management? - Super User
- You can then complete the compacting using diskpart from a Command Prompt
- Run
diskpart
- Select the disk via its path: s
elect vdisk file="<path>"
- Attach it as read-only:
attach vdisk readonly
- Compact it:
compact vdisk
- Upon completion of the compact, detach it again:
detach vdisk
- Run
- You can then complete the compacting using diskpart from a Command Prompt
- Image Creation (Disk)
- DiskGenius: Data Recovery, Partition Manager, Backup & Disk Utilities
- This software handles a variety of formats (.vmdk, .vhd, .vhdx, .vdi, .hdd, .img) but is read only in the free version, this means you cannot backup a drive to one of these formats with the free version. There is a proprietary DiskGenius disk image format (.pmfx) you can use for normal disk operations.
- The paid version will also allow you to convert between the various Disk Image formats
- You can also browse the files on disk images.
- DiskImager
- A simple but powerful tool for saving and writing disk images.
- Save raw binary images of any disk as regular files.
- Write disk images to physical disks.
- When writing an image to a disk, supports industry-standard disk image formats (in addition to raw images), including VDI (VirtualBox), VMDK (VMware), E01 (EnCase), and VHDX/VHD (Virtual hard disk).
- MultiDrive
- 100% free disk management software for Windows. Clone, backup, restore, and erase drives with ease.
- Allows you to create IMG of drives and I think also USB Drives.
- Linux dd
- This is a low-level command-line utility that copies data from one location to another, byte by byte. It's commonly used to:
- Clone disks or partitions
- Create disk images
- Write ISO or IMG files to USB drives
- How to Make Disk Images in Linux with the DD Command: An Essential Guide for Sysadmins – TheLinuxCode
- Hey there! Do you manage Linux systems and need to make backups or clone disks? If so, the dd command should be part of your essential sysadmin toolkit. In this guide, I‘ll show you how to use dd to create complete disk images in Linux.
- This is very comprehensive.
- This is a low-level command-line utility that copies data from one location to another, byte by byte. It's commonly used to:
- OSFClone
- OSFClone is a free, open-source utility designed for use with OSForensics. OSFClone is a self-booting solution which lets you create or clone exact, forensic-grade raw disk images.
- OSFClone is a free, self-booting solution which enables you to create or clone exact raw disk images quickly and independent of the installed operating system. In addition to raw disk images, OSFClone also supports imaging drives to the open Advance Forensics Format (AFF), AFF is an open and extensible format to store disk images and associated metadata, and Expert Witness Compression Format (EWF). An open standard enables investigators to quickly and efficiently use their preferred tools for drive analysis.
- DiskGenius: Data Recovery, Partition Manager, Backup & Disk Utilities
- Image Creation (USB)
- Rufus - The Official Website
- Rufus is a small application that creates bootable USB drives, which can then be used to install or run Microsoft Windows, Linux or DOS.
- This app also allows you to create disk image files (VHD/VHDX) of any USB pendrives plugged in.
- These are fixed-size and raw, fully equivalent to a block-for-block disk image.
- Rufus produces fixed (non-dynamic) VHD/VHDX images.
- Fixed VHD/VHDX: Fully sized from the start, raw disk image with footer—this is what Rufus generates.
- so reclaim the free space if you want to compact the drive, you woul dneed to convert to a Dynamix
- Disk Format information
- Why does Rufus call a .vhd file a DD Image? - Super User
- Rufus developer here. This is because the save option is only for uncompressed VHD images, and uncompressed VHD images are just the same as DD images with an extra 512 byte footer added.
- So, for all purposes, you can use DD to write the VHD image created by Rufus, and it will work just fine (with either the extra 512 byte footer being ignored as random data, if you use a larger sized disk, or being dropped, if using same exact same size disk).
- Ergo, what Rufus creates when you click the save button is essentially a DD image since it can very much be used as such.
- PS: For those who wonder why Rufus doesn't compress the VHD images it saves this is primarily due to the compression algorithm being used by Microsoft being very poor (IMO) and therefore not worth spending time implementing support for. This is also part of the reason why save as DD image is only available when clicking the advanced options.
- Getting Rufus to output to a disk image file - Super User
- Akeo
- Rufus can create an uncompressed VHD image from whichever drive you have currently selected, which, for all intent and purposes can be used as a regular DD image (because the only difference with a regular DD image is an extra 512-byte footer, which, no matter how much you may think otherwise, will NEVER EVER come in the way of using the
.vhd
as a.img
). - UPDATE: And recent versions can also create compressed VHDX images, that take less space, and that can work the same way.
- Rufus can create an uncompressed VHD image from whichever drive you have currently selected, which, for all intent and purposes can be used as a regular DD image (because the only difference with a regular DD image is an extra 512-byte footer, which, no matter how much you may think otherwise, will NEVER EVER come in the way of using the
- gronostaj
- Solution 1: Read the image from a prepared flash drive. Win32DiskImager can be used to do this.
- Solution 2: Prepare your own hybrid ISO. Most of modern Linux distros use so called hybrid ISOs. They are valid ISOs that can be burned to a CD/DVD, but at the same time they are valid disk images that can be written to a flash drive. For example you could feed an Ubuntu ISO to Win32DiskImager and have it write it to disk (Rufus may offer this feature for some ISOs, it calls it "dd mode"). Community documentation on ISO customization is ten to thirteen years old, but may still be useful and you'll find many useful guides all over the Internet.
- Akeo
- Make image from disc · Issue #1274 · pbatard/rufus · GitHub
- Aha, then this is my cue to enlighten you:
- An uncompressed is just a DD image with a 512 byte footer added.
- Therefore, because writing that footer (or not) is inconsequential, you can absolutely use the
.vhd
that was created by Rufus as a DD image. - Now, in case you have doubts about those extra 512 bytes potentially causing an issue let me explain that:
- If you are restoring the image to a drive of the exact same size as the one you used to create the VHD, then these 512 bytes will happily be dropped by
dd
(At least the Linux version ofdd
doesn't care much if you try to write more data that the drive can hold - it'll report it, but it will not have any kind of impact on the data written), leaving you with a 1:1 copy of the original drive. - If you are using a drive that is larger than the one you used to create the VHD, then, even if you are unfortunate enough to have the 512-byte VHD footer fall at the precise location where the GPT backup is located (a few sectors before the end of the drive), then because this is a backup, any modern OS will detect that the backup is corrupted and fix it by duplicating the master, which is located at the beginning of the disk. Oh, and, even when you restore a pure GPT based DD image onto a larger drive, this kind of GPT backup fix needs to happen anyway, since, obviously, the backup GPT from the original image is at the wrong location, and a new backup GPT needs to be created at the right one. In other words, the writing of that 512-byte VHD footer is no different than the case of expecting whatever garbled data one might find at the expected location for the backup GPT when writing a "regular" DD image. And really, even as this is a complete non-issue, the possibility that the VHD footer will fall at the precise location where the backup GPT should go is exceedingly small. Oh, and if your image is using a MBR partition table, then it's even less of an issue, because none of the data up to (size of VHD - 512 bytes) will EVER be seen as accessible from the original image.
- If you are restoring the image to a drive of the exact same size as the one you used to create the VHD, then these 512 bytes will happily be dropped by
- In summary, and I really have to stress this out, for all purposes, an uncompressed VHD image is exactly the same as a DD image. Therefore you can use the Rufus created
.vhd
exactly as you would use a standard DD image. There REALLY is no "What if...?" or "But surely..." associated to using an uncompressed.vhd
as you would a DD image.
- Why does Rufus call a .vhd file a DD Image? - Super User
- Disk image created by Rufus is shown as a growable image and not as a fixed disk
- Why This Happens
- Rufus does not create truly dynamic (growable) disks. Instead, it writes raw, fully allocated (fixed-size) disk images, even when saving to
.vhdx
format. But:- Rufus doesn't explicitly write the full VHDX metadata headers the same way Hyper-V or Windows Disk Management does.
- This can cause third-party tools like StarWind to misinterpret the image format or default to "growable" in their interface or assumptions.
- Rufus does not create truly dynamic (growable) disks. Instead, it writes raw, fully allocated (fixed-size) disk images, even when saving to
- Evidence & Explanation
- StarWind is designed to work with officially structured VHDX files (including all metadata).
- Rufus writes uncompressed, flat VHDX files but doesn’t necessarily populate all optional VHDX metadata fields.
- StarWind may detect the structure or size mismatch and label it as "growable" (which usually means "dynamic")—even if it's not actually dynamic.
- How to Check What It Really Is
- You can confirm the truth using:
- PowerShell
Get-VHD -Path "C:\path\to\your.vhdx"
- Look for VHDType: Fixed or Dynamic
- vhdxinfo (from libvhdi)
vhdxinfo mydisk.vhdx
- It will show you
type: fixed
ortype: dynamic explicitly
.
- It will show you
- Workaround or Fix
- If you want the VHDX to be 100% standards-compliant and recognized as "fixed" by all tools (including StarWind), do this:
- Mount the Rufus-generated VHDX in Windows.
- Create a new fixed-size VHDX using:
New-VHD -Path "C:\fixed-compliant.vhdx" -SizeBytes 10GB -Fixed
- Use
dd
orxcopy
to clone contents to the new disk.
- This gives you a 100% spec-compliant VHDX that should show as "fixed" in all tools.
- If you want the VHDX to be 100% standards-compliant and recognized as "fixed" by all tools (including StarWind), do this:
- Why This Happens
- ImageUSB
- ImageUSB is an effective tool for writing an image to multiple USB Flash Drives for mass duplication and creating images of thoese drives.
- ImageUSB is a free utility which lets you write an image concurrently to multiple USB Flash Drives. Capable of creating exact bit-level copies of USB Flash Drive (UFDs), ImageUSB is an extremely effective tool for the mass duplication of UFDs.ImageUSB also supports writing of an ISO file byte by byte directly to an USB drive (*). ImageUSB can also be used to install OSFClone to a USB Drive for use with PassMark OSForensics™.
- Unlike other USB duplication tools, ImageUSB can preserve all unused and slack space during the cloning process, including the Master Boot Record (MBR). ImageUSB can perform flawless mass duplications of all UFD images, including bootable UFDs.
- ImageUSB includes functionality to Zero a USB Flash Drive. This will replace the contents of the entire drive with 0s. Or alternatively to just Zero the MBR and/or GPT entries that exists on the drive. In addition, imageUSB has the ability to reformat even hard to format drives and reclaim any disk space that may be lost previously.
- (*) CD ISO images use a different file systems compared to USB drives. So the direct imaging of ISO9660, Joliet or UDF file system, from a CD, to a USB drive, might not allow the USB drive to function in all operating systems. A reformat can recover the drive however. As of V1.5, imageUSB now supports extraction of ISO contents onto USB Drive.
- Warning: Due to the forensic nature of image duplication by ImageUSB, please ensure that you select UFDs with a storage size similar to the image you wish to duplicate. For example, if a 2GB image is copied to an 8GB USB Flash Drive, the drive will only be able to use two out of the eight gigabytes of storage space. In this scenario, users will need to reformat the UFD in order to access the rest of the storage space.
- USB Image Tool – alex's coding playground
- USB Image Tool can create images of USB flash drives, SD cards and any other devices that are mounted as USB storage drives.
- It can create an exact byte copy of these devices in raw and compressed image formats and also restores or write images on the device.
- USB Image Tool works with any device, that implements the USB Mass Storage protocol. This includes flash drives, card readers/SD cards and a lot of other devices like digicams, cell phones and mobile music players.
- USBImager
- A really simple GUI application that writes compressed disk images to USB drives
and creates backups. Available platforms: Windows, MacOSX and Linux. Its interface is as simple as it gets, totally bloat-free.
- A really simple GUI application that writes compressed disk images to USB drives
- Rufus - The Official Website
Disk Image Repair software
- VMFS Recovery™ - repair VMDK, VMDK recovery tool. ESX/ESXi recovery | DiskInternals - VMFS Recovery™ repairs VMDK files stored in Virtual Machine images and compatible with WMware® VMFS, vSphere, ESX, ESXi Server, VirtualPC, VirtualBox and other. VMFS Recovery™ recovers data from corrupt or deleted VM images.
- VDI Repair Tool for Virtual Disk Image Recovery - SysInfo - To repair corrupt VDI file, VDI Repair tool is the best solution one can have. Get free VDI recovery tool to restore Virtual disk image data from corrupt VDI files.
- VHD Recovery Tool to Recover Deleted, Corrupted VHD File Free - VHD Recovery Tool is a best Virtual File Recovery software to recover damaged VHD file. It repairs corrupt VHD file and recover VHD data in their original form.
- Smart Virtual Disk recovery solution- restore corrupt & formatted VHD files. - Virtual disk recovery '' VHD recovery tool ''is made to restore corrupt VHD files. Get the best VHD recovery tool online to recover your corrupt and formatted VHD files.
- Virtual Disk Recovery Tool to Recover Data from Corrupt Disk Image File - Aryson Virtual Disk Recovery Software permits you to repair and restore all types of corrupted Virtual Machine VMware Files including all databases.
Other Software
- sDelete (Secure Delete)
- SDelete - Sysinternals | Microsoft Learn - Securely overwrite your sensitive files and cleanse your free space of previously deleted files using this DoD-compliant secure delete program.
- How to use the command 'sdelete' (with examples) - Secure deletion is an essential part of data management and protection, particularly when it involves sensitive information. The command-line tool ‘sdelete’ offers a robust solution by permanently erasing files, directories, or entire volumes, thus ensuring that data cannot be recovered. Developed by Sysinternals, ‘sdelete’ employs advanced algorithms to overwrite data, mitigating the risk of unauthorized data access. Below we explore various use cases, each tailored to different secure deletion needs.
- Meet Sdelete, the obscure Microsoft tool that wipes data for good | PCWorld - Sdelete, short for Secure Delete, is a powerful but little-known tool from Microsoft's Sysinternals suite that permanently wipes files and folders by overwriting data.
- How to use SDelete to ensure deleted data is gone for good | TechTarget - Standard delete functions aren't good enough to guarantee data is gone for good. Learn how to use SDelete to ensure your information is removed permanently.
Mounting and Managing Images (in Windows)
- Windows can mount VHD and VHDX natively.
- Simple VHD Manager v1.5 - Simple Vhd Manager helps Virtual Hard Drive (VHD/VHDX) users to create and attach them or add them to boot menu.It is a Portable freeware
- DAEMON Tools Lite: The most personal application for disc imaging yet - DAEMON-Tools.cc - DAEMON Tools Lite allows you to mount all known types of disc image files and emulates up to 4 DT + SCSI + HDD devices. It enables you to create images of your optical discs and access them via well-organized catalogue.
- Arsenal Image Mounter - Arsenal Image Mounter mounts the contents of disk images as complete disks in Windows.
- FTK Imager - Forensic Data Imaging and Preview Solution | Exterro
- A free data preview and imaging tool used to acquire electronic evidence in a forensically sound manner by creating copies of computer data without making changes to the original evidence.
- With FTK Imager, you can create forensic images of local hard drives, CDs and DVDs, thumb drives or other USB devices.
- Mount an image for a read-only view that leverages Windows® File Explorer to see the content of the image exactly as the user saw it on the original drive.
- OSFMount - Mount Disk Images & Create RAM Drives
- The free OSFMount tool mounts raw disk image files in mulitple formats. You can also create RAM drives. Formats supported include img, dd, E01, VHD, ISO & bin
- Instructions
- Step 1 of 4: Just select your disk image, do not mount as ram disk
- Step 2 of 4: Mount entire image as virtual disk
- Step 3 of 4: Skipped by the software, ,ust be somethign to do with partitions
- Step 4 of 4:
- Read-only drive: Optional, but readonly keeps the original image clean
- Write mode: Write cache
- Drive emulation: Physical Disk Emulation = we need this for the boot sector
- Drive type: HDD
- NB:
- In Starwind, your virtual disk will be listed as real disk called
osfdisk
- If you mount as FDD (possible a super floppy mode) Starwind will not see the drive.
- In Starwind, your virtual disk will be listed as real disk called
- OSFMount - What is the difference between logical and physical drive emulation modes:
- In OSFMount, the difference between logical and physical drive emulation lies in how the mounted image is presented to the operating system:
- Logical Drive Emulation
- What it is: Mounts a partition within a disk image as a drive.
- Use case: When you're only interested in accessing a specific partition (e.g., a file system like NTFS or FAT32).
- Example: Mounting just the C: partition from a full disk image.
- Visible as: A standard drive letter in Windows (e.g., D:, E:).
- No boot sector or MBR is emulated—just the file system content.
- Faster and simpler for common use cases like extracting files.
- Physical Drive Emulation
- What it is: Mounts the entire image as if it were a real physical disk, including the MBR, partition table, and all partitions.
- Use case: When you need to work with the full disk structure (e.g., for forensic analysis or imaging software that requires MBR access).
- Visible as: A physical disk (not a drive letter), usually accessed via disk management tools or forensic software.
- Can emulate multiple partitions, raw sectors, boot records, etc.
- Slower and more resource-intensive, but gives low-level access.
- Logical Drive Emulation
- Forum
- OSFMount decides automatically whether to use physical or logical emulation based on the presence of a partition table in the image.
- OSFMount shall automatically mount using Physical Drive or Logical emulation based on whether the image file contains a partition table or not
- Another forum post clarifies the difference in practical terms:
- Logical emulation: mounts only the file system as a volume — you get a drive letter but no low-level disk access..
- Physical emulation: mounts the entire disk, including all sectors and partitions — useful for low-level forensic or VM boot tasks
- In OSFMount, the difference between logical and physical drive emulation lies in how the mounted image is presented to the operating system:
DAEMON Tools Lite: The most personal application for disc imaging yet - DAEMON-Tools.cc
- A well-known solution that allows you to mount, copy and create an image. It works with the most popular types of virtual discs. Download DT Lite to mount images without any limits!
- Simple VHD Manager is portable freeware which helps VHD users simplify some of these operations:
- You can attach and detach VHD/VHDX/ISO files via drag and drop
- You can permanently attach a virtual hard disk in Windows 11 – 10 – 8,1 – 8 and Windows 7
- You can easily add and/or remove VHD/VHDX/ISO files to the boot menu
- Mount and Unmount a VHD File in Windows Explorer via a Right-Click
- Virtualization has become an incredibly powerful and flexible way to deploy environments. So much in fact that Microsoft has integrated the ability to attach virtual hard drive (VHD) files as physical disks in the Windows Disk Management tool.
- This process is easy enough to do manually but if you attach VHD files often then we have a solution which enables you to mount and unmount VHD files with a single click.
- Thsi article has batch scripts you can attach to the context menu to allow easy use of the right click feature.
Best Practices
- Fixed vs Dynamic disks - Microsoft Q&A - Hi Can anyone point me to a link that shows the correct official guidance from Microsoft as to if fixed or dynamic VHD's or VHDX's should be used in a production enviroment? Thanks
Tutorials
- Create from Scratch
- Windows Disk Management
- How do I create a VHD drive from scratch to use with Rufus? - FAQ · pbatard/rufus Wiki · GitHub - Create a VHD/VHDX imageusing windows in-built Disk Management.
- Control Panel --> Administrative Tools --> Computer management --> Storage --> Disk Management (or however you get there)
- On newer versions of Windows you cannot click on the drives as shwon here. Look under the Actions menu and you will find:
- Create VHD
- Attach VHD
- How to create virtual drive (VHD, VHDX, Dev Drive) on Windows 11 - Pureinfotech - The Settings app on Windows 11 now allows you to create and attach virtual drives, and in this guide, you will learn how.
- Free and Powerful VHD Resizer Download - AOMEI Partition Assistant - This article focuses on VHD Resizer. First you’ll be told what VHD is and its features, and then an amazing VHD resizer will be recommended.
- How to create and set up new VHD or VHDX File in Windows 11/10 | TheWindowsClub - Today, we will see how to create and set up (initialized and formatted) a new VHD and VHDX virtual hard disk file in Windows 11/10 using Disk Management. But before we begin, we will see what is a VHD and VHDX.
- How do I create a VHD drive from scratch to use with Rufus? - FAQ · pbatard/rufus Wiki · GitHub - Create a VHD/VHDX imageusing windows in-built Disk Management.
- Windows Disk Management
- Export/Import Virtual Machines
- How To Convert Virtual Machines Between VirtualBox and VMware - Migrating to another virtual machine program can be intimidating. if you already have your virtual machines set up they way you like them, you don’t necessarily have to install them from scratch – you can migrate your existing virtual machines.
- Migrate Proxmox VMs to VMware with StarWind V2V Converter • Nolabnoparty - StarWind V2V Converter is a free tool used to convert VMs from one format to another bidirectionally and physical machines to VMs.
- Shrinking and Compacting
- How to Shrink and Compact VHDX Files in Hyper-V? | Vinchin Backup
- This article serves as a comprehensive tutorial on managing VHDX disk space in Microsoft Hyper-V environments.
- It differentiates between shrinking and compacting VHDX files, outlines the advantages of the VHDX format over the older VHD, and provides detailed steps to perform both shrink and compact operations using both Hyper-V Manager and PowerShell commands.
- How to Shrink and Compact Virtual Hard Disks in Hyper-V | TheWindowsClub - In this post, we will see how to shrink and compact hard disks in Hyper-V. This allows you to make room for the hard disks if they are too big for your physical computer. Since Hyper-V hard disks are usually dynamic in nature, it is crucial to shrink and compact virtual hard disks in Hyper-V.
- How to Shrink the Virtual Disk of a Linux Distro in WSL | by bonguides.com | Medium - When you delete files or free up space in your WSL distribution, the virtual disk doesn’t automatically shrink. To reclaim this unused space, you need to compact the virtual disk (VHDX) file.
- Diskpart
- Open PowerShell (Terminal) as administrator then type diskpart and press Enter
- Use the following command, replacing the path with the actual location of your VHDX file to select the VHDX file.
select vdisk file=""
- Once the disk is selected, run the below command within the DiskPart prompt to shirk the disk. This will reclaim the unused space in your VHD file. You should see a message indicating that the disk has been successfully compacted
compact vdisk
- After the process is complete, you can check the size of the VHD file to confirm that it has been reduced.
- Hyper-V
- Open PowerShell as administrator, then navigate to the location of the VHD file
- Run the following command to compact the VHD file:
Optimize-VHD -Path .ext4.vhdx full
- You can monitor the processing status on the screen. After completion, verify the virtual disk size to confirm functionality.
- WSLCOMPACT
- Install it using the below PowerShell commands:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser iwr -useb https://raw.githubusercontent.com/okibcn/wslcompact/main/setup | iex
- Run the wslcompact command to see the current size and estimated size of all WSL instances.
- Run the below command to compact the disk and apply the change to the VHD file.
wslcompact -c ubuntu
- If the tool is no longer needed, to remove the utility, close all your PowerShell instances, open a fresh one, and type:
Remove-Item "$($env:PSModulePath.split(';')[0])/WslCompact" -Recurse -Force
- Install it using the below PowerShell commands:
- Diskpart
- Shrink and Compact Virtual Hard Disks In Hyper-V (Guide) - If your Hyper-V environment starts running low on disk space, find out how to shrink and compact virtual hard disks in this step-by-step guide.
- How to Shrink and Compact Virtual Hard Disks in Hyper-V - TechDirectArchive
- Master the process of shrinking and compacting your Hyper-V virtual hard disks to save space and enhance virtual machine efficiency.
- Different method iusing: Hyper-V Manager, PowerShell, Resize-VHD
- WSL2 on Windows 11 - Virtual Disk vhdx is 200GB now | Reddit
- Release VHDX unused space:
Open Powershell and run the following: wsl --shutdown diskpart select vdisk file="path-to-your-virtual-disk\ext4.vhdx" attach vdisk readonly compact vdisk detach vdisk exit
- Release VHDX unused space:
- How to Compact/Shrink a WSL2 Virtual Disk – Stephen Rees-Carter
- You can use the diskpart tool to compact a VHDX. This allows you to shrink a WSL2 virtual disk file, reclaiming disk space. I went from 100GB to 15GB.
- How to Compact a WSL2 VHDX Virtual Disk | mycodde.blogspot.com - I was struggling to compact my WSL VHDX disk, it has hardly 10 GB data but it was showing 72 GB in size.
- How to Shrink and Compact VHDX Files in Hyper-V? | Vinchin Backup
- Resizing
- How to Resize a VHD File or VHDX | DiskInternals - Learn how to resize VHD or VHDX files easily in Hyper-V or without it! Follow step-by-step methods using Hyper-V Manager, PowerShell, or Diskpart.
- Resize-VHD (Hyper-V) | Microsoft Learn - Use this topic (Resizes a virtual hard disk) to help manage Windows and Windows Server technologies with Windows PowerShell.
- Starwind V2V Converter
- Starwind V2V Converter - Ultimate Free P2V & V2V Conversion tool - This article explains the detailed feaures about Starwind V2V Converter and how to perform V2V & P2V conversion using Starwind V2V Converter
- VMware vCenter Converter Standalone
- Convert Physical Linux Server to VMware - P2V Vmware - In this topic, we will see how to convert a physical Linux server to a VMware VM. To make this conversion, I used VMware vCenter Converter Standalone.
- QEMU
- QEMU also supports various other image file formats for compatibility with older QEMU versions or other hypervisors, including VMDK, VDI, VHD (vpc), VHDX, qcow1 and QED. For a full list of supported formats see qemu-img --help. For a more detailed description of these formats, see the QEMU block drivers reference documentation.
- Converting images with qemu-img convert · GitHub - Converting images with qemu-img convert.
- How to use the command qemu-img (with examples)
- qemu-img is a versatile command-line utility designed to create and manipulate virtual HDD images for Quick Emulator (QEMU).
- This tool is particularly useful for handling tasks such as creating new disk images, converting between different virtual disk formats, resizing existing disk images, and more.
- Use Qemu-img to Manage and Convert Different Virtual Disks | Vinchin Backup - This post describes what is qemu-img and how to use this qemu disk image utility to create, resize, and convert virtual disk for VM management and migration.
- Converting a Physical disk to a Virtual disk with Qemu’s qemu-img on Windows | Virtually Fun - Give you the commands to convert a physical drive into a virtual disk and also gives the full list of support image files in QEMU.
- VBoxManage
- Converting disks (vboxmanage clonemedium)
- Convert VMDK to VirtualBox VDI and compact disk - How to convert the vmdk to a VDI file and then compact it.
## Convert VBoxManage clonemedium disk --format VDI [drive]:[\path_to_file\sourceFile.vmdk] [drive]:[\path-to\destinationFile.vdi] ## Compact VBoxManage modifyhd --compact "[drive]:\[path_to_image_file]\[name_of_image_file].vdi"
- Convert VMDK to VirtualBox VDI and compact disk - How to convert the vmdk to a VDI file and then compact it.
- resize VDI image size
VBoxManage modifyhd "[drive]:\[path_to_image_file]\[name_of_image_file].vdi" --resize 81920
- RAW Disk handling
- vboxManage internalcommands createrawvmdk - Bing Search
- The
VBoxManage internalcommands createrawvmdk
command in VirtualBox allows you to create a virtual disk that maps to a physical disk or partition. This is useful for accessing a physical disk directly from a virtual machine. - Example
- To create a virtual disk that maps to an entire physical disk on a Windows host, use the following command:
VBoxManage internalcommands createrawvmdk -filename "C:\path\to\file.vmdk" -rawdisk \\.\PhysicalDrive0
- This command creates a
.vmdk
file that represents the physical diskPhysicalDrive0
- To create a virtual disk that maps to an entire physical disk on a Windows host, use the following command:
- Accessing Specific Partitions
- You can also map specific partitions of a physical disk. For example, to map partitions 1 and 5 of
/dev/sda
on a Linux host:VBoxManage internalcommands createrawvmdk -filename /path/to/file.vmdk -rawdisk /dev/sda -partitions 1,5
- This creates a
.vmdk
file that provides access to partitions 1 and 5 of/dev/sda
- You can also map specific partitions of a physical disk. For example, to map partitions 1 and 5 of
- Important Considerations
- Permissions: Ensure you have the necessary read/write permissions for the physical disk.
- Data Safety: Incorrect use can lead to data loss. Avoid accessing the same partition from both the host and guest simultaneously.
- Platform Differences: The device specification varies by platform (e.g.,
\\.\PhysicalDrive0
for Windows,/dev/sda
for Linux).
- Using
VBoxManage internalcommands createrawvmdk
, you can effectively utilize physical disks within your VirtualBox VMs, providing flexibility and direct access to hardware resources. - Learn more
- The
- Example Commands
vboxManage internalcommands createrawvmdk -filename "C:\Users\Public\Documents\VirtualBox\Raw Disk Images\spinrite.vmdk" -rawdisk "\\.\PhysicalDrive2" vboxManage internalcommands createrawvmdk -filename "C:\rawdisks\spinrite.vmdk" -rawdisk "\\.\PhysicalDrive2"
- Use physical harddisk in Virtual Box - Straight forward instructions - Super User - Today, I managed to boot from physical drives. This achievement required....
- vboxManage internalcommands createrawvmdk - Bing Search
- Converting disks (vboxmanage clonemedium)
- How to Read VHDX Metadata (e.g., virtual size, block size)
- PowerShell
- Run:
Get-VHD -Path "C:\path\to\your.vhdx"
- This returns
- VHD type (Fixed/Dynamic)
- Size
- Logical sector size
- Physical sector size
- This returns
- Note: Only works on Windows with Hyper-V features installed.
- Run:
- Use vhdxinfo from libvhdi (Linux/macOS/Windows)
- Install libvhdi tools:
- On Linux:
sudo apt install libvhdi-utils
- On macOS (via brew):
brew install libvhdi
- On Windows: Download libvhdi
- On Linux:
- Run:
vhdxinfo yourfile.vhdx
- This will show:
- Header info
- Log GUIDs
- Virtual disk size
- Block size
- Parent locator (if differencing disk)
- This will show:
- Install libvhdi tools:
- Parse the VHDX File Manually (Hex or Script)
- You can parse the structure using a hex editor or script:
- Look for the magic header at offset 0:
00000000 76 68 64 78 66 69 6c 65 # "vhdxfile"
- Read region table at
0x20000
, which lists metadata regions. - Use the region table to find:
- Virtual disk size
- Block size
- Logical/physical sector size
- GUIDs, versioning
- Look for the magic header at offset 0:
- You'd need to follow the Microsoft VHDX Specification to decode it fully.
- You can parse the structure using a hex editor or script:
- PowerShell
- TRIM'ing VHD(X) files
- Optimize-VHD (Hyper-V) | Microsoft Learn
- Optimizes the allocation of space used by virtual hard disk files, except for fixed virtual hard disks.
- Optimize-Volume (Storage) | Microsoft Learn
- Optimizes a volume.
- The Optimize-Volume cmdlet optimizes a volume, performing defragmentation, trim, slab consolidation, and storage tier processing. If no parameter is specified, then the default operation will be performed per the drive type as follows:
- HDD, Fixed VHD, Storage Space. -Analyze -Defrag.
- Tiered Storage Space. -TierOptimize.
- SSD with TRIM support. -Retrim.
- Storage Space (Thinly provisioned), SAN Virtual Disk (Thinly provisioned), Dynamic VHD, Differencing VHD. -Analyze -SlabConsolidate -Retrim.
- SSD without TRIM support, Removable FAT, Unknown. No operation.
- Multiple VHD/VHDx Optimization using PowerShell Workflows
- Optimize multiple VHD/VHDx files using PowerShell Workflows.
- After about 5 minutes of investigation I came up with this simple PowerShell command:
Get-VM | Where { $\_.State -eq 'Off' } | Get-VMHardDiskDrive | Optimize-VHD -Mode Full
- It basically performs a full optimization on all VHD/VHDx files attached to all Virtual Machines that are in the Off state on the host the command is run on. This does the job quite well but has a few annoyances:
- The optimization is performed in series.
- Running guests won’t be optimized.
- The command only works on VMs on the host the command is run on.
- Optimize-VHD (Hyper-V) | Microsoft Learn
Convert and Compact an Offline VHD/VHDX Fixed Disk Image to a Dynamic Disk Image
- TRIM is the process of the OS telling a SSD/NVMe drive to release the sector as it is no longer used, these drives do not actually zero fill the sectors to prevent uneeded writes, but in the future when the sector is read, the drive will supply back all Zeros.
- In a Fixed Disk Image, an unused sector is denoted by being all Zeros.
- In a Dynamic Disk Image, an empty unused sector is either all Zeros or is juts not referenced at all, in either case, all Zeros will be returned.
- If the Disk Image files is part of an online system, the OS it is running can perform TRIM on the drives and volumes to "Zero out" unused sectors.
Instructions
VHD and VHDX are interchangeable for these commands.
- Mount the Disk image
Mount-VHD -Path "D:\Path\To\Fixed-Disk.vhdx" -ReadOnly Or Mount through the GUI (Disk Management, Right Click)
-ReadOnly
: This should protect the volume being written to by the OS, but not this command. I am not 100% on this.
- Zero out free space (inside the VHDX) (TRIM)
- You need to fill the free space with zeros so the compacting process knows it’s unused.
- Use sdelete from Sysinternals:
sdelete64.exe -z X:
- Replace
X:
with the drive letter assigned to the mounted VHD. - -
z
: This flag instructs ‘sdelete’ to write zeros over the available free space, a less intensive option than multiple passes and suitable for non-critical data. - This is needed because when a full RAW image of a drive is done, all bits are stored into the image, irrespective of whether that sector is holding any data.
- Unmount the VHDX
-
Dismount-VHD -Path "D:\Path\To\Fixed-Disk.vhdx" Or Unmount through the GUI (Disk Management, Right Click)
-
- Convert the Fixed VHDX to Dynamic.
- Powershell
Convert-VHD -Path "D:\Path\To\Fixed-Disk.vhd" -DestinationPath "D:\Path\To\Dynamic-Disk.vhd" -VHDType Dynamic
- Use StarWind V2V / P2V Converter to convert the Fixed disk to a Dynamic disk
- This process actually generates a copy of the disk image.
- Powershell
- Compact the Dynamic VHDX.
- Using Powershell
Optimize-VHD -Path "D:\Path\To\Dynamic-Disk.vhdx" -Mode Full
- Using Diskpart
diskpart select vdisk file="D:\Path\To\Dynamic-Disk.vhdx" attach vdisk readonly compact vdisk detach vdisk exit
readonly
: This should protect the volume being written to by the OS, but not this command. I am not 100% on this.
- Using Powershell
- Done
Running Trim in a live OS
- Virtual Drive TRIM - VergeOS Docs - How to regain space on a virtual SSD
- After importing a virtual machine from another hypervisor, sometimes the free space available inside the virtual machine does not match the free space reported to the VergeOS platform.
- This discrepancy is often due to the virtual disk being thick-provisioned from the VM source, making VergeOS unaware of the unused disk space.
- To resolve this, a TRIM/UNMAP operation needs to be performed on the virtual disk from within the virtual machine.
- Trimming a Windows Drive
Optimize-Volume -DriveLetter YourDriveLetter -ReTrim -Verbose Optimize-Volume -DriveLetter E -ReTrim -Verbose
- Trimming a Linux Drive
## Check TRIM Timer/Schedule Status: sudo systemctl status fstrim.timer ## Check TRIM Service Status: sudo systemctl status fstrim If TRIM is enabled, an operation will run at the next scheduled time. If TRIM is not enabled, you can ## Run a manual TRIM using: sudo fstrim -av ## Info It is recommended to enable automatic TRIM to ensure that data usage is reflected accurately between VergeOS and the guest OS. ## To enable automatic TRIM, run: sudo systemctl enable fstrim.timer
Repairing Disk Images
- How to Repair Corrupted VHD File in Windows - Virtualization - Spiceworks Community - We all know that data is vulnerable in every form. This also allows to VHD(Virtual Hard Disk). When it comes to data loss, it becomes a critical situation for the users like us and it creates chaos inside us”. So in this handout, I’ll cover the VHD(Virtual Hard Disk) File, reasons for VHD Corruption and the way to repair or recover corrupt VHD.
- Corrupt VDI File: How to Fix and Recover Virtual Disk Data Effectively | DiskInternals - Troubleshoot a corrupt VDI file ? and recover lost data with expert methods. Use DiskInternals VDI Recovery™ for fast and reliable results. Safeguard your virtual machines today!
- Repair VHDX and Recover Corrupted/Unreadable VHD or VHDX Files in Windows 10 – EaseUS - This page provides the best VHD file recovery software and methods to help you effectively repair corrupted or unreadable VHD/VHDX and restore lost files in Windows 10 with simple clicks. Follow to see how to fix and repair your corrupted VHD disk partition without losing any data.
- 6 Methods to Fix VHD/VHDX file is Corrupted and Unreadable Error - VHD/VHDX file format which is similar to a hard drive is also prone to get corrupted and sometimes unreadable. The difference between VHDX and the physical hard drive is that VHDX is a virtual machine environment. The VHD/VHDX files getting corrupted or unreadable is a common problem and not easy to fix.
- Repair-VHD PowerShell: Step-by-Step Guide (3 Essential Steps to Fix VHD) | DiskInternals - Learn to repair VHD files using PowerShell ?️ with our comprehensive guide. Follow these steps to restore your virtual disks effectively!
- How to Repair VHD File: A Complete Guide to Recover Corrupted Virtual Disk Files - Virtual Disk Recovery Blogs - VHD Files are often prone to corruption which led to serious damage of your files and folders. So here read about how to repair vhd file manually.
- Free Methods to Repair Corrupted and Unreadable VHD Files (Aryson) - Free methods to repair corrupted and unreadable VHD files. Restore your virtual machines and recover data with our easy-to-follow guide.
Partition Types
- Partition type - Wikipedia
- Partition types: List of partition identifiers for PCs - Below a list of the known partition IDs (system indicators) of the various operating systems, file systems, boot managers, etc.
Makes your USB drive appear as a Hard drive and not removable Media
Is htis best ehre or antoher article
TL;DR = Might not be possible any more, and if it is, it is not worth the hassle.
- Flip the Removable Media bit (RMB) on the drive itself
- The Lexar BootIt utility was designed to "flip the removable media bit" on certain USB flash drives, making them appear as fixed (hard) disks to Windows. This was a niche utility and often highly specific to particular flash drive controllers. It's largely outdated and generally not recommended due to potential instability and the possibility of bricking your USB drive.
The "removable media bit" is often a hardware-level setting within the USB drive's controller firmware. So, if a utility like Lexar BootIt doesn't work for your specific drive, there's often no generic software alternative that can reliably change this "bit." - Flip Your Bit USB Utility To Make Local Drive | getusb.info
- BootIt is a Lexar based utility to flip the Removable Media Bit setting of a USB drive. What this means, is you can take a Lexar drive (and many other brands) and make it appear as a Local Drive on your PC rather than Removable Storage.
- Removable USB Flash Drive as Local HDD in Windows | Windows OS Hub
- In this article we’ll show you how to make a USB flash drive or an SD card to be identified in the Windows as a common local hard disk.
- Probably, you may ask why it’s necessary? The matter is that by default Windows identifies all the USB flash drives and SD cards as removable drives that can’t be split into several partitions with the built-in Windows tools.
- And even if you partition the USB flash drive into two or more volumes using third-party utilities (say, in Linux), only the first partition will be available in Windows. Windows supports multiple partitions only for hard disk drives identified as local (i.e. non-removable).
- Windows recognizes USB flash drives as removable devices due to the presence of a special descriptor bit RMB (removable media bit) on each of the devices. If the system determines that RMB=1 when polling the connected device using StorageDeviceProperty function, it concludes that this device is a removable drive. Thus, in order to convert the USB-flash to the hard disk it is enough to modify this descriptor.
- Software covered
- Lexar BootIt
- Hitachi filter driver
- How to make a disk drive "removable" - Windows 10 Forums - No meta description
- The Lexar BootIt utility was designed to "flip the removable media bit" on certain USB flash drives, making them appear as fixed (hard) disks to Windows. This was a niche utility and often highly specific to particular flash drive controllers. It's largely outdated and generally not recommended due to potential instability and the possibility of bricking your USB drive.
- Windows Registry
- The mode cannot be changed in the Windows registry.