So the latest version of the Windows 10 tech preview is out and it is pretty snazzy! Being the daredevil rouge that I am I decided to try it out on my work laptop (being the only Windows PC I have) and have had great success. While I wanted to try it out I didn’t want to chance destroying all my data and I also wanted an easy back out if I didn’t like it. Neither a format/reinstall nor an upgrade suit these requirements so it was time to try something even cooler, booting from VHDX
!
Most people will know VHD(X)
s as the file format of Hyper-V but there is another cool way of using this disk image. Windows (or really the boot loader) has had the feature of booting from VHD
since Windows Vista but it hasn’t been a really popular one. This is a shame as it is a great way to test out different Windows versions without much risk.
There are two main ways of installing to VHD(X)
, doing a normal Windows install via USB key/DVD or using DISM
to apply the install WIM
directly to the VHD
. The only real difference between the two options is the Windows boot loader will be upgraded with the “normal” install and be graphical. The DISM
way will give you just the usual text boot loader. I did the “normal” way but the choice is yours.
Without further ado, the steps.
What you will need
- Windows 10 Technical Preview ISO from http://windows.microsoft.com/en-au/windows/preview-iso
- If you are following the “normal” way:
- USB key for booting
- Windows USB/DVD Download Tool from http://wudt.codeplex.com/
Setting up the Windows 10 disk
First we will need to setup the virtual hard drive that Windows 10 is going to live in. No matter which “way” you choose you will need to perform these steps.
- Open command prompt
- Type
diskmgmt
- Go to
Action
thenCreate VHD
- In the
Location:
box typeC:\Win10.vhdx
- We want to use the newest VHD format available so select
VHDX
if it is available to you - As I don’t want to waste all my disk space in one hit I selected
Dynamically expanding (Recommended)
Note: Dynamically expanding only says recommended when you use the VHDX
format however you can use it with VHD
. The only small downside to dynamically expanding is a performance hit as there will be more than one operation per write.
- I selected a
Virtual hard disk size:
of 40GB as I won’t be installing that much and I will still have access to my original operating system as anE:
drive - Click OK
- Once the disk is created you will see an uninitialized disk ready for Windows 10!
The Normal Way
- Insert your USB key and find out which drive letter it is
- Install the Windows USB/DVD Download Tool that was downloaded earlier
Note: You will need .NET 2.0 to install this tool.
- Launch the tool and follow the wizard to copy the ISO to the USB key
- Reboot the computer and boot from the USB key
- Follow the wizard as per every other Windows install until you get to the disk configuration section
- Press SHIFT+F10 to launch a command prompt
- From the command prompt we will now attach the
VHD(X)
using the following commands
diskpart
select vdisk file=E:\Win10.vhdx
attach vdisk
- Click back to the disk selection screen and then click refresh
- You should now see your blank drive
- Select the drive and click next
Note: You will see a message that it can’t be installed on this drive, you can safely ignore that.
- Finish the Windows install
- On next boot you will be prompted to select which operating system to boot, just select Windows Technical Preview to get into your new Windows 10 install!
The DISM Way
- Right-click the new drive and click initialise
- Format the drive as
NTFS
- Mount the drive as letter
X:
- Find your Windows 10 ISO (it should be something like
Windows10_TechnicalPreview_x64_EN-US_9926.iso
) - Double-click the ISO to mount it (or use your favorite ISO mounting tool)
- Check the drive letters of the new
VHD(X)
and of the mounted ISO - Assuming the mounted
VHD(X)
isX:
and the DVD is mounted asD:
, run the following command to apply the Windows install
dism /apply-image /imagefile:D:\sources\install.wim /index:1 /ApplyDir:X:\
- Once
DISM
is complete the new drive will need to be added to the boot menu with the following command
bcdboot X:\Windows
- Now the computer can be rebooted
- On next boot you will be prompted to select which operating system to boot, just select Windows Technical Preview
- Windows 10 will now finish installing to get ready for first use
Going back
Don’t like Windows 10 or are having issues?
- Reboot to get into your previous operating system by selecting it from the boot loader
- Backup the BCD store using
BCDEdit
bcdedit /export c:\bcd_store_backup
- View the BCD store to grab the identifier of Windows 10
bcdedit /v
- Delete the Windows 10 entry
bcdedit /delete <identifier string>
- Delete the
C:\Win10.vhdx
file from your hard drive