Author Topic: Create and Use a Virtual Hard Disk on Windows 7  (Read 3442 times)

0 Members and 1 Guest are viewing this topic.

Create and Use a Virtual Hard Disk on Windows 7
« on: June 11, 2010, 07:03:17 PM »

Offline Nick

  • Administrator
  • Platinum Member
  • *
  • Posts: 46028
  • Karma: +1000/-0
  • Gender: Male
  • NickCS
    • http://www.facebook.com/nickcomputerservices
    • http://www.twitter.com/nickcomputer
    • Computer Chiangmai

Create and Use a Virtual Hard Disk on Windows 7

In Windows 7, you can mount Virtual Hard Disks (VHDs) exactly like physical disks. Find out how to create and mount VHDs in Windows 7.

Virtual hard disks (VHDs) are a file type that acts like a hard disk. In previous versions of Windows, VHDs were used by virtual machines, such as those created by Microsoft Virtual Server 2005 or Microsoft Virtual PC. Additionally, Complete PC Backup in Windows Vista created a copy of the computer’s hard disk as a VHD disk image.


Follow Our Daily Tips
RSS | Twitter | Blog | Facebook


Tell Us Your Tips
Share your tips and tweaks.Beginning with Windows 7, you can now mount VHDs exactly like a physical disk. By mounting a VHD, you can easily copy files to and from the virtual disk. Additionally, Windows 7 can be configured to boot from a VHD.

You can create a VHD from either the Disk Management snap-in or the command line. After you create the VHD, you must attach it and then format it before you can use it, just like a physical partition.

From the Disk Management console, follow these steps:
1. Right-click Disk Management and then click Create VHD. Follow the prompts that appear.
2. Right-click the new disk and then click Initialize Disk. Click OK.
3. Right-click the new disk and then click New Simple Volume (or select a different volume type, if available). Follow the prompts that appear.

The new virtual disk is ready to be used, just like any other disk.

From the DiskPart command-line tool at an elevated command prompt, run the create vdisk command and specify the file (to name the file) and maximum (to set the maximum size in megabytes) parameters. The following code demonstrates how to create a VHD file at C:\vdisks\disk1.vdh with a maximum file size of 16 GB (or 16,000 MB).


Code: [Select]
DiskPart
Microsoft DiskPart version 6.1.7100
Copyright (C) 1999-2008 Microsoft Corporation.
On computer: WIN7
DISKPART> create vdisk file="C:\vdisks\disk1.vhd" maximum=16000

Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 F New Volume NTFS Simple 20 GB Healthy
Volume 1 E New Volume NTFS Simple 40 GB Healthy
Volume 2 R DVD-ROM 0 B No Media
Volume 3 C NTFS Partition 75 GB Healthy System
Volume 4 D New Volume NTFS Partition 52 GB Healthy
DISKPART> select volume 0
 
Volume 0 is the selected volume.
DISKPART> delete volume

DiskPart successfully deleted the volume.

For additional options, run the command help create vdisk at the DiskPart command prompt. After you create a VHD, you must attach it, create a partition, assign it a drive letter, and format it before it can be used. The following script (which must be run within a DiskPart session) demonstrates how to do this.

Code: [Select]
create vdisk file="C:\vdisks\disk1.vhd" maximum=16000
attach vdisk
create partition primary
assign letter=g
format

From the Microsoft Press book Windows 7 Resource Kit by Mitch Tulloch, Tony Northrup, Jerry Honeycutt, Ed Wilson, and the Windows 7 team.

credit: technet.microsoft.com


 
Share this topic...
In a forum
(BBCode)
In a site/blog
(HTML)


Related Topics

  Subject / Started by Replies Last post
0 Replies
12207 Views
Last post March 08, 2009, 01:03:45 PM
by IT
0 Replies
27313 Views
Last post April 27, 2009, 03:36:17 PM
by IT
0 Replies
4521 Views
Last post June 11, 2010, 04:44:53 PM
by Nick
0 Replies
3913 Views
Last post June 11, 2010, 07:07:10 PM
by Nick
0 Replies
4483 Views
Last post June 11, 2010, 07:08:51 PM
by Nick
0 Replies
2969 Views
Last post June 16, 2010, 02:10:54 PM
by Nick
0 Replies
2502 Views
Last post July 02, 2010, 05:19:25 PM
by Nick
0 Replies
3515 Views
Last post September 17, 2010, 04:46:29 PM
by Nick
0 Replies
3156 Views
Last post December 02, 2010, 02:03:00 AM
by Nick
0 Replies
1195 Views
Last post November 10, 2016, 12:12:16 PM
by Nick