Friday, January 11, 2008

Mounting VHD's via Managed Code

Virtual PC Guy's WebLog - Mounting VHDs from Managed Code

"When Virtual Server 2005 R2 SP1 was released it included the VHDMount tool - that came with a DLL to allow you to control it programmatically.  Unfortunately we were rather light with the documentation / sample code for this.  So today I would like to show you how to drive VHD mounting from managed code.

To do this I will be creating a small application called 'VHDMounter'.  It will have a simple user interface like this:

vhdmounter

To help with tracking things in the code I have named the TextBox "VHDTextBox" and the buttons "MountButton" and "UnmountButton" respectively.  Once the basic user interface is built here is the code that you need to drive the application:

..."

The referenced VHDMount.DLL is also available if you just install VHDMount (say on Vista like I did here, Tell me a VHDMount Story (Installing just VHDMount on Windows Vista and then mounting a VHD as a drive letter...))

This post has really got me thinking about how I could use this (automated, code managed VHD mounting)...

Think application data store or kind of virtual app repository thing. A shared resource that could be automatically copied down to a workstation, mounted and accessed like any drive resource, but all done in code. With care, applications could be run from it, and better than mounting an ISO, they could write back to it. Think thumbdrive like thing, but instead of being on a stick it's on a network share...

Hum...

 

Related Past Post XRef:
Tell me a VHDMount Story (Installing just VHDMount on Windows Vista and then mounting a VHD as a drive letter...)

No comments: