How to dual-boot Windows 8 with Windows 7 using VHD – Virtual Hard Disk (step-by-step)

Dual-Boot - Windows 8 and Windows 7

This Windows How-To will teach you step-by-step how to install Windows 8 Developer Preview in a VHD (Virtual Hard Disk), that way you can dual-boot Windows 8 alongside Windows 7 without modifying your current operating system setup.

If you are a Windows 7 user and you want to test Windows 8, this is a great way to accomplish that. Using a VHD to dual-boot will be as if the OS was installed directly in a partition or in a different hard drive in your computer, but without having the need of risking the current Windows 7 installation or repartitioning the hard drive, and there is not boot loader to configure. At the start-up you’ll be able to choose which operating system you want to boot, then to switch back you would just need to reboot and select the OS you want to use next.

Notes:

Important: Even though this process doesn’t modify the partition where Windows 7 is installed, you should always consider backing up your computer in case something go wrong — How to create and restore a system image (full backup) in Windows 7.

Downloading Windows 8 and creating a bootable media

If you haven’t done it yet, here are the links to download all the versions of Windows 8 Developer Preview, and here is how to create a bootable USB drive or bootable DVD for Windows 8.

Creating a VHD (Virtual Hard Drive) using the Command Prompt

Once you are done creating a bootable media, follow the steps below to create a VHD to install Windows 8, using the Command Prompt from the Windows install wizard.

1. Insert the bootable Windows 8 media in the computer running Windows 7 and reboot. 

Note: Make sure that your computer is configured to boot from either DVD or USB drive. This can be configured at the computer’s BIOS — Refer to your computer’s user manual to learn how to do this.

2. Click Next at the beginning of the wizard and then press Shift+F10 to bring the Command Prompt.

3. Type the following command to start Diskpart, which is a utility that enables enhance storage configuration and can be used to create a new VHD:

diskpart

4. Next, you need to see a list of all the current attached disks in your system, use the following command to do this:

list disk

5. Now, select the disk where you want to create the new Virtual Hard Disk with this command:

select disk 1
Note: Your disk number may be different from the one I am using here. This is because I don’t have space in the disk where Windows 7 is installed, I am using disk 1 which is a different hard drive installed in this lab computer.

7. To continue with the next step, you’ll need to know the drive letter of the disk you are about to create the VHD, so type the next command:

list vol

Diskpart VHD - Windows 8

8. The following command will create a Dynamic VHD that can grow up to 30GB in the hard drive you have selected (e.g., Windows 7 root drive or different hard drive). In the case your hard drive’s free space is less than, let say, 30GB then be sure you use a smaller number, but you need to have at least 20GB of available space in the hard drive to install Windows 8 Developer Preview:

create vdisk file=D:\Windows8dp.vhd maximum=30000 type=expandable

9. Select the Virtual Hard Disk with the following command:

select vdisk file=D:\Windows8dp.vhd

10. Next, mount the VHD that way it become available to the Windows installer:

attach vdisk

11. To finish with this operation type:

exit

Create VHD (Virtual Hard Disk) - Windows 8

OK, so far you started Diskpart, list all the disks in your system and selected the disk where you want to install Windows 8, then you listed all the volume to identify the drive letter of the disk that is going to house the new operating system, and created, selected and attached the new Virtual Hard Disk to make it available to the Windows installer. Next to dual-boot Windows 8 with Windows 7, it is just the matter of installing the OS in this new VHD.

Installing Windows 8 on a VHD (Dual-boot with Windows 7)

1. Once you have exited the Command Prompt and you are at the Windows install wizard, click Install Now to continue, accept the license, click Next and the choose Custom (advanced).

2. In “Where do you want to install Windows?”, select the Virtual Hard Disk that you just created, the disk should have a part of the label that reads: “Unallocated Space”. The disk number will be different depending on your configuration.

Install Windows 8 - Virtual Hard Disk

Quick Tip: Another hint to know that you’re about to install Windows 8 in the right hard drive is by checking the Total Side of the disk and Free Space. In my case I created a VHD of 30GB and the Windows installer is showing Disk 2 Unallocated Space with a total size of 29.3GB and the same amount of free space, so this is the right hard drive (VHD).

Oh, and don’t worry on the bottom where it says “Windows cannot be installed to this disk.”, just click Next and the installation will begin.

After the installation has completed the Windows 8 boot loader will run and it will ask you Choose an operating system. There you will be able to choose either to start Windows 7 or the new Windows 8. Also during the install, the boot loader will only appear for 3 second, after that you’ll have a good 30 seconds to choose which operating system to start, before starting the first operating system on the list, in which case will be Windows 8.

Boot Loader - Dual-boot Windows 8 and Windows 7

3. When you select to start Windows 8 for the first time, you’ll go through the Personalize, Settings, and creating a local user account to complete the installation.

VHD Windows 8 - Desktop

That’s it, now you can test Windows 8 without modifying the Windows 7 installation, and you are even able to access the Windows 7 partition by just using the Windows Explorer, which you’ll noticed that it will appear with a different drive letter, i.e., D:\.

Enjoy testing Windows 8 Developer Preview!

About the author

Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade. Mauro has over 14 years of experience writing comprehensive guides and creating professional videos about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 20 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and About.me.