You can use qemu-nbd
in Linux to access a disk image as if it were a block device.
Here are some examples of operations that can be performed from a live Knoppix terminal.
su
modprobe nbd
qemu-nbd --read-only --connect=/dev/nbd0 --format=vpc <vhd_file_name>
If VHDX format:
qemu-nbd --connect=/dev/nbd0 --format=VHDX <vhdx_file_name>
ddrescue --verbose --force /dev/nbd0 /dev/sda # write image to /dev/sda
Write one partition:
qemu-nbd --partition=2 --read-only --connect=/dev/nbd2 --format=vpc <vhd_file_name>
ddrescue --verbose --force /dev/nbd2 /dev/sda2 # write partition 2 of image to /dev/sda2
Mount partition:
qemu-nbd --partition=2 --read-only --connect=/dev/nbd2 --format=vpc <vhd_file_name>
mount /dev/nbd2 /mnt
Unmount and disconnect image file:
unmount /mnt
qemu-nbd --disconnect /dev/nbd2