tinyapps.org / docs / Windows P2V: Hot/Cold Imaging, Troubleshooting, & Activation

This guide covers VirtualBox 7 hosts, though much of the material is platform agnostic.

1. Virtualize an offline system/bare drive

1.1 VBoxManage convertfromraw

Generally located in "C:\Program Files\Oracle\VirtualBox\", /usr/local/bin/, or /usr/bin/.

  1. Create VDI directly from offline hard drive:

    # vboxmanage convertfromraw /dev/sdx foo.vdi --format VDI

    or image the drive first, e.g.,

    # dd if=/dev/sdx of=foo.dd bs=1M status=progress

    then convert to VDI:

    # vboxmanage convertfromraw foo.dd foo.vdi --format VDI

  2. Change ownership of foo.vdi:

    # chown user foo.vdi

  3. Create a new virtual machine in VirtualBox, selecting foo.vdi as the virtual hard disk.

1.2 StarWind V2V Converter

Copies "[o]nly disk areas that contain useful data...while unused areas of the disk are not copied". Generated an ~30% smaller file than VBoxManage, qemu-img, and WinImage in testing.

  1. Select "P2V" → Next

  2. Select "Physical Disk" → Next

  3. Click the drop down menu under "Select disk" and select desired disk

  4. Select desired volumes → Next

  5. Select "Local file" → Next

  6. Select "VMDK"1 → Next

  7. Select "VMWare Workstation growable image" → Next

  8. Enter desired file name and path (e.g., C:\Users\user\foo.vmdk) then click "Convert"

  9. Create a new virtual machine in VirtualBox, selecting foo.vmdk as the virtual hard disk.

1.3 CloneVDI v4.01

Covered back in 2012, this Green Award winner reads VDI, VHD(X), VMDK, Parallels HDD, RAW, and physical drives, and writes to VDI (among many other features including compacting, repairing, enlarging, and diagnosing virtual disks). Like StarWind V2V, the resultant VDI file was ~30% smaller than those created by VBoxManage, qemu-img, and WinImage.

  1. Select source (symlinks are supported; see §2.4) and destination, check "Compact drive while copying", then click "Proceed":

  2. Create a new virtual machine in VirtualBox, selecting foo.vdi as the virtual hard disk.

1.4 Alternatives

2. Virtualize a hot/live/running system

For live systems, native or lighweight/portable apps are essential; "Primum non nocere".

2.1 Disk2vhd v2.02

Tiny portable app from Sysinternals

  1. Extract and run on a live Windows system2, selecting desired volume(s)3 and destination, unchecking "Use Vhdx"4, and checking "Use Volume Shadow Copy":

  2. Create a new virtual machine in VirtualBox, selecting foo.vhd as the virtual hard disk.

2.2 Windows System Image

Tested under Windows 10 22H2.

  1. In Disk Management (diskmgmt.msc), create a VHD file (e.g., E:\foo.vhd) large enough to accomodate the system image, then intitialize, create new simple volume, assign drive letter (e.g., V:), and format as NTFS (the required file system for System Image disk destinations); it should mount automatically, but if not, mount manually via Action → Attach VHD.

  2. Control Panel → System & Security → Backup and Restore (Windows 7) → Create a system image5

  3. Select "On a hard disk" → choose V: as the destination from the drop down menu → Next → Next → Start backup

  4. When the backup is complete6, eject V:.

  5. Create a new VM in VirtualBox with a blank drive ≥ the original drive7. Attach foo.vhd and a Windows, WinPE, or system repair disc ISO image in the VM's settings before booting.

  6. Boot VM from ISO image → set language and other preferences → Next → Repair your computer → Troubleshoot → System Image Recovery → "Use the latest available system image(recommended)" → Next → Next → Finish → Yes

2.3 Drive Snapshot 1.50

  1. Prepare a VHD file as in §2.2, step 1

  2. Back up the live system via Drive Snapshot to V:, copying snapshot.exe (or snapshot64.exe for 64-bit recovery environments) there as well.

  3. Eject V: when backup is complete.

  4. Create a new VM as in §2.2, step 5

  5. Boot VM from ISO image 8

  6. Launch snapshot.exe (or snapshot64.exe) → Restore complete Disk from Images → Browse → double click one of the SNA files created in step 2 → select the blank virtual disk to restore to (e.g., HD1) → Next → Yes:
    Drive Snapshot

2.4 CloneVDI v4.01

2.5 Alternatives

3. Troubleshooting post-conversion issues (BSODs, black screens, etc.)

3.1 Black screen

3.2 0x0000007B BSOD

Typically due to incompatible storage controller settings

  1. Boot from Windows ISO

  2. Launch regedit via command prompt10

  3. Select HKEY_LOCAL_MACHINE → File → Load Hive... → navigate to \Windows\System32\config\system in your VM's C: drive → Open → enter a Key Name (e.g., "foo") → OK

  4. Navigate to HKEY_LOCAL_MACHINE\foo\ControlSet001\services\ and change the Start value data11 along these lines (may vary slightly based on hardware):

  5. Select HKEY_LOCAL_MACHINE\foo\ → File → Unload Hive... → Yes → restart

3.2.1 More 0x0000007B tips

3.3 0xc0000225 BSOD

3.4 0xc0000260 BSOD

3.5 0XC0000017 BSOD

3.6 Green and orange checkered squares

3.7 VirtualBox Guest Additions won't install or run

"This device cannot find enough free resources that it can use. (Code 12)"

3.8 VirtualBox: "Cannot register the hard disk"

3.9 VirtualBox miscellanea

4. Activation

In fieri

5. Footnotes

  1. What disk image should I use with VirtualBox, VDI, VMDK, VHD or HDD? 

  2. The current version, 2.02, is said to run "on Windows Vista, Windows Server 2008, and higher, including x64 systems", but under Vista returned "Error: This version of Disk2VHD Requires Windows 7 or higher to function.: The specified program requires a newer version of Windows." Version 2.01 ran successfully under Vista and XP. 

  3. For GPT-partitioned disks, be sure to include the EFI System Partition (ESP) volume, which is required to boot Windows. 

  4. VirtualBox 4-7 offer read supoprt for VHDX but not write support

  5. Can also be performed on the command line via wbadmin

  6. You will also be prompted to create a system repair disc when the backup is complete. A physical or virtual CD/DVD burner is required, as writing directly to ISO is not supported. 

  7. Failure to do so results in "The system image restore failed. Error details: The computer needs to be restarted to finish preparing a hard disk for restore. To continue, restart your computer and run the restore again. (0x80042403)" 

  8. A floppy image can be used instead (though the CLI may be less intuitive): "Using the windows commandline, expand networkbootdiskette.sna with the (undocumented) command c:\programs\snapshot> snapshot networkbootdiskette.sna bootdisk.img -X

  9. A list of physical disk symlinks can be obtained via wmic diskdrive list brief

  10. Vista: Shift+F10 only works after clicking Next → "Install now". XP: Shift+F10 is unavailable; even reg.exe is unsupported in Recovery Console - BartPE, sysinternals boot disc, etc. 

  11. Possible values are: 0 (Boot), 1 (System), 2 (Auto load), 3 (Load on demand), 4 (Disabled), and 5 (Delayed start). See Table 1. Values for the Start Registry Entry (source appears to be "Table 28-3: Values for a <servicename> Start Entry" on page 1252 of Microsoft Windows XP Professional Resource Kit Documentation) for more information. 

  12. There is another, similar tool with the same name. 

created: 2023.05.23