vhdTools

So I’ve just started a new project called vhdTools to manipulate Virtual Hard Disk files used by Microsoft’s Virtual PC. Microsoft opened up the VHD specs as a part of its Open Specification Promise on the 17th. Microsoft also recently released Virtual Server 2005 R2 SP1 Beta2 which includes vhdmount, a driver for mounting VHD files to a drive letter for use like a normal hard drive (you can elect to only install vhdmount if you like if you don’t actually want the VM). A very useful trick to use along with this is adding mount and unmount actions to the context menu of VHD files which I found over at VirtualPC Guy’s site.

Why would you want to do something like this you may ask? Personally I like to partition certain things in nice little packages so I can easily transport them around and so they take up less disk space. A good example of this is sourcecode and development in general. When programming you inevitably end up with a bunch of small sourcefiles and object files when you compile them. Now with the ever increasing size of Hard Drives today the size of these files is often less than the allocation unit size of the filesystem, wasting a lot of valuable space. Creating a VHD for coding makes sense because you can make it any size which usually results in a smaller allocation unit, thus wasting less space. You’re also gaining the added benefit that compiling and recompiling doesn’t fragment your main disk but only the VHD which doesn’t impact the performance of the rest of your system.

I’ve got a simple VHD parser and a simple fixed-size VHD creation utility working now and am working on expanding the functionality a bit before I make a public release. I’m trying to figure out if I want to host it here or start a SourceForge project for it. Any thoughts?

Note: if you use vhdmount and are having trouble with it not working try opening up Device Manager and right clicking on “Microsoft Virtual Server Storage DeviceXX”, click ‘Update Driver’ then click ‘Install from a list or specific location (Advanced)’ then select ‘Don’t search. i will choose the driver to install.’ and hit next. Now click ‘Have Disk’ and browse to ‘C:\Program Files\Microsoft Virtual Server\Vhdmount’ and hit Ok, the compatible hardware list should read “Microsoft Virtual Server Storage Devices”, select it and hit Next – it should copy the driver and then say it has finished installing the software – you should now press Finish and the drive should work.

This entry was posted on Sunday, October 29th, 2006 at 7:07 pm PST and is filed under Coding. Find similar posts by selecting any of the following tags: . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

1 Comment so far

  1. Hi,

    You wouldn’t happen to be working on something that can convert VHD files to some other format, too, would you? Or perhaps dump a VHD as a raw image, maybe then I could use the qemu-image tool to load a raw image and convert to a vmdk? I am having a hell of a time moving from VirtualPC to other virtualisation solutions – I want to try out VMware, VirtualBox and so on, but I can’t convert my existing VHD disks.

    Since the most important test is whether my compiler box (Gentoo 2007.0 with >1000 hours of work on it) works well, or better, in those environments, I do not want to simply “make a fresh install”. I really don’t have 2 or 3 months to investigate my options on this :)

Have your say

Fields in bold are required. Email addresses are never published or distributed.

Some HTML code is allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
URIs must be fully qualified (eg: http://www.domainname.com) and all tags must be properly closed.

Line breaks and paragraphs are automatically converted.

Please keep comments relevant. Off-topic, offensive or inappropriate comments may be edited or removed.