As you all know Microsoft released the Windows 7 BETA build 7000 for testing. Many of you must be excited about the much more enhanced version of the operating system.
Windows 7 is much more faster that the Windows Vista and utilizes the resources more efficiently improving end user performance. We have seen many new features related to UI and Performance.
One of the best features that is being discussed around is the native support for VHD (Virtual Hard Disk) Yes the same VHD files that are used in virtualization platform i.e.. Hyper-V, Virtual Server and Virtual PC.
Today we will see the following key items.
- Creating native Virtual Hard Disk (VHD) in Windows 7
- Creating and Attaching VHDs using Diskpart utility
- Attaching and Detaching the VHD file
Creating Native Virtual Hard Disk (VHD) in Windows 7
Right Click on My Computer and Click ‘Manage’ that will open up Computer Management, in that click on Disk Management.
Right Click on Disk Management and select ‘Create VHD’ This will open new windows ‘Create and Attach Virtual Hard Disk’
In this windows select the location where you want to create the VHD file. Make sure you have sufficient free space while creating new VHD file. After that provide the Virtual Hard Disk size and format of the VHD.
By default the Fixed size is recommended but you can select Dynamic expanding if you don’t want to allocate the disk space. There would be slight performance difference between fixed size and dynamically expanding.
For production environment it is suggested to go for Fixed size. For the demo purpose we will go ahead with dynamically expanding VHD format.
Click on OK and that will install newly attached (mounted) VHD. Now next step will be initializing the disk
Alright now Right Click on Disk 1 (Blue icon) and click on ‘Initialize’ This will open a new window ‘Initialize Disk.’
Select the partition and click on ‘OK.’ You can leave the current selection to default.
As you can see now the status of the Disk 1 is changed to ‘Online.’ We create a new simple volume on the Disk 1
So Right Click on the ‘Unallocated’ area and select ‘New Simple Volume’ This will launch ‘New Simple Volume Wizard.’
After that click on next and specify size, we will keep the default NTFS File System and select the complete size i.e. 20 GB and click on ‘Next’ to specify drive letter. I will select Drive Letter ‘X:’ and click on ‘Next’
On the next page we will select Label for the drive (in this case ‘Windows7’) and click on ‘Next.’ Now, we will get the brief summary of the choices we selected. Click on ‘Finish’ to continue.
Creating and Attaching VHD using Diskpart utility
Open the Elevated Command Prompt with Administrator Privileges and type the following commands
CREATE VDISK FILE=”c:\win7\win7.vhd” MAXIMUM=20000
SELECT VDISK FILE=”c:\win7\win7.vhd”
CREATE PARTITION PRIMARY
FORMAT QUICK LABEL=Windows7
This will create the VHD file of primary partition. You will see the newly attached disk in Disk Management with Drive Letter X:
Attaching and Detaching VHD in Windows 7
Right Click on My Computer and Click ‘Manage’ that will open up Computer Management, in that click on Disk Management. Just like previous part.
Then Right Click on Disk Management and select ‘Attach VHD’ This will open new windows ‘Attach Virtual Hard Disk’
Click on OK and that will attach the existing Virtual Hard Disk. Now, if you don’t want to make write anything on the VHD, we will select the ‘Read-only’ check box
And subsequently we will have the attached VHD in explorer.
NOW WE WILL DETACH THE VHD
To detach the VHD simply Right Click on the ‘Disk 1’ (Blue Color) and select ‘Detach VHD’
After clicking on ‘Detach VHD’ you will be prompt you with ‘Detach Virtual Hard Disk’ message. Click on OK to detach. Also, if you want delete the VHD permanently you can select the Checkbox.
This way we have seen how can we create new VHDs, attach/detach existing VHDs using Disk Management and Diskpart utility.
In the next part we will how can we boot the newly created VHDs using Windows 7 or Windows Server 2008 R2 (aka Windows Server 7)