Step 18: Create and mount a VHD file
The VHD format is a virtual disk format defined by Microsoft and incorporated by all players in the market for virtualization. In particular, it is supported by Virtual PC, Hyper V, VMware and VirtualBox.
With Windows 7, we can directly create a new virtual disk (which is in the form of a file to the host system) and can also mount it in order to read and write it as if it 's a normal disc. This simplifies the interaction between host systems and virtualized systems. But with Windows 7, it can also restart the PC rather than a physical disk but on a virtual disk, which will simplify some multiboot scenarios.
To create a virtual disk
- Open the Start menu
- Right click on Computer and select Manage
- Click on Disk Management
- In the Action menu, click Create VHD
- Define a location for the virtual disk file, size and type (Dynamic/Fixed)
- Select the disk mounted automatically in error in the list below
- Click the right button on it and select Initialize
- Click on the space adjacent the right button and select New Simple Volume
- Proceed with formatting.
To mount a virtual disk
- Open the Start menu
- Right click on Computer and select Manage
- Click on Disk Management
- In the Action menu, click Attach VHD
- Specify the location of the VHD file on your hard
- Note that you can mount a VHD disc read-only!
To boot from a ramdisk
- You can not boot a VHD virtual disk if it contains a Windows 7 or Windows Server R2, the system booted to natively support the VHD disk attachment.
- There are several ways to boot a VHD, but the easiest is to start the command line interface and then enter the command:
Code:
bcdedit /export c:\sauvebcd
bcdedit /copy {default} /d "Windows 7 on VHD"
the command returns a GUID to use in the 2 following commands:
Code:
bcdedit /set {GUID} device vhd=[E:]\demowin7.vhd
bcdedit /set {GUID} osdevice vhd=[E:]\demowin7.vhd
Exit
Now run "msconfig" from the Start menu to see that the setup has been validated and identify possible VHD as the default boot!
Bookmarks