|
There is a rather simple and appealing way of installing Windows 8 as a dual-boot option next to Windows 7. The benefit is that you don’t have to mess with / throw away your perfectly good Windows 7 installation to try out Windows 8. Also, you don’t have to change or create partitions since VHD dual boot works off a single file on your hard drive.
You could install it into a VM, of course, but that’s not the same thing as it won’t run on the native hardware but rather on the VM abstraction layers. With VHD dual boot, however, nothing except file IO is being abstracted – it uses your real graphics card, your real WIFI and WWAN controllers and so forth. It is an excellent way of test-driving a new system on your very own, real hardware. And when you’re done with it, getting rid of the system is as easy as deleting the VHD file and removing a boot menu record.
Now, there is an easy way of installing windows 8 into a VHD. The rough outline is to create an empty VHD file and install Windows 8 directly into it.
And there is a harder way. We did it the harder way, of course, simply because we can. Here, the outline is to install Windows 8 onto a spare hard drive, then convert that hard drive into a VHD and then continue as if you’d started the easy way in the first place. While this may sound stupid, it is in fact a very interesting scenario – how to convert a physical system into a virtual one?
These steps will guide you through the latter. If you already have a VHD that you’d like to include for dual boot, skip to the last step.
Install Windows 8 on a spare drive (the straightforward part)
Okay. Do that.
Create a VHD of your system (the easy part)
Use Sysinternals Disk2VHD. This is a simple but powerful helper that creates a VHD from your running system. How cool is that? Point the output to another drive for better performance.
Shrink the size of your VHD (the tricky part)
Why do we have to shrink the VHD after we created it? After all, it’s a dynamic VHD, so what’s the matter?
Turns out you might not need this, but it is very likely that you will. Here’s why. It’s what I ran into.
I installed Win8 on a 500 GB physical drive. The VHD created off it had a size of around 40 GB (that’s because it is a dynamic-sized VHD) and I placed that file onto a drive with approx. 100 GB of free space. When I tried to boot the VHD from that, Windows 8 displayed an error that said VHD_BOOT_HOST_VOLUME_NOT_ENOUGH_SPACE. My understanding is that Windows can’t expand the dynamic VHD to the maximum drive size it is reporting (500 GB) because only 100 GB are available on the “host” drive.
That’s why.
And it works like this:
- Mount your VHD and assign a drive letter to it. To do this, type these commands into an elevated command prompt:
diskpart
select vdisk file=c:\windows8.vhd
attach vdisk
list volume
select volume <volume_number_of_attached_VHD>
assign letter=v
exit
- Defrag it. The Windows-internal tools probably won’t do this properly, because they are not moving some files that are lying around in the middle of your (virtual) partition and this again means that shrinking this partition will only work up to these files, namely the middle of your partition. In my example, this was not enough since 500 GB / 2 > 100 GB. Instead, I used the trial version of PerfectDisk Defragmenter to do this for me. Worked like a charm. If you know positively about other defragmenters that can pull that off, I would be intrigued to hear about it
- Use built-in Computer Management to shrink the partition of your mounted VHD to (almost) the minimum. I found that I had to give it 1-2 GB more space or the tool would return with errors
- Unmount the drive that corresponds to the VHD (right click in Computer Management on the drive -> Detach …)
- Now use VHD Resizer to actually shrink the (reported) size of the VHD. Up to now, we only shrinked the partition size, but that had no impact on the dynamic VHD size
- You’re good to continue to the last step now
Create a boot menu entry that points to your VHD (the, um, last part)
The first step here is again to mount the VHD and assign it a drive letter (see above for instructions)
Next, we’re creating the actual boot record:
cd c:\windows\system32
bcdboot v:\windows
You can verify that a new boot record has been created by opening msconfig.

|
|