VHDs are files used by applications such as Virtual PC and
Hyper-V to enable virtualized systems to function like their physical
counterparts. Windows 8 enables a copy of the operating system to use a
VHD to start. This process is much like creating a Windows To Go
workspace in that the installation image must be placed on a VHD and
then the media configured to start, but it is also like a standard
configuration because, generally, VHD files are stored on a computer
and used as the startup media for that system.
The idea of using a virtual hard disk on a workstation or laptop is
interesting, and the performance and recoverability provided by doing
this can be worth the extra work. Although they provide some benefits
similar to those found with Windows To Go workspaces, startup VHDs are
more permanent than a version of Windows that travels like Windows To
Go workspaces. Using VHDs to test new versions of Windows provides
another way that your existing system can remain intact while allowing
new functionality to be put through any testing needed to feel
comfortable with the technology.
Windows 8 can be started from
a VHD. The VHD in this case is a file that contains a functional copy
of Windows and behaves like a physical hard disk. The computer is
configured to start from either the physical hard disk or the VHD.
During startup, you select which environment to load. Some of the
benefits of using a VHD include the following:
-
The ability to start multiple operating systems on the same hardware.
-
Portability of the operating system contained within a VHD.
-
Ease of creation and disposal. By using this environment, another
operating system can be configured in a fairly short time. When you are
finished with it, the files can be deleted to reclaim the disk space
the virtual hard disk used.
-
No damage to existing files. Using a VHD also keeps your original
environment safe from any modifications made inside the new environment.
There are two ways to accomplish Windows 8 startup from a VHD file.
The first option is to use a pre-created VHD file built using the
Windows GUI, which you can attach to the operating system for use as a
start device or during the installation process of Windows 8 using DiskPart.
The second option is to create the VHD during the installation process
by using DiskPart. This lesson describes both processes; they are
similar and take about the same amount of time to perform.
Creating a VHD from an existing installation
As part of the following procedure, the DiskPart command-line
utility will be used when the installation of Windows 8 gets underway
to attach the virtual hard disk file to your computer to be detected by
Windows. This allows the VHD to be used as a target for the Windows
installation.
To create a virtual hard disk file from within your existing
installation of Windows 8 by using the GUI, complete the following
steps:
-
Tap or click the Desktop tile and then tap or click the File Explorer icon in the toolbar.
-
Press and hold or right-click Computer and then tap or click Manage.
-
Tap or click the Disk Management node in the navigation console. In
the Actions pane, tap or click More Actions, and then tap or click
Create VHD.
-
Type the following path and file name for the VHD: C:\win8.vhd.
-
Type a container size and select the unit (MB, GB, or TB). Select
the VHD format and whether it will be expandable or fixed-size.
Note
SELECTING THIN-PROVISIONED OR FIXED-SIZE VHDS
A fixed-size VHD file is limited to the size that is specified at creation. For example, creating
a fixed-size VHD with 80 GB of space allocates the full amount of disk
space at the time of creation, similar to a traditional hard disk that
has a fixed size.
Using thinly provisioned VHD files enables you to specify the same
80-GB maximum size, but the VHD file consumes only the actual storage
space needed for the files it contains. For example, if the Windows 8
installation into an 80-GB, thinly provisioned VHD consumes only 10 GB
of space after the initial installation, the size of the VHD file will
be 10 GB. Windows, however, will report the full size of the disk, 80
GB, and the VHD will dynamically expand up to 80 GB to accommodate
additional apps and data.
-
Tap or click OK.
The new VHD appears in Disk Management as Not Initialized.
-
Close Computer Management and insert your Windows 8 media. Restart your computer and start from the Windows 8 media.
-
When the installation begins, tap or click Next, tap or click
Install Now, enter the product key, accept the license terms, and
select the installation type to perform: Upgrade or Custom.
In this case, a custom installation would be appropriate because you are installing Windows 8 on a new VHD hard disk.
-
Press Shift+F10 to open a command prompt. Do not select a location
to install Windows because your previously created VHD will not be
listed in the available disks window.
-
At the command prompt, type Diskpart
to enter the
DiskPart tool. From within DiskPart, you need to discover some basic
information about the disks available for use by the installer. You’re
looking for the following two things in particular:
-
Type List Disk at the DiskPart prompt and make a note of the ID numbers assigned to available disks in the system.
-
Type select disk # at the command line, where # is the number of the disk where your readied VHD is.
-
With the disk selected, type List Volume at the command line and press Enter.
This displays the volumes available and the drive letters associated
with them. You will need the drive letter information to attach the VHD.
-
To identify the VHD you want to attach, type select VDisk file=<path to VHD> where <path to VHD> is the actual path to the VHD file, for example, C:\vhd\windows8.vhd.
-
With the VHD selected, type attach VDisk to attach the VHD.
-
Type exit and press Enter to exit DiskPart, then type exit and press Enter again to close the command prompt window.
-
Tap or click the refresh option on the disk selection window. You
should now see your VHD file listed as an installation target, denoted
by the size of the virtual disk specified at creation. Select this disk
as an installation target, ignoring the warning that appears, saying
that you cannot install Windows on this disk. Tap or click Next.
-
When the process completes, remove the installation media and
restart your computer to the hard drive. When you do this, the Windows
8 boot menu displays your choices for any installations directly on the
hard drive and any VHD installations you have available. Select the
system you want to start and press Enter.