Step by step guide install Windows 10 using boot to VHD feature

Windows 10 is coming this year, as technology enthusiast I always interested to tryout and explore features set and developer opportunities. In this blog post I will explain how to install and explore windows 10 safely on your computer without using virtual machine software or creating new partition in your hard drive.

Boot to VHD

Boot to VHD is feature in Windows 7 (higher) system , that allows to boot windows operating system from the VHD file ( virtual hard disk file ). Basically Windows 7 systems boot loader understands , how to boot from VHD file. I wrote blog post how to do it for Windows 7 (here). In this blog post I will show how to do it on Windows 8 .

First thing download windows 10 iso file from Microsoft site. You can download the iso file by be joining Microsoft Windows insider program.

Create VHD/VHDX file from the ISO.

  • Download the Convert-WindowsImage.ps1 PowerShell script from TechNet site that allows you to create VHD/VHDX file from ISO.Launch PowerShell command  prompt as administrator, execute command to enable execution of unsigned scripts ,

Set-ExecutionPolicy Bypass -Scope Process

  • Run downloaded script in interactive mode by executing .\Convert-WindowsImage.ps1 –ShowUI command . At the end of the execution it scripts creates vhdx file  in the working directory.

image

  • Mount the virtual hard disk image from working directory.

image

  • Once image is mounted  you should be able to see new drive in your explorer. In my case it is attached ‘G’ drive.

image

 

Update boot record.

  • Now run following command create new bootable entry. Replace G:\Windows with your location where vhdx image is mounted

bcdboot G:\windows

image

  • Verify that boot order is updated properly by running msconfig.exe. You should see new entry.

image

  • Restart computer , you should new boot option.

Uninstall Windows 10 (Removing boot entry).

If you want to remove boot entry you can follow the steps

  • Launch msconfig.exe from the admin command prompt  and select entry you want to delete and press delete, reboot.

image

 

 

Advertisements

Create Bootable VHD from the Windows 7/Windows 8/Windows 2012 ISO

In my previous blog post I explained how to use windows 7 Boot to VHD feature to dual boot computer without installing OS in different partition.

To use this feature you need to have VHD file with OS installed. This blog post points to resource that allows you to create bootable VHD from Windows 7/Server 2008 R2 and Windows 8/Server 2012 setup media.

Technology used to create VHD is already built into Windows 7 and higher, in the form of Virtual Hard Disk & Windows Imaging Interface API, these API are exported from virtdisk.dll and Wimgapi.dll.

Following blog post explains how to use these built-in API in PowerShell script

http://www.pitorque.de/MisterGoodcat/post/Installing-Windows-8-Developer-Preview-as-bootable-VHD.aspx

Note: PowerShell script referred in the blog post is no longer available , use the alternative link here

Resources

  1. Virtual Hard disk API reference.
  2. Windows Imaging API reference.
  3. Windows 8 Enterprise 90-day evaluation.
  4. New Windows 8 specific  PowerShell script for creating bootable VHD.

Simple way to try new Windows OS using Boot to VHD

Try out new windows 8 release preview  or  windows server 2012 operating systems without install using Boot to VHD.

Boot to VHD is feature in Windows 7 (higher) system , that allows to boot windows operating system from the VHD file ( virtual hard disk file ). Basically Windows 7 systems boot loader understands , how to boot from VHD file.

Typical way of using boot to VHD feature involves , using command line tools such as diskpart and bcdedit which is cumbersome. Recently I was watching videos from TechEd North America 2012 , in one of the session presenter showed simple way to do the same.

Advantage of using boot VHD  over running in virtual machine ( Virtual Box or VMWare workstation) is  , OS present in VHD will get full access to actual physical hardware instead of virtualized hardware. This will allow OS perform better compared to virtual machine.

Here are the steps,

1. Download Windows Server 2012 VHD file from Microsoft site.   If you want Windows 8 release preview  , you need to create one. I will explain how in the next blog post.

2. Once you have VHD file , use run disk management tool “diskmgmt.msc”.

3. Select “Attach VHD” option from the “Action” Menu.

image

4. “Select/Enter” path to VHD location

image

5. Windows will mount the VHD and assigns drive letter. Note down the drive lettter. In my case it is mount as “G” drive. Now from the explorer you can see the “G” drive.

image

6. Launch command prompt in “Administrator” mode. Type following command to make entry in the windows boot loader

c:\Windows\system32\bcdboot G:\Windows

Note: Replace “G” with the drive letter depending on you system where VHD is mounted.

image

7. Launch “msconfig.exe” from the “Administrator” command prompt to verify that new boot entry is added in the boot loader.

image

You can change the boot order from here.

Note: Replace “G” with the drive letter depending on you system where VHD is mounted

8. If you reboot the system, now you will have option to boot into new OS.

9. Using same steps you can try out new Windows 8 client OS , if you have VHD file.

Resources

1. Windows 2012 RC VHD file

2. Creating Windows 8 Release preview VHD from ISO.

3. Watch “The Busy Developer’s Guide to Virtualization”  talk on Channel9