Skip to main content

Converting Disk Images into Bootable VMs

Prerequisites​

Before starting, ensure you have the following:

  • Raw Disk Image: The source file you want to convert (e.g., system.img).
  • VMware Workstation: Installed on your MIP.
  • qemu-img Utility: This tool is part of the QEMU virtualization package.

Procedure​

The process involves two main stages: converting the image file format and then creating a new VMware VM that uses the converted file.

Step 1: Convert the Raw Image to VMDK​

This step is identical regardless of the virtualization software.

  1. Open your command-line interface (Command Prompt or PowerShell as Administrator on Windows, or Terminal on Linux/macOS).

  2. Execute the qemu-img conversion command. The basic syntax is: qemu-img convert -f raw -O vmdk <source_image_file> <destination_vmdk_file>

    • -f raw: Specifies the format of the input file is raw.
    • -O vmdk: Specifies the desired output format is VMDK, compatible with VMware.

    Example:

    qemu-img convert -f raw -O vmdk "C:\Images\system.img" "C:\VMs\my-vm\converted_disk.vmdk"

    This reads system.img and creates converted_disk.vmdk inside a dedicated folder for your new VM. The conversion time depends on the image size.

Step 2: Create and Configure the VMware Virtual Machine​

  1. Launch VMware Workstation
  2. From the menu, select File > New Virtual Machine.... The "New Virtual Machine Wizard" will open.
  3. Select Custom (advanced) and click Next.
  4. Hardware Compatibility: Leave the default (Workstation 16.x) and click Next.
  5. Guest Operating System Installation: Select I will install the operating system later. This is critical. Click Next.
  6. Select a Guest Operating System: Choose the operating system and version that matches your source image (e.g., Microsoft Windows and Windows 10 x64). Click Next.
  7. Name the Virtual Machine: Provide a name and choose a location (ideally the same folder where you saved your .vmdk). Click Next.
  8. Firmware Type: Select BIOS or UEFI. This must match the source system the image was taken from. If you're unsure, start with BIOS. Click Next.
  9. Processors and Memory: Allocate CPU cores and RAM for your VM. Click Next.
  10. Network Type: Choose a network type (e.g., Use network address translation (NAT)). Click Next.
  11. Select I/O Controller Types: Leave the recommended default (e.g., LSI Logic SAS). Click Next.
  12. Select a Disk Type: Leave the recommended default that matches the controller (e.g., SCSI). Click Next.
  13. Select a Disk: This is the most important step. Select Use an existing virtual disk. Click Next.
  14. Select an Existing Disk: Click Browse... and navigate to the .vmdk file you created in Step 1. Click Next.
  15. A dialog may ask if you want to convert the disk to a newer format. It is generally safe and recommended to click Convert.
  16. Ready to Create Virtual Machine: Review the summary and click Finish.

Step 3: Final Configuration and Booting​

  1. The new VM will appear in your VMware library. Before starting it, you can click Edit virtual machine settings to double-check the configuration.
  2. Power on the virtual machine by clicking the green "Power on" arrow. It should now attempt to boot from the converted disk.

Troubleshooting Common Issues​

  • "Operating System not found" or "No bootable device was detected" error:

    • The Firmware Type does not match the source image. Power off the VM, go to Edit virtual machine settings > Options > Advanced, and switch from BIOS to UEFI (or vice-versa).
    • The original image may not have contained a bootable operating system.
    • The bootloader may need repair. You can do this by attaching an installer ISO (VM > Settings > CD/DVD) and booting into its recovery environment.
  • Windows VM shows a Blue Screen of Death (BSOD) on boot (e.g., INACCESSIBLE_BOOT_DEVICE):

    • This is almost always a storage driver issue. The virtual hardware's disk controller (e.g., LSI Logic SAS) is different from the physical hardware the image was made from.
    • Solution 1: Power off the VM. Go to Edit virtual machine settings > Hardware. Remove the existing Hard Disk (choose "Remove," not "Delete from disk"). Then click Add... > Hard Disk, select the recommended controller type (SCSI or SATA), and then Use an existing disk, pointing to your VMDK again. Try a different controller, like SATA, which is more common.
    • Solution 2: Boot into a Windows Recovery Environment from an ISO and use command-line tools (like DISM) to inject the correct VMware storage drivers into the offline OS.