Saturday, May 7, 2016

vhdutil - attaching/detaching VHD files using the command line

I just published a small tool to my Github account. While developing ttOS, I have been struggling to find a virtual hard disk format that:

  1. Is compatible with most x86 virtual machines
  2. Can be written to a device (USB stick, cloned to a real HDD, etc.)
  3. Is mountable in Windows, so I can include it in my build process
Turns out the best fit is the "Virtual Hard Disk" format. In Windows, it's possible to mount VHD files using the management console. But I don't want to go through all the hassle to mount it with a few mouse clicks, build the kernel, unmount it with more mouse clicks, before I can actually test it.

So I made vhdutil, which is available here: https://github.com/dnifan/vhdutil

After building, you can simply use these commands:

vhdutil.exe attach <file> to mount a VHD file.
vhdutil.exe detach <file> to unmount a VHD file.

It's licensed under the MIT license, so go right ahead and do whatever you want.

No comments:

Post a Comment