Saturday, October 4, 2014

Native VHD Boot Windows 10 Tech Preview

Interested in trying out the new Windows 10 tech preview but rather not partition your HDD/SSD? Native VHD boot will be your best bet. Basically you create a VHD, install the OS and boot from the VHD. If you want a better understanding of the concept take a look at this technet article: http://technet.microsoft.com/en-us/library/hh825689.aspx 

Before we begin I do want to add that this is not the only way to do it. In fact this can be done a bunch of different ways using the GUI etc. This was easy for my since I already had the Windows ADK installed and I've used the commands before.

Here are the steps I took to boot Windows 10 from a VHD using Windows 8.1
  1. Download the Windows 10 Tech Preview

  2. Download and Install the Windows ADK from http://www.microsoft.com/en-US/download/details.aspx?id=39982 

  3. Create a VHD using diskpart

    Run command prompt as an administrator and type the following

  4.  create vdisk file="C:\VHDs\Win10Ent.vhdx” type=fixed maximum=40000   
     select vdisk file="C:\VHDs\Win10Ent.vhdx”   
     attach vdisk   
     Create partition primary   
     Assign letter=w   
     format fs=ntfs quick   
     exit  

  5. Mount the Windows 10 ISO

     Powershell  
     Mount-DiskImage -ImagePath "C:\ISOs\Win10Ent.ISO"  

    This will mount the ISO using the next letter available. In my case it was F:

  6. Install Windows 10 to the VHD we created
    I was curious if there was more than one version in the Install.wim.

     C:\>dism /Get-WimInfo /WimFile:"F:/Sources/install.wim"  
     Deployment Image Servicing and Management tool  
     Version: 6.3.9600.17031  
     Details for image : F:/Sources/install.wim  
     Index : 1  
     Name : Windows Technical Preview for Enterprise  
     Description : Windows Technical Preview for Enterprise  
     Size : 13,064,126,543 bytes  
     The operation completed successfully.  
    

  7. Only one version which makes our choice easier. Now let's install Windows 10 to our VHD
     C:\>dism /apply-image /imagefile:"F:/Sources/Install.wim" /Index:1 /ApplyDir:W:\  
     Deployment Image Servicing and Management tool  
     Version: 6.3.9600.17031  
     Applying image  
     [==========================100.0%==========================]  
     The operation completed successfully.  
    

    Once the operation is completed successfully you will notice that if you browse the VHD it will have the directory structure of Windows.

  8. Configuring boot options
    There are 100 different ways to do it but the easiest I found was to run the below command
     bcdboot W:\Windows  
    

    Now run bcdedit /enum to make sure the entry was created
  9. Finally we will need to detach the VHD to prevent any corruption
     diskpart  
     select vdisk file="C:\VHDs\Win10Ent.vhdx"   
     detach vdisk   
     exit  
    

  10. That's it. Now when you reboot you will notice that you can choose Windows Technical Preview. Enjoy!