3

If it's possible to convert a linux Hyper-V guest VM to an *.iso file, then I can create boot able usb from this image file. By google I found following tools:

  1. vhd2iso
  2. qemu-img
  3. convert-vhd

Can someone share his experienced in this topic. How to convert hvdx->iso or hvdx->hvd->iso?

Murmulodi
  • 163

1 Answers1

2

I might do this instead to avoid any bug/flaw in any of the conversion tool:

  1. Create an attach another VHDX to the VM
  2. Attach a live iso to the VM and boot that instead of the installation
  3. Partition and format the virtual disk attached in step 1 as NTFS or exFAT and mount the filesystem
  4. Use dd or even just cat to dump a raw image of the virtual disk where the installation resides to the filesystem mounted in step 3; you might even optionally use tee additionally to perform a checksum (e.g., sha1sum on-the-fly
  5. Unmount and shutdown; detach the VHDX that contains the image from the VM and attach it to the host; optionally perform a checksum (with 7-zip or whatever) and compare with the one you got in step 4

Then you can use whatever writer tool you like on Windows to write the raw image to a USB flash drive.

If you have set up SMB share or so on the host, you can probably dump it directly over the virtual network to a volume on your host instead.

It might even be possible to attach the VHDX of the installation (in read-only mode) to the host and perform a direct drive-to-drive clone. I'm not familiar with tools on Windows though so I don't know if there's one can do that.

Note that ISO as in ISO9660 has nothing to do with any of the above or your story / case.

Tom Yan
  • 10,996