Tips

Diagnosing VHD Mount Errors

Here's how to troubleshoot VHD Mount failures.

VHD Mount, described in my article "Virtual Server 2005 R2 SP1 Treasures: VHD Mount,"is a tool that allows you to locally mount Virtual Server or Virtual PC .vhd virtual hard disk files on a Windows Server 2003 system. While VHD Mount is a great tool, what can you do if it fails to successfully mount a virtual hard disk? Ben Armstrong recently unlocked the door to this mystery in his blog.

If you run VHD Mount with the wrong syntax and the command fails to execute, the command will return help information for the command's syntax.

If you are using the correct syntax -- such as vhdmount /m /f D:\XPVM\XP.vhd V -- and the command fails to mount the virtual hard disk, it will generate a relatively straightforward error message. For example, if you might be mounting a corrupt VHD file and you get the error message "The specified file is not a valid VHD."

To get more granular detail on the VHD Mount process, you can enable VHD Mount tracing. To do this, you just need to create a VHD_Mount_Trace environment variable and set it to 1 by running the following command:

set vhd_mount_trace=1

Once you've enabled VHD Mount tracing, you should then rerun the VHD Mount command that failed to mount a VHD file and view the verbose command output. Here is the resultant output from a failed vhdmount command:

C:\Program Files\Microsoft Virtual Server\Vhdmount>vhdmount /m /f c:\test1.vhd x

[Info] Default user locale is 0x409

[Error] PathFileExists failed with error code = 0x2

The specified Virtual Hard Disk could not be found.

[Error] VHDMount failed with return code = 3

While the above is a simple example, it represents VHD Mount tracing in action. I've found VHD hard disks to be extremely reliable and have had little trouble with VHD Mount as well. However, it's good to reserve a spot in your brain's hard disk for VHD Mount tracing. You never know when you'll need it.

Thanks again to Ben Armstrong for bringing attention to this handy variable.

About the Author

Chris Wolf is a Microsoft MVP for Windows --Virtual Machine and is a MCSE, MCT, and CCNA. He's a Senior Analyst for Burton Group who specializes in the areas of virtualization solutions, high availability, storage and enterprise management. Chris is the author of Virtualization: From the Desktop to the Enterprise (Apress), Troubleshooting Microsoft Technologies (Addison Wesley), and a contributor to the Windows Server 2003 Deployment Kit (Microsoft Press).learningstore-20/">Troubleshooting Microsoft Technologies (Addison Wesley) and a contributor to the Windows Server 2003 Deployment Kit (Microsoft Press).

comments powered by Disqus
Most   Popular

Upcoming Training Events