How to mount a VHD hard disk in a local system (with a shortcut command)

Source: Internet
Author: User

There is a significant difference between Virtual PC and Virtual Server 2005 R2 with SP1 in terms of operation management. After the VMAdditions plug-in is installed on Virtual PC, you can directly drag and drop the host file to the guest system, or use the built-in sharing Function of the plug-in to make it easy for the guest system to obtain files on the host system, this provides great convenience during our tests or experiments. However, this function is not provided in Virtual Server, and files can only be obtained through network sharing in the conventional way, however, when the test environment is in the local only environment, the network sharing mode is not available. In this case, it is very troublesome for the guest system to exchange files with the host! I don't know if you can understand it, so I will give you a popular case to make it clearer or more important. If I want to perform an Active Directory experiment in the local only environment, the guest system uses Windows Server 2003 with SP1. Now we need to install Windows Server 2003 SP2 for the guest system, what should we do now? Switch the network to the bridge mode, and reconfigure TCP/IP to obtain the patch package that has been downloaded from the host? Or switch the network to the NAT mode and download it directly from the Internet? In fact, we really ignore vhdmount, a tool that comes with Virtual Server 2005 R2 with SP1. Yes, it is as easy to understand as its name. It is a small tool used to load Virtual Disk Files, it is very simple and practical to use. Let's get to know and learn how to use this tool.

Vhdmount is a utility that is included in Virtual Server 2005 R2 with SP1 to load Virtual Disk Files (. vhd) as Virtual disk devices mounted on the host operating system. In addition to using this function manually in the command line environment, we can also call this function through APIS. Here we mainly introduce how to use this tool in the command line environment. In addition, you must be reminded that the command can be used only as an administrator on the Vista system.

We can find the vhdmount subdirectory under the installation directory of Virtual Server 2005 R2 with SP1. The vhdmount tool is stored here. To manually use this command, you must first enter the CMD environment and then enter the vhdmount directory for execution. To reduce the inconvenience caused by path switching, we can add the vhdmount path in the path section of environment variable configuration in advance. This makes it easier to use!

The command syntax of vhdmount is:

Copy to ClipboardReference content: [www.bkjia.com] vhdmount {/p <VHDFileName> |/m <VHDFileName> [<DriveLetter>] |/f/u {<VHDFileName> [/c |/d] | All} |/q {<VHDFileName> | All }}

Parameter description:

/P
Insert the specified. vhd file as the virtual disk device, but do not load the volume.

/M
Insert the specified. vhd file as the virtual disk device and load the volume. DriveLetter is optional. If a drive letter is specified, the volume is loaded from the specified drive letter. If no drive letter is specified, it is automatically allocated.

Note: The/m option uses the Windows Virtual Disk Service (VDS) API to load the volume to the Disk. Only Windows Server 2003, Windows Server "Longhorn", and Windows Vista provide VDS APIs. This means that when the host operating system is Windows XP, volumes cannot be loaded using the/m option. However, you can use the Disk Manager to manually load volumes in Windows XP.

/U
Unplug the virtual disk device corresponding to the specified VHDFileName or all attached virtual disk devices. VHDFileName is the fully qualified path of the. vhd file.

/Q
Returns the disk identifier of the virtual disk device or all attached virtual disk devices corresponding to the specified VHDFileName. VHDFileName is the fully qualified path of the. vhd file.

/F
Attach a virtual hard disk without restoring the disk. All changes are made on the original virtual disk. By default, VHD is loaded by creating a temporary restoration disk and changing the disk.

/C
Before detaching a disk, use all changes saved in the restored disk file to update the original. vhd file and delete the restored disk file.

/D
Before detaching a disk, discard all changes made to the mounted disk and delete the restored disk file.

Note: The/c and/d options are applicable only when/f is not used to load. vhd files.

Right-click to add the command for loading and uninstalling Virtual Machine file VHD:

Copy to ClipboardReference content: [www.bkjia.com] Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ Virtual. Machine. HD]

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ Virtual. Machine. HD \ shell]
@ = "Mount"

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ Virtual. Machine. HD \ shell \ Dismount]

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ Virtual. Machine. HD \ shell \ Dismount \ command]
@ = "\" C :\\ Program Files \ Microsoft Virtual Server \ Vhdmount \ vhdmount.exe \ "/u \" % 1 \""

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ Virtual. Machine. HD \ shell \ Mount]

[HKEY_LOCAL_MACHINE \ SOFTWARE \ Classes \ Virtual. Machine. HD \ shell \ Mount \ command]
@ = "\" C :\\ Program Files \ Microsoft Virtual Server \ Vhdmount \ vhdmount.exe \ "/p \" % 1 \""

[HKEY_CLASSES_ROOT \. vhd]
@ = "Virtual. Machine. HD"

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.